From litvak at TX.TECHNION.AC.IL Thu Mar 1 13:00:22 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 12:00:22 -0000 Subject: TopoplotTFR Message-ID: Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 1 13:06:50 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 1 Mar 2007 13:06:50 +0100 Subject: TopoplotTFR In-Reply-To: <000001c75bf9$38f23450$f0463ec1@sobell.ion.ucl.ac.uk> Message-ID: Dear Vladimir, Your xlim and ylim should be defined as two-element vectors, specifying the upper and lower boundaries. So you can only plot subsets of contiguous time-frequency points. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 1 13:12:57 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 1 Mar 2007 13:12:57 +0100 Subject: TopoplotTFR In-Reply-To: <000001c75bf9$38f23450$f0463ec1@sobell.ion.ucl.ac.uk> Message-ID: Oops. I'm sorry, I misread your mail; I thought you were talking about multiplotTFR. Forget what I said before. To my knowledge, a subplotted topoplotTFR only works in the time dimension, but I'm not sure. Did you check the code? So if it is true, that it only works in the time dimension, there are two ways of doing what you want: Repeatedly call topoplotTFR for different frequencies, or adjust the function such that it also works the other way. Maybe you could look into if and why the assignment of the yparam and xparam should always be 'time', and 'freq' respectively. I guess the original reason stems from the fact that we are used to depict TFRs like that. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TX.TECHNION.AC.IL Thu Mar 1 13:19:18 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 12:19:18 -0000 Subject: TopoplotTFR In-Reply-To: <000901c75bfa$18299b40$902dae83@fcdonders.nl> Message-ID: So how do I do a multiple plot? It did work before and works even now for time. Thanks, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jan Mathijs Schoffelen Sent: Thursday, March 01, 2007 12:07 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR Dear Vladimir, Your xlim and ylim should be defined as two-element vectors, specifying the upper and lower boundaries. So you can only plot subsets of contiguous time-frequency points. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TX.TECHNION.AC.IL Thu Mar 1 15:46:28 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 14:46:28 -0000 Subject: TopoplotTFR In-Reply-To: <000e01c75bfa$f2dd27c0$902dae83@fcdonders.nl> Message-ID: I looked at the code and the problem is in line 264 of topoplotER where you assume that the yparam is always the second dimension in the data and the xparam is always the third. When this assumption is false, the code fails. Best, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jan Mathijs Schoffelen Sent: Thursday, March 01, 2007 12:13 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR Oops. I'm sorry, I misread your mail; I thought you were talking about multiplotTFR. Forget what I said before. To my knowledge, a subplotted topoplotTFR only works in the time dimension, but I'm not sure. Did you check the code? So if it is true, that it only works in the time dimension, there are two ways of doing what you want: Repeatedly call topoplotTFR for different frequencies, or adjust the function such that it also works the other way. Maybe you could look into if and why the assignment of the yparam and xparam should always be 'time', and 'freq' respectively. I guess the original reason stems from the fact that we are used to depict TFRs like that. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TX.TECHNION.AC.IL Thu Mar 1 16:22:24 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 15:22:24 -0000 Subject: TopoplotTFR In-Reply-To: <002101c75c10$650113b0$f0463ec1@sobell.ion.ucl.ac.uk> Message-ID: Here is my suggestion for a fix. It should handle any number of dimensions, which is perhaps slightly overkill for this case, but hope it works. I tested it for time and frequency. Best, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 2:46 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR I looked at the code and the problem is in line 264 of topoplotER where you assume that the yparam is always the second dimension in the data and the xparam is always the third. When this assumption is false, the code fails. Best, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jan Mathijs Schoffelen Sent: Thursday, March 01, 2007 12:13 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR Oops. I'm sorry, I misread your mail; I thought you were talking about multiplotTFR. Forget what I said before. To my knowledge, a subplotted topoplotTFR only works in the time dimension, but I'm not sure. Did you check the code? So if it is true, that it only works in the time dimension, there are two ways of doing what you want: Repeatedly call topoplotTFR for different frequencies, or adjust the function such that it also works the other way. Maybe you could look into if and why the assignment of the yparam and xparam should always be 'time', and 'freq' respectively. I guess the original reason stems from the fact that we are used to depict TFRs like that. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: topoplotER.m URL: From Brian.Roach at YALE.EDU Fri Mar 2 00:02:50 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 1 Mar 2007 18:02:50 -0500 Subject: sourceanalysis.m on EEG data In-Reply-To: <45D1E6AA.3080708@uke.uni-hamburg.de> Message-ID: Till, Thanks so much for the tutorial document. After a recent grant submission, we have some time to really dig into this, and I have a question for you: from the doc... 1) Create BEM model using the following example script (link to 'BEM example script'): - create brain, skull and skin compartments using volumesegment.m and image processing functions - use these compartments as input for the prepare_bemmodel.m function (which uses the C-Program 'Dipoli', available upon request ) ... Do you have a BEM example script, or should I try to use what is listed on the field trip website (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:create_bem_headmodel_for_eeg)? I wasn't sure which you intended to have someone use. thanks, Brian At 11:26 AM 2/13/2007, you wrote: >Dear Brian, > >I`ve worked with the prepare_bemmodel script for constructing a forward >model for source localization of EEG data. Find attached a little tutorial >with the steps I took for creating the BEM from an individual MRI. The >plan is to put it also on the fieldtrip wiki (sooner or later). Please let >me know if you have questions on this tutorial. > >Hope this helps, >Till > > >Robert Oostenveld schrieb: >>The prepare_bemmodel function is in the zip file on the ftp server. The >>dipoli executable is attached to this mail. There exists only a linux >>i386 and an apple PPC version. You are not permitted to distribute the >>dipoli executable, it is not covered under the GPL license but made >>available courtesy of Thom Oostendorp. >> >>best regards, >>Robert >> >>On 12 Feb 2007, at 22:32, Brian Roach wrote: >> >>>Where can I find these functions listed below? >>> >>>% the prepare_bemmodel function is available upon request % the dipoli >>>stand-alone executable is available upon request >> > > From weisz at LYON.INSERM.FR Fri Mar 2 18:40:12 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Fri, 2 Mar 2007 18:40:12 +0100 Subject: first steps using lcmv Message-ID: Hi everyone, in order to explore the usage of the lcmv option of sourceanalysis i'm using eeg data (35 electrodes) with an auditory N1. topography is attached. within fieldtrip i did a dipolefit, and the output looks relatively sensible (perhaps a little deep and posterior, but overall not bad for EEG :-)). however when i run lcmv sourceanalysis, plotting the "neural activation index" gives me something really terrible (also attached). since the "solution" appears relatively clear in this case, i guess i have done something stupid at some point. the steps: dat=eeglab2fieldtrip(EEG,'preprocessing'); cfg=[]; cfg.latency=[.09 .12]; %latency of my N1 cfg.covariance='yes'; cfg.keeptrials='yes'; datTest=timelockanalysis(cfg,dat); vol = []; vol.r = [0.88 0.92 1.00]*85; vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; cfg=[]; cfg.vol=vol; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; [grid] = prepare_leadfield(cfg, datTest); %the same LF-matrix used for 'good' dipole fit cfg=[]; cfg.grid=source2sparse(grid); cfg.method='lcmv'; cfg.vol=vol; cfg.projectnoise='yes'; [sourceN1] = sourceanalysis(cfg, datTest); cfg=[]; cfg.powmethod='none'; %only option that works [sourcenai] = sourcedescriptives(cfg, sourceN1); cfg =[]; cfg.funparameter = 'nai'; sourceN1F=source2full(sourcenai); [interp]=sourceinterpolate(cfg,sourceN1F,mri); sliceinterp(cfg,interp) I'd really appreciate pointers of what I may be doing wrong. thanks a lot, nathan ps: as for the mri, i'm using the mri in MRI4Fieldtrip with coordinates transformed to conform my headmodel coordinates. -------------- next part -------------- A non-text attachment was scrubbed... Name: N1Topo.png Type: application/applefile Size: 70 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1Topo.png Type: image/png Size: 23336 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1DipoleFit.png Type: application/applefile Size: 75 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1DipoleFit.png Type: image/png Size: 64060 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1LCMV.png Type: application/applefile Size: 70 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1LCMV.png Type: image/png Size: 197863 bytes Desc: not available URL: -------------- next part -------------- From t.schneider at UKE.UNI-HAMBURG.DE Fri Mar 2 18:17:04 2007 From: t.schneider at UKE.UNI-HAMBURG.DE (Till Schneider) Date: Fri, 2 Mar 2007 18:17:04 +0100 Subject: sourceanalysis.m on EEG data In-Reply-To: <6.1.2.0.2.20070301175929.027d6eb0@email.med.yale.edu> Message-ID: Dear Brian, basically you can use the example script from the field trip website. Additionally, I attach the script we used for most of our subjects. We made some slight changes, in order to adapt it to our individual MRIs. We had for example a very large Field of View containing the whole neck, so we dropped these voxels. You have to adapt the script to your images and make some plots in between to check the results of the intermediate steps (e.g. with sourceplot.m). To align the indiviual electrode positions to the headmodel you can use the fieldtrip function electroderealign.m. See the example script: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:align_eeg_electrode_positions_to_bem_headmodel for usage. Best regards, Till Brian Roach schrieb: > Till, > > Thanks so much for the tutorial document. After a recent grant > submission, we have some time to really dig into this, and I have a > question for you: > > from the doc... > 1) Create BEM model using the following example script (link to > 'BEM example script'): > - create brain, skull and skin compartments using volumesegment.m and > image processing functions > - use these compartments as input for the prepare_bemmodel.m function > (which uses the C-Program 'Dipoli', available upon request ) > > ... > Do you have a BEM example script, or should I try to use what is > listed on the field trip website > (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:create_bem_headmodel_for_eeg)? > > I wasn't sure which you intended to have someone use. > > thanks, > Brian > At 11:26 AM 2/13/2007, you wrote: >> Dear Brian, >> >> I`ve worked with the prepare_bemmodel script for constructing a >> forward model for source localization of EEG data. Find attached a >> little tutorial with the steps I took for creating the BEM from an >> individual MRI. The plan is to put it also on the fieldtrip wiki >> (sooner or later). Please let me know if you have questions on this >> tutorial. >> >> Hope this helps, >> Till >> >> >> Robert Oostenveld schrieb: >>> The prepare_bemmodel function is in the zip file on the ftp server. >>> The dipoli executable is attached to this mail. There exists only a >>> linux i386 and an apple PPC version. You are not permitted to >>> distribute the dipoli executable, it is not covered under the GPL >>> license but made available courtesy of Thom Oostendorp. >>> >>> best regards, >>> Robert >>> >>> On 12 Feb 2007, at 22:32, Brian Roach wrote: >>> >>>> Where can I find these functions listed below? >>>> >>>> % the prepare_bemmodel function is available upon request % the >>>> dipoli stand-alone executable is available upon request >>> >> >> > > -- Till Schneider, Dipl.Psych. Universitaetsklinikum Hamburg-Eppendorf Institut fuer Neurophysiologie und Pathophysiologie Martinistr. 52 20246 Hamburg Germany tel +49-40-42803-3188 fax +49-40-42803-7752 mobil +49-178-2834030 -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf Körperschaft des öffentlichen Rechts Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Jörg F. Debatin (Vorsitzender) Dr. Alexander Kirstein Ricarda Klein Prof. Dr. Rolf A.K. Stahl -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: createbem_example.m URL: From muthuraman10 at HOTMAIL.COM Mon Mar 5 10:42:17 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Mon, 5 Mar 2007 09:42:17 +0000 Subject: Plotting using Slice! In-Reply-To: <010201c75a63$4710e460$642dae83@fcdonders.nl> Message-ID: Hello, Thanks for the reply, i am little confused at this stage okay, to make things clear in the fieldtrip documentation page it is given that i need to specify the anatomy of the data for the source plot in which case i do not have a anatomical MRI, next if i can follow the steps as you have mentioned to plot using 'slice' with the functional data in my case 'coh' coherence Because i cannot use sourceinterpolate.m or volumenormalize.m without any anatomical data these are my configuration steps on the way to 'DICS' in which the eleclead1 contains the locations for the 64 electrodes from the sphere2 standard locations from the fieldtrip page %SOURCE ANALYSIS DICS elec = []; elec.pnt = randn(64,3); load('C:\muthu\work\fieldtrip-20070222\eleclead1.mat') dum = sqrt(sum(elec.pnt.^2,2)); elec.pnt = 12 * elec.pnt ./ [dum dum dum]; vol = []; vol.r = 12 * [0.88 0.92 1.00]; vol.c = [1 1/80 1]; vol.o = [0 0 0]; cfg1 = []; cfg1.elec = elec; cfg1.vol = vol; cfg1.resolution = 2; grid = prepare_leadfield(cfg1); cfg.frequency=9; cfg.method='dics'; cfg.grid=grid; cfg.elec=elec; cfg.vol=vol; [source]=sourceanalysis(cfg,freqmtmfft); What is the configuration for the source plot can be use to plot? So in this case my functional data for the source plot to be coherence 'coh' cfg1.method='slice'; cfg1.funparameter='coh'; cfg1.maskparameter='coh'; cfg1.volume=vol; cfg1.nslices = 20; cfg1.slicedim = 3; sourceplot(cfg1,'..'); Thanking you With regards M.Muthuraman. >From: Ingrid Nieuwenhuis >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] Plotting using Slice! >Date: Tue, 27 Feb 2007 12:34:44 +0100 > >Hi Muthuraman, > >What are you trying to plot? Could you send which fields are in your >freqmtmfft? > >Bests Ingrid > >-----Original Message----- >From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf >Of Muthuraman Muthuraman >Sent: Tuesday, February 27, 2007 12:20 PM >To: FIELDTRIP at NIC.SURFNET.NL >Subject: [FIELDTRIP] Plotting using Slice! > >Hello Fieldtrippers, > >I am not sure whether this mail has reached the group ! I am sending it >again ! >Thanks for the answer, i tried to plot using the source plot with this >configuration >and i get the error, in this case should i need to transform the data >before > >plotting using slice >any comments on this > >cfg.method='slice'; >cfg.funparameter='coh'; >cfg.nslices = 20; >cfg.slicedim = 3; >sourceplot(cfg,freqmtmfft); >??? Reference to non-existent field 'dim'. > >Error in ==> fieldtrip-20070222\private\grid2transform at 9 >if ~isfield(volume, 'xgrid'), volume.xgrid=1:volume.dim(1); end > >Error in ==> sourceplot at 189 >data = grid2transform(data); > >Thanking you > >With regards >M.Muthuraman. > >_________________________________________________________________ >News and updates from Indian diaspora http://content.msn.co.in/NRI/Default _________________________________________________________________ Gossips, movie reviews, photogallery and more http://content.msn.co.in/Entertainment/Default From r.oostenveld at FCDONDERS.RU.NL Mon Mar 5 17:56:33 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 5 Mar 2007 17:56:33 +0100 Subject: first steps using lcmv In-Reply-To: Message-ID: Hi Nathan, On 2 Mar 2007, at 18:40, Nathan Weisz wrote: > in order to explore the usage of the lcmv option of sourceanalysis > i'm using eeg data (35 electrodes) with an auditory N1. topography > is attached. within fieldtrip i did a dipolefit, and the output > looks relatively sensible (perhaps a little deep and posterior, but > overall not bad for EEG :-)). however when i run lcmv > sourceanalysis, plotting the "neural activation index" gives me > something really terrible (also attached). since the "solution" > appears relatively clear in this case, i guess i have done > something stupid at some point. Given that you do not report explicit errors, I suspect problems with different coordinates The topography looks ok, and the source from DIPOLEFITTING seems to match. I don't know whether the small number of electrodes would be a problem for beaming the data. > cfg=[]; > cfg.latency=[.09 .12]; %latency of my N1 > cfg.covariance='yes'; > cfg.keeptrials='yes'; > datTest=timelockanalysis(cfg,dat); You may want to specify cfg.covariancewindow as well. Please read the emails on the list from last week between Marie and me for an explanation on te hcomputation of the covariance. Marie has some meaningfull ideas here (I visited her last Friday and we were able to discuss this directly), but they have not yet been implemented in FT. > cfg=[]; > cfg.vol=vol; > cfg.grid.xgrid='auto'; > cfg.grid.ygrid='auto'; > cfg.grid.zgrid='auto'; > [grid] = prepare_leadfield(cfg, datTest); %the same LF-matrix used > for 'good' dipole fit Are the dipoles (grid.pos) in mm? It should be in mm, just as your head model. Note that beamforming is much more sensitive to head model misspecification than plain dipolefitting, so you may want to use a (standard) BEM model instead of a spherical model. > cfg=[]; > cfg.grid=source2sparse(grid); > cfg.method='lcmv'; > cfg.vol=vol; > cfg.projectnoise='yes'; > [sourceN1] = sourceanalysis(cfg, datTest); I would expect a problem here for you, since the default noise estimate in case of EEG should be zero. The noise (for the projection) is estimated by taking the smallest singular value of the covariance matrix, and given that the ata is supposed to be avg- referenced, the smallest singular value should be zero. I.e. it should give a warning about the matrix being rank-deficient. The solution to that is to explicitely noise regularize using cfg.lambda. > cfg=[]; > cfg.powmethod='none'; %only option that works > [sourcenai] = sourcedescriptives(cfg, sourceN1); Since you have not specified anything fancy in the lcmv beamformer, you indeed do not have to post-process your power here (that requires cfg.powmethod=something). > cfg =[]; > cfg.funparameter = 'nai'; > sourceN1F=source2full(sourcenai); > [interp]=sourceinterpolate(cfg,sourceN1F,mri); I suspect the problem here: please explicitely specyfy cfg.sourceunits and cfg.mriunits. > sliceinterp(cfg,interp) please use sourceplot with cfg.method='slice' instead (sliceinterp is deprecated). > I'd really appreciate pointers of what I may be doing wrong. Not related to the reported problem, but very important in general is the referencing: please ensure that your data is averaged referenced before computing the covariance. The options cfg.preproc.refef='yes' and cfg.preproc.refchan='all' in timelockanalysis should do that for you. You can easily check by summing the potential over all channels: the sum should be zero at every sample. I hope this helps, Robert From gmcauley at LLU.EDU Tue Mar 6 03:32:41 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Mon, 5 Mar 2007 18:32:41 -0800 Subject: Investigating Fieldtrip Message-ID: Hello, I have been asked to help with the analysis of some fetal sheep EEG data. I have a pretty good programing background, and some MATLAB experience, but am lacking in EEG and related background. What we want to do seems rather simple compared to what it looks like Fieldtrip can do. So, before really diving in, it would be helpful to know if this is the right tool for our problem and not overkill. Basically, we need to: 1) Open time series data that is in ASCII format. The data is just one or two channels of potentials from one or two electrodes sampled at 200Hz. 2) Identify regions in the data that have 'high voltage/low frequency' or 'low voltage/high frequency'. (Perhaps this could be determined based on average in data region vs average potential of whole data set). 3) Calculate power spectra for the data regions. 4) Calculate spectral edge frequencies for the data regions 5) Do some simple statistics comparing data regions (eg, spectral edge frequency of controls vs experimental group). 6) Creating m files to automate as much as possible. So my questions are: 1) Is this straight forward to do in Fieldtrip? 2) Do we need anything more than the MATLAB program itself (ie, do we need any other MATLAB toolboxes)? 3) Is there another (free) library that might be better for this kind of a problem? Answers to these questions would be very help and much appreciated. ~ Grant -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From c.hesse at FCDONDERS.RU.NL Tue Mar 6 08:59:57 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 6 Mar 2007 08:59:57 +0100 Subject: Investigating Fieldtrip In-Reply-To: <1173148361.31521.117.camel@localhost.localdomain> Message-ID: Hi Grant, > Basically, we need to: > 1) Open time series data that is in ASCII format. The data is just > one > or two channels of potentials from one or two electrodes sampled at > 200Hz. Assuming that the data format can be read using standard Matlab file I/O functions (fread or dlmread) all that is required is then to convert the data into an appropriate FieldTrip (FT) data structure. This will work best if your data naturally divides into "trials" or epochs, but in principle you can also define intervals of arbitrary length with arbitrary overlap (which may be useful for subsequent spectral / time-frequency analysis). > 2) Identify regions in the data that have 'high voltage/low frequency' > or 'low voltage/high frequency'. (Perhaps this could be determined > based on average in data region vs average potential of whole data > set). There are several ways in which this could be accomplished in FT. > 3) Calculate power spectra for the data regions. > > 4) Calculate spectral edge frequencies for the data regions > > 5) Do some simple statistics comparing data regions (eg, spectral edge > frequency of controls vs experimental group). All easy. > 6) Creating m files to automate as much as possible. That's the essence of FT philosophy :-) > So my questions are: > > 1) Is this straight forward to do in Fieldtrip? Mostly, yes. However, you may need to write the odd small function yourself, which is then passed to and called by FT: at the end of the day, FT is merely a "box of tools" :-) > 2) Do we need anything more than the MATLAB program itself (ie, do we > need any other MATLAB toolboxes)? FT has been written to be as "stand alone" as possible, so you should be OK. I could imagine that the only other Matlab Toolboxes you might need are the Statistics Toolbox (to do paramteric tests, FT can do non-parametric permutation tests using any statistic/measure derived from your data) based on permutation) and perhaps the Signal Processing Toolbox (although I am pretty sure that FT is now self- sufficient there). > 3) Is there another (free) library that might be better for this > kind of > a problem? Not sure about free ones ... you could always write your own stuff in Matlab, I guess. Hope this helps, Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Mar 6 10:29:15 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 Mar 2007 10:29:15 +0100 Subject: No subject In-Reply-To: Message-ID: Hi Sameer, One small comment to start with: please use a subject in your emails to the list. That makes it easier to keep track of discussions and threads. On 28 Feb 2007, at 21:59, Sameer Walawalkar wrote: > I am currently experimenting with beamformers and was playing with > http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:use_your_own_forward_leadfield_model_in_an_ > inverse_beamformer_computation > to generate the grid. You have 306ch Neuromag data, and I don't recall exactly whether that has been fully tested for forward computations. Some background: at each of the 102 locations of each "chip" you have 3 channels: two of those have 2 coils, and one is a magnetometer with only one coil. Please have a look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_are_electrodes _magnetometers_or_gradiometers_described for the description of "grad". I would expect in your case that grad.pnt and ori 102*2+102*2+102= 510 rows long, each with 3 columns grad.tra 306 x 510 The gradiometer coils are shifted w.r.t. the center of the "chip" by a small amount. I think that currently the baseline (i.e. the distance between the coils) is hardcoded. Joachim Gross once gave me code for that, it is included in feldtrip/private/fif2grad. Please look at it and see whether it applies to your 306ch gradiometer design as well. > > I did the following > > > vol = []; > vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius > is 12 cm > vol.c = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; % center of sphere this indicates a 4-shell concentric-sphere EEG model. It does not make sense for MEG, since in MEG teh conductivity of the different layers in the spherical model does not affect the field distribution. > % compute the leadfields that can be used for the beamforming > cfg = []; > cfg.vol = vol; > cfg.resolution = 2; % same unit as above, i.e. in cm > grid = prepare_leadfield(cfg, dataPre); > > (I expect prepare_leadfield to pick up grad definitions from the data) > > ??? Error using ==> fieldtrip/private/compute_leadfield > different number of spheres for the radius and origin FT works with MEG either with a single sphere or multisphere models, i.e. vol.r = 12 vol.o = [0 0 5] This origin is a better guess for the center of the sphere, remember that in the MEG case you do not move the sensors towards the head, but the position of the sensors (coils) is expressed with respect to the head coordinate system. In case of EEG, it is more common to use standard electrodes that are moved towards the head. You can use HEADMODELPLOT to look at the geometry of the sensors and head model. A multisphere model contains a sinsgle sphere for each sensor. Actually, for the forward computation it should contain a single sphere for each coil. Multisphere models currently are not implemented for Neuromag data. The reason for the error is that FT is confused about it being not a single-sphere, but also not a multi-sphere model. Also your later errors are explained by that. Please use a single sphere model. Or alternatively you can use a realistic single-shell (Nolte) model, which is more accurate than the multi-sphere models, but I suggest first to try around with a single sphere. The most important thing for you to check is whether the grad structure is geometrically correct. Lauri Parkonen will probably be able to help you with checking that. best regards, Robert > Error in ==> prepare_leadfield at 209 > grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), > sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); > > Error in ==> SomeMaster at 15 > grid = prepare_leadfield(cfg, dataPre); > > > > To get around this error, I change vol to > > vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ]; > > ??? Error using ==> fieldtrip/private/compute_leadfield > number of spheres is not equal to the number of coils > > Error in ==> prepare_leadfield at 209 > grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), > sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); > > Error in ==> SomeMaster at 15 > grid = prepare_leadfield(cfg, dataPre); > > > I thought this might be due to the 4 HPI coils, so I changed vol to > vol.r = 12 * [0.88 0.92 0.96 1.00]; > vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ; 0 0 0 ]; > > but it was of no use. > > Any suggestions? > > Thanks, > sameer > From P.vandenHurk at CS.RU.NL Tue Mar 6 15:55:53 2007 From: P.vandenHurk at CS.RU.NL (P.vandenHurk) Date: Tue, 6 Mar 2007 15:55:53 +0100 Subject: No subject In-Reply-To: <692D7E98-7D1F-4398-8C9C-AB7D829A273B@fcdonders.ru.nl> Message-ID: Hello, Each time I use the 'read_fcdc_event' function, I get the following error: ??? Error using ==> read_event type field not defined for each event Error in ==> read_fcdc_event at 51 [event] = read_event(varargin{:}); Can you tell me how I can fix this error? Thanks, Best regards, Paul Robert Oostenveld schreef: > Hi Sameer, > > One small comment to start with: please use a subject in your emails > to the list. That makes it easier to keep track of discussions and > threads. > > On 28 Feb 2007, at 21:59, Sameer Walawalkar wrote: >> I am currently experimenting with beamformers and was playing with >> http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:use_your_own_forward_leadfield_model_in_an_inverse_beamformer_computation >> >> to generate the grid. > > You have 306ch Neuromag data, and I don't recall exactly whether that > has been fully tested for forward computations. Some background: at > each of the 102 locations of each "chip" you have 3 channels: two of > those have 2 coils, and one is a magnetometer with only one coil. > > Please have a look at > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:frequently_asked_questions#how_are_electrodes_magnetometers_or_gradiometers_described > > for the description of "grad". I would expect in your case that > grad.pnt and ori 102*2+102*2+102= 510 rows long, each with 3 columns > grad.tra 306 x 510 > > The gradiometer coils are shifted w.r.t. the center of the "chip" by a > small amount. I think that currently the baseline (i.e. the distance > between the coils) is hardcoded. Joachim Gross once gave me code for > that, it is included in feldtrip/private/fif2grad. Please look at it > and see whether it applies to your 306ch gradiometer design as well. > >> >> I did the following >> >> >> vol = []; >> vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is >> 12 cm >> vol.c = [1 1/80 1]; % conductivity >> vol.o = [0 0 0]; % center of sphere > > this indicates a 4-shell concentric-sphere EEG model. It does not make > sense for MEG, since in MEG teh conductivity of the different layers > in the spherical model does not affect the field distribution. > >> % compute the leadfields that can be used for the beamforming >> cfg = []; >> cfg.vol = vol; >> cfg.resolution = 2; % same unit as above, i.e. in cm >> grid = prepare_leadfield(cfg, dataPre); >> >> (I expect prepare_leadfield to pick up grad definitions from the data) >> >> ??? Error using ==> fieldtrip/private/compute_leadfield >> different number of spheres for the radius and origin > > FT works with MEG either with a single sphere or multisphere models, i.e. > vol.r = 12 > vol.o = [0 0 5] > This origin is a better guess for the center of the sphere, remember > that in the MEG case you do not move the sensors towards the head, but > the position of the sensors (coils) is expressed with respect to the > head coordinate system. In case of EEG, it is more common to use > standard electrodes that are moved towards the head. You can use > HEADMODELPLOT to look at the geometry of the sensors and head model. > > A multisphere model contains a sinsgle sphere for each sensor. > Actually, for the forward computation it should contain a single > sphere for each coil. Multisphere models currently are not implemented > for Neuromag data. > > The reason for the error is that FT is confused about it being not a > single-sphere, but also not a multi-sphere model. Also your later > errors are explained by that. Please use a single sphere model. Or > alternatively you can use a realistic single-shell (Nolte) model, > which is more accurate than the multi-sphere models, but I suggest > first to try around with a single sphere. The most important thing for > you to check is whether the grad structure is geometrically correct. > Lauri Parkonen will probably be able to help you with checking that. > > best regards, > Robert > > >> Error in ==> prepare_leadfield at 209 >> grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), >> sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); >> >> Error in ==> SomeMaster at 15 >> grid = prepare_leadfield(cfg, dataPre); >> >> >> >> To get around this error, I change vol to >> >> vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ]; >> >> ??? Error using ==> fieldtrip/private/compute_leadfield >> number of spheres is not equal to the number of coils >> >> Error in ==> prepare_leadfield at 209 >> grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), >> sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); >> >> Error in ==> SomeMaster at 15 >> grid = prepare_leadfield(cfg, dataPre); >> >> >> I thought this might be due to the 4 HPI coils, so I changed vol to >> vol.r = 12 * [0.88 0.92 0.96 1.00]; >> vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ; 0 0 0 ]; >> >> but it was of no use. >> >> Any suggestions? >> >> Thanks, >> sameer >> -- ----------------------------------------------------------- Paul van den Hurk Joint Principal Investigator Mindfulness Project Inserm U280, Lyon, France, Radboud University Nijmegen: Department of computer sciences and Department of Medical Physics and Biophysics/126 Geert Grooteplein 21 6525 EZ Nijmegen Email: P.vandenHurk at cs.ru.nl Tel: 024-3613326 From gmcauley at LLU.EDU Tue Mar 6 18:41:38 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Tue, 6 Mar 2007 09:41:38 -0800 Subject: Investigating Fieldtrip In-Reply-To: Message-ID: Thanks Christian for your helpful reply. FT is sounding very good! > > > 2) Do we need anything more than the MATLAB program itself (ie, do > > we > > need any other MATLAB toolboxes)? > > > FT has been written to be as "stand alone" as possible, so you should > be OK. I could imagine that the only other Matlab Toolboxes you might > need are the Statistics Toolbox (to do paramteric tests, FT can do > non-parametric permutation tests using any statistic/measure derived > from your data) based on permutation) and perhaps the Signal > Processing Toolbox (although I am pretty sure that FT is now > self-sufficient there). > My only immediate remaining question is about if FT is dependent on the MATLAB Signal Processing Toolbox (Statistic Toolbox does not matter). Definite confirmation here would be very helpful. ~ Grant > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From c.hesse at FCDONDERS.RU.NL Wed Mar 7 09:10:48 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 7 Mar 2007 09:10:48 +0100 Subject: Investigating Fieldtrip In-Reply-To: <1173202898.31521.133.camel@localhost.localdomain> Message-ID: Hi Grant, > Thanks Christian for your helpful reply. > > FT is sounding very good! > My only immediate remaining question is about if FT is dependent on > the > MATLAB Signal Processing Toolbox (Statistic Toolbox does not matter). > > Definite confirmation here would be very helpful. For spectral estimation / analysis FT depends only on the FFT function which is part of the basic Matlab package. For signal filtering, you need the signal processing toolbox in order to design your filters, e.g., a 4th order Butterworth band pass filter, but if you generate the filter coefficients (or the polynomial coefficients of the transfer function) yourself, then you can use the FILTER function with those coefficients which is again part of the basic Matlab. I guess you're mainly interested in spectral analysis of your signal rather than filtering, so you should be able get away without the Signal Processing Toolbo (however, I would recommend getting a copy in order to take full advantage of all FT functionality). Hope that helps, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 6 16:53:58 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 6 Mar 2007 16:53:58 +0100 Subject: No subject In-Reply-To: <45ED80F9.6060007@cs.ru.nl> Message-ID: Hi Paul, in order to be able to help you, can you please specify which type of data format you are trying to read events from? > Hello, > > Each time I use the 'read_fcdc_event' function, I get the following > error: > > ??? Error using ==> read_event > type field not defined for each event > > Error in ==> read_fcdc_event at 51 > [event] = read_event(varargin{:}); > > Can you tell me how I can fix this error? We'll fix the error if there is one, we give you advice on how to avoid them :-) Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From P.vandenHurk at CS.RU.NL Wed Mar 7 13:48:37 2007 From: P.vandenHurk at CS.RU.NL (P.vandenHurk) Date: Wed, 7 Mar 2007 13:48:37 +0100 Subject: No subject In-Reply-To: Message-ID: Hello Christian, I am sorry, but of course. It is a .bdf file. The read_fcdc_header function does work by the way. Regards, Paul Christian Hesse schreef: > Hi Paul, > > in order to be able to help you, can you please specify which type of > data format you are trying to read events from? > >> Hello, >> >> Each time I use the 'read_fcdc_event' function, I get the following >> error: >> >> ??? Error using ==> read_event >> type field not defined for each event >> >> Error in ==> read_fcdc_event at 51 >> [event] = read_event(varargin{:}); >> >> Can you tell me how I can fix this error? > > We'll fix the error if there is one, we give you advice on how to > avoid them :-) > > Regards, > Christian > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > -- ----------------------------------------------------------- Paul van den Hurk Joint Principal Investigator Mindfulness Project Inserm U280, Lyon, France, Radboud University Nijmegen: Department of computer sciences and Department of Medical Physics and Biophysics/126 Geert Grooteplein 21 6525 EZ Nijmegen Email: P.vandenHurk at cs.ru.nl Tel: 024-3613326 From gmcauley at LLU.EDU Wed Mar 7 17:01:09 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Wed, 7 Mar 2007 08:01:09 -0800 Subject: Investigating Fieldtrip In-Reply-To: Message-ID: Thank you for your reply. On Wed, 2007-03-07 at 09:10 +0100, Christian Hesse wrote: > Hi Grant, > > > Thanks Christian for your helpful reply. > > > > > > FT is sounding very good! > > > My only immediate remaining question is about if FT is dependent on > > the > > MATLAB Signal Processing Toolbox (Statistic Toolbox does not > > matter). > > > > > > Definite confirmation here would be very helpful. > > > For spectral estimation / analysis FT depends only on the FFT function > which is part of the basic Matlab package. For signal filtering, you > need the signal processing toolbox in order to design your filters, > e.g., a 4th order Butterworth band pass filter, but if you generate > the filter coefficients (or the polynomial coefficients of the > transfer function) yourself, then you can use the FILTER function with > those coefficients which is again part of the basic Matlab. > > > I guess you're mainly interested in spectral analysis of your signal > rather than filtering, so you should be able get away without the > Signal Processing Toolbo (however, I would recommend getting a copy in > order to take full advantage of all FT functionality). Great, at this stage it looks like we can get by without the Signal Processing Toolbox, and can expand if necessary in the future. I will plan to 'dive in' to FT! Thanks again, ~ Grant > > Hope that helps, > Christian > > > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From muthuraman10 at HOTMAIL.COM Wed Mar 7 17:14:56 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Wed, 7 Mar 2007 16:14:56 +0000 Subject: Reference Channel for DICS! Message-ID: Hello, These are the configuration steps of the data for DICS hdr = read_fcdc_header('pd_mof_tr0_c_0306.cnt'); emgindx = strmatch('M', hdr.label); rstindx = setdiff(1:length(hdr.label),emgindx); hdr Fs: 1000 nChans: 64 nSamples: 74520 nSamplesPre: 0 nTrials: 1 label: {1x64 cell} orig: [1x1 struct] %Defining trials trl = []; trl(:,1) = [21:1000:74520-1000]'; trl(:,2) = [1020:1000:74520]'; trl(:,3) = 0; %Data_EEG cfg = []; cfg.dataset = 'pd_mof_tr0_c_0306.cnt'; cfg.trl = trl; cfg.blc = 'yes'; cfg.channel = hdr.label(rstindx); cfg.implicitref='CZ'; cfg.reref='all'; data_eeg = preprocessing(cfg); %Data_EMG cfg.hpfilter = 'yes'; cfg.hpfreq = 10; cfg.channel = hdr.label(emgindx); cfg.refchan='M1'; cfg.blc='yes'; cfg.rectify = 'yes'; data_emg = preprocessing(cfg); data = appenddata([],data_eeg,data_emg); I get the error ??? Error using ==> appenddata cannot determine how the data should be concatenated This is because after including the reference channels with EEG channels are 61 and EMG channels are 5, inorder to execute the DICS method with reference channel these steps are necessary for the CSD to be complete Is there a way to add the data with these two extra reference channels? any comments on this would be appreciated Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It�s cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in From Brian.Roach at YALE.EDU Wed Mar 7 17:35:33 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Wed, 7 Mar 2007 11:35:33 -0500 Subject: units for uncorrected freqanalysis_wltconvol.m Message-ID: FieldTrip Users, I am wondering what the unit scale is for output from the freqanalysis_wltconvol.m function before any type of baseline correction if the input units are microvolts. Is the output magnitude, or magnitude squared (power or power spectra)? Based on this equation from the code: powdum = (2.* abs(autspctrmacttap) ./ data.fsample) .^ 2; I believe abs(autspctrmacttap) = magnitude, and that means powdum = power. If that is the case, I believe I am getting some really huge values compared to the voltage of the pre-processed EEG. Is it possible that I have done something wrong, or is it typically the case for EEG power to be much greater than EEG amplitude? thanks, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From weisz at LYON.INSERM.FR Wed Mar 7 18:08:11 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Wed, 7 Mar 2007 18:08:11 +0100 Subject: first steps using lcmv In-Reply-To: <13CF5947-E369-4D4C-849B-F6444167FA61@fcdonders.ru.nl> Message-ID: hi robert, thanks for your quick help. > Given that you do not report explicit errors, I suspect problems > with different coordinates indeed i overlooked to explicitely state the source and mri-units in sourceinterpolate. the nai-image looks better now, although perhaps a little deep (also sme yellow in the middle; perhaps as a result of correlated bilateral activity?). but it's not the mri of the individual and i still have find out more about the usage and the options of sourceanalysis. > I don't know whether the small number of electrodes would be a > problem for beaming the data. don't know too ... but van Veen et al. used even less in their 1997 paper. > Are the dipoles (grid.pos) in mm? It should be in mm, just as your > head model. Note that beamforming is much more sensitive to head > model misspecification than plain dipolefitting, so you may want to > use a (standard) BEM model instead of a spherical model. i found a standard bem in the dipfit plugin folder of eeglab (standard_vol.mat). >> vol vol = bnd: [1x3 struct] cond: [0.3300 0.0041 0.3300] mat: [3000x3000 double] type: 'dipoli' i guess that i can simply exchange my standard spherical model (same as in eeglab) and use this bem volume for calculating the leadfield. one aspect are the electrode locations: the positions are given on a sphere ... so probably there'll has to be some transformation of the positions. > please use sourceplot with cfg.method='slice' instead (sliceinterp > is deprecated). still used sliceinterp this time ... found it a little more easy to use. all the best, nathan -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 1.png Type: application/applefile Size: 73 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 1.png Type: image/png Size: 150703 bytes Desc: not available URL: -------------- next part -------------- From P.vandenHurk at CS.RU.NL Thu Mar 8 09:51:36 2007 From: P.vandenHurk at CS.RU.NL (P.vandenHurk) Date: Thu, 8 Mar 2007 09:51:36 +0100 Subject: problem using read_fcdc_event function In-Reply-To: <8A3F5CCB-C26C-46E7-BE2C-22CF761817E0@lyon.inserm.fr> Message-ID: Hello, Is it possible to work with .bdf files in the fieldtrip environment? I am asking because I have this problem with the read_fcdc_event function (by the way I don't have any problems when I use the read_fcdc_header function)? Thanks for your comment, Kind regards, Paul Nathan Weisz schreef: > hi robert, > > thanks for your quick help. > >> Given that you do not report explicit errors, I suspect problems with >> different coordinates > > indeed i overlooked to explicitely state the source and mri-units in > sourceinterpolate. > > the nai-image looks better now, although perhaps a little deep (also > sme yellow in the middle; perhaps as a result of correlated bilateral > activity?). but it's not the mri of the individual and i still have > find out more about the usage and the options of sourceanalysis. > >> I don't know whether the small number of electrodes would be a >> problem for beaming the data. > > don't know too ... but van Veen et al. used even less in their 1997 > paper. > >> Are the dipoles (grid.pos) in mm? It should be in mm, just as your >> head model. Note that beamforming is much more sensitive to head >> model misspecification than plain dipolefitting, so you may want to >> use a (standard) BEM model instead of a spherical model. > > i found a standard bem in the dipfit plugin folder of eeglab > (standard_vol.mat). > > >> vol > > vol = > > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > mat: [3000x3000 double] > type: 'dipoli' > > i guess that i can simply exchange my standard spherical model (same > as in eeglab) and use this bem volume for calculating the leadfield. > one aspect are the electrode locations: the positions are given on a > sphere ... so probably there'll has to be some transformation of the > positions. > >> please use sourceplot with cfg.method='slice' instead (sliceinterp is >> deprecated). > > still used sliceinterp this time ... found it a little more easy to use. > > all the best, > nathan > > > > ------------------------------------------------------------------------ > -- ----------------------------------------------------------- Paul van den Hurk Joint Principal Investigator Mindfulness Project Inserm U280, Lyon, France, Radboud University Nijmegen: Department of computer sciences and Department of Medical Physics and Biophysics/126 Geert Grooteplein 21 6525 EZ Nijmegen Email: P.vandenHurk at cs.ru.nl Tel: 024-3613326 From nicola.ray at DPAG.OX.AC.UK Fri Mar 9 12:01:09 2007 From: nicola.ray at DPAG.OX.AC.UK (Niki Ray) Date: Fri, 9 Mar 2007 12:01:09 +0100 Subject: ICA with averaged data Message-ID: Hi, I'm very new to fieldtrip. I have three questions. I have collected MEG data from patients with a deep brain stimulator implanted. I'd like to do an ICA to reject the stimulator related artifacts. Sometimes the stimulator is on and sometimes off. So my first question is, do i combine all the data together and then perform the ICA, or do i do different ICA analyses for each condition(on and off stimulation), and hence reject different components for each condition? One possibility for deciding wich of the artifacts were related to the stimulator was to use the example matlab script you provide for rejecting ECG components. Some of the channels (about 13, i'm using a ctf 275 system) have a lot of very distinct artifact that is obviously from the stimulator, so i wanted to use one of these channels as the "ECG" channel. Is this sensible, or not?? Finally, I've been getting conflicting advice about whether it is okay to first average data, and then perform an ICA. What do you suggest is the right thing to do? Many thanks! Niki From s.debener at UKE.UNI-HAMBURG.DE Fri Mar 9 13:11:30 2007 From: s.debener at UKE.UNI-HAMBURG.DE (Stefan Debener) Date: Fri, 9 Mar 2007 12:11:30 +0000 Subject: ICA with averaged data In-Reply-To: Message-ID: Hi Niki, It does, in my opinion, not make much sense to average first and then run ICA, you unlikely obtain a robust decomposition this way and may not be able to remove the stimulator artefact. ICA needs quite a few training data to find a decent decomposition, and this is not provided by ERPs, even though some commercial software packages may allow you to apply ICA to ERPs/ERFs. Only if (!) all your data are recorded such that there was no substantial head movement (that is, the position between sensors and sources did not change), you may get a decent artefact IC (or several ICs) from combined data (there is a few more ifs involved, please see previous ICA discussions here and in the EEGLAB mailing list). YI'd suggest using the pca option and decomposse, say, about 50 components, to start with, and then try to optimize the result by playing with the pca option and by running ICAs for separate recording blocks. Best, Stefan Niki Ray wrote: > Hi, > I'm very new to fieldtrip. I have three questions. I have collected MEG > data from patients with a deep brain stimulator implanted. I'd like to do an > ICA to reject the stimulator related artifacts. Sometimes the stimulator is > on and sometimes off. So my first question is, do i combine all the data > together and then perform the ICA, or do i do different ICA analyses for > each condition(on and off stimulation), and hence reject different > components for each condition? > > One possibility for deciding wich of the artifacts were related to the > stimulator was to use the example matlab script you provide for rejecting > ECG components. Some of the channels (about 13, i'm using a ctf 275 system) > have a lot of very distinct artifact that is obviously from the stimulator, > so i wanted to use one of these channels as the "ECG" channel. Is this > sensible, or not?? > > Finally, I've been getting conflicting advice about whether it is okay to > first average data, and then perform an ICA. What do you suggest is the > right thing to do? > > Many thanks! > Niki > > > From ychen at BME.UFL.EDU Fri Mar 9 15:11:30 2007 From: ychen at BME.UFL.EDU (Y Chen) Date: Fri, 9 Mar 2007 15:11:30 +0100 Subject: Problem with BESA coordinate system Message-ID: Hi, I used "besa2fieldtrip.m" and "read_fcdc_elec.m" to load BESA .avr file and .sfp electrode file, then used "topoplotEP.m" and got the attached plot. Looks like the coordinate is wrong (90 degree shift). Form your website introduction, the BESA coordinate is right. However in the software implementation, would you please double check it? I could send in my files if you want. Thanks. Chen -------------- next part -------------- A non-text attachment was scrubbed... Name: BESALayout.jpg Type: image/pjpeg Size: 49488 bytes Desc: not available URL: From Brian.Roach at YALE.EDU Sat Mar 10 01:00:59 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Fri, 9 Mar 2007 19:00:59 -0500 Subject: strel_bol function for creating a head model Message-ID: FT users, This tutorial (http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:create_bem_headmodel_for_eeg) calls a function "strel_bol", which I do not have in my matlab library. Does anyone have this function? Is it from one of the toolboxes, FieldTrip, or some other location? I have just downloaded the latest F.T. version and cannot find this function. thanks, Brian From r.oostenveld at FCDONDERS.RU.NL Sun Mar 11 14:48:54 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Sun, 11 Mar 2007 14:48:54 +0100 Subject: strel_bol function for creating a head model In-Reply-To: <6.1.2.0.2.20070309185908.01c4a550@email.med.yale.edu> Message-ID: Dear Brian please find it attached. It is a simple function that I wrote, but it is not used in FieldTrip proper and therefore not included in the zip file. Note that it constructs a spherical smoothing kernel ("structural element"=strel in image processing terminology). Sphere is "bol" in Dutch. best regards, Robert On 10 Mar 2007, at 1:00, Brian Roach wrote: > FT users, > > This tutorial (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:create_bem_headmodel_for_eeg) calls a > function "strel_bol", which I do not have in my matlab library. > Does anyone have this function? Is it from one of the toolboxes, > FieldTrip, or some other location? I have just downloaded the > latest F.T. version and cannot find this function. > > thanks, > Brian -------------- next part -------------- A non-text attachment was scrubbed... Name: strel_bol.m Type: application/octet-stream Size: 442 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Sun Mar 11 15:05:42 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Sun, 11 Mar 2007 15:05:42 +0100 Subject: ICA with averaged data In-Reply-To: Message-ID: Dear Niki On 9 Mar 2007, at 12:01, Niki Ray wrote: > Some of the channels (about 13, i'm using a ctf 275 system) > have a lot of very distinct artifact that is obviously from the > stimulator, > so i wanted to use one of these channels as the "ECG" channel. Is this > sensible, or not?? The demo script on http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:use_independent_component_analysis_ica_to_rem ove_ecg_artifacts uses the measured real ECG channel to facilitate finding the ICA components that represent the heart artifact. It does that by computing the QRS–pek triggererd average of the ICA components, and by computing the coherence between all ICA components and the ECG channel. In your case, you do not seem to have an external channel that can act as the ECG channel in the demo script. However, important is that the ECG channel is _only_ used to facilitate finding the heart components and it does not have a fundamental role in the ICA unmixing or rejection. Apparently you can detect the artifact components in your data in some other way, so you should be fine without a fake ECG channel. best regards Robert From r.oostenveld at FCDONDERS.RU.NL Sun Mar 11 15:12:13 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Sun, 11 Mar 2007 15:12:13 +0100 Subject: Problem with BESA coordinate system In-Reply-To: Message-ID: Dear Chen On 9 Mar 2007, at 15:11, Y Chen wrote: > I used "besa2fieldtrip.m" and "read_fcdc_elec.m" to load BESA .avr > file > and .sfp electrode file, then used "topoplotEP.m" and got the attached > plot. Looks like the coordinate is wrong (90 degree shift). Form your > website introduction, the BESA coordinate is right. However in the > software implementation, would you please double check it? I could > send in > my files if you want. Thanks. The read_fcdc_elec does not know about the coordinate system, and just reads the electrode locations in the way they are represented in the file. In FieldTrip we do not have a fixed coordinate system. However, the topoplotting functions do have a fixed layout of the head, i.e. the schematical drawing of the head (the circle, with the triangle as nose and with the ears) always has the nose at the top. The nose position is at the moment not an option that you can specify in topoplot (it might make sense to implement a cfg.noseposition='positiveY' or 'positiveY'). That means that for topoplottting at the moment you have to rotate your electrode positions (elec.pnt) by 90 degrees. best regards, Robert From muthuraman10 at HOTMAIL.COM Mon Mar 12 10:59:19 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Mon, 12 Mar 2007 09:59:19 +0000 Subject: Reference channel! Message-ID: Hello, I am not sure whether it has reached the group so sending it again! sorry for the inconvience incase it has reached the group These are the configuration steps of the data for DICS hdr = read_fcdc_header('pd_mof_tr0_c_0306.cnt'); emgindx = strmatch('M', hdr.label); rstindx = setdiff(1:length(hdr.label),emgindx); hdr Fs: 1000 nChans: 64 nSamples: 74520 nSamplesPre: 0 nTrials: 1 label: {1x64 cell} orig: [1x1 struct] %Defining trials trl = []; trl(:,1) = [21:1000:74520-1000]'; trl(:,2) = [1020:1000:74520]'; trl(:,3) = 0; %Data_EEG cfg = []; cfg.dataset = 'pd_mof_tr0_c_0306.cnt'; cfg.trl = trl; cfg.blc = 'yes'; cfg.channel = hdr.label(rstindx); cfg.implicitref='CZ'; cfg.reref='all'; data_eeg = preprocessing(cfg); %Data_EMG cfg.hpfilter = 'yes'; cfg.hpfreq = 10; cfg.channel = hdr.label(emgindx); cfg.refchan='M1'; cfg.blc='yes'; cfg.rectify = 'yes'; data_emg = preprocessing(cfg); data = appenddata([],data_eeg,data_emg); I get the error ??? Error using ==> appenddata cannot determine how the data should be concatenated This is because after including the reference channels with EEG channels are 61 and EMG channels are 5, inorder to execute the DICS method with reference channel these steps are necessary for the CSD to be complete Is there a way to add the data with these two extra reference channels? any comments on this would be appreciated Thanking you With regards M.Muthuraman _________________________________________________________________ Palate teasers: Straight from Master Chef Sanjeev Kapoor http://content.msn.co.in/Lifestyle/Moreonlifestyle/LifestylePT_101106_1530.htm From Brian.Roach at YALE.EDU Mon Mar 12 18:56:07 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Mon, 12 Mar 2007 13:56:07 -0400 Subject: sourceanalysis.m on EEG data In-Reply-To: <60A04A24-9EC0-462D-893A-32B5E3F1563A@fcdonders.ru.nl> Message-ID: The prepare_bemmodel calls a function "write_tri" when using the dipoli option. I cannot find this function on the server or in any of my downloaded files. Does anyone have it to share? thanks, Brian At 10:09 AM 2/13/2007, Robert Oostenveld wrote: >The prepare_bemmodel function is in the zip file on the ftp server. >The dipoli executable is attached to this mail. There exists only a >linux i386 and an apple PPC version. You are not permitted to >distribute the dipoli executable, it is not covered under the GPL >license but made available courtesy of Thom Oostendorp. > >best regards, >Robert > >On 12 Feb 2007, at 22:32, Brian Roach wrote: > >>Where can I find these functions listed below? >> >>% the prepare_bemmodel function is available upon request % the >>dipoli stand-alone executable is available upon request > > >********************************************************************** > >This warning has been inserted into this email by the mail system >because this email has an attachment named dipoli.zip > >Specific details: > >Be careful when opening Zip files if you're not sure where they >came from. They can be, and have been, used to transfer viruses >and other destructive programs. > >Attachment of this type have been known to carry viruses or >other programs which could be harmful to your computer. > >We would urge you to be certain that you know who this email >comes from and to save it to disk and check it with an >anti-virus program before using the attachment. If there is any >doubt, DO NOT RUN THE ATTACHMENT. > >If you need help, you can contact your local support provider by following >this link: > http://www.yale.edu/its/supportgroups.html >or contact the ITS Help Desk at 785-3200 or 432-9000. > >Please note that the CONTENTS of the attachment have NOT been >examined in any way, the action taken was entirely based on the >name of the attachment. > >********************************************************************** > > From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 12 19:35:20 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 12 Mar 2007 14:35:20 -0400 Subject: help with reading .fif files in Fieldtrip Message-ID: Hello, I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: Warning: Error reading fif-file! terminate called after throwing an instance of 'MathWorks::System::_utException' I simply adapted the settings for reading a continuous data set from the tutorial: cfg = []; cfg.dataset = 'file.fif'; cfg.hearderfile = 'file.fif'; cfg.datatype = 'continuous'; cfg = definetrial(cfg); I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). Does any one have any idea why Fieldtrip cannot read my .fif files? Many thanks, Matt cfg.channel = {'0111'}; cfg.trialdef.eventtype = 'backpanel trigger'; cfg.trialdef.eventvalue = 3; % trigger for the FIC condition cfg.trialdef.prestim = 1; % time in seconds before trigger cfg.trialdef.poststim = 2; % time in seconds after trigger From sameer at ANDREW.CMU.EDU Mon Mar 12 19:56:08 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 12 Mar 2007 14:56:08 -0400 Subject: help with reading .fif files in Fieldtrip In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB0110353D@medstudent.medschool.nt.pitt.edu> Message-ID: hi Matt, I dont know. Try the fieldtrip discussion list. they are very good at helpinig. you will see I (and others) write them dozens of emails and they reply. sameer On Mon, 12 Mar 2007, Shtrahman, Matthew wrote: > Hello, > > I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: > > Warning: Error reading fif-file! > terminate called after throwing an instance of 'MathWorks::System::_utException' > > I simply adapted the settings for reading a continuous data set from the tutorial: > > cfg = []; > cfg.dataset = 'file.fif'; > cfg.hearderfile = 'file.fif'; > cfg.datatype = 'continuous'; > > cfg = definetrial(cfg); > > > I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). > > Does any one have any idea why Fieldtrip cannot read my .fif files? > > Many thanks, > > Matt > > > cfg.channel = {'0111'}; > cfg.trialdef.eventtype = 'backpanel trigger'; > cfg.trialdef.eventvalue = 3; % trigger for the FIC condition > cfg.trialdef.prestim = 1; % time in seconds before trigger > cfg.trialdef.poststim = 2; % time in seconds after trigger > > From sameer at ANDREW.CMU.EDU Mon Mar 12 20:03:51 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 12 Mar 2007 15:03:51 -0400 Subject: help with reading .fif files in Fieldtrip In-Reply-To: Message-ID: Sorry everybody for this and the earlier email which was sent to the list becasue I failed to notice that the email was to the discussion list. however, I'll use this mix up on my part to reiterte my statement about "very good at helping". I do appreciate it. sameer On Mon, 12 Mar 2007, Sameer Walawalkar wrote: > hi Matt, I dont know. Try the fieldtrip discussion list. they are very good > at helpinig. you will see I (and others) write them dozens of emails and they > reply. > > sameer > > On Mon, 12 Mar 2007, Shtrahman, Matthew wrote: > >> Hello, >> >> I am new to Fieldtrip and I am having difficulty getting the fieldtrip >> function DEFINETRIAL to read continuous .fif (Neuromag) files. I have >> installed the MEG-PD toolbox in my matlab path and regularly use it in my >> own code to read the same .fif files with no errors. I also have tried >> copying the toolbox files to the fieldtrip/private directory. Regardless of >> what I do when I use DEFINETRIAL Matlab crashes and I get the following >> error: >> >> Warning: Error reading fif-file! >> terminate called after throwing an instance of >> 'MathWorks::System::_utException' >> >> I simply adapted the settings for reading a continuous data set from the >> tutorial: >> >> cfg = []; >> cfg.dataset = 'file.fif'; >> cfg.hearderfile = 'file.fif'; >> cfg.datatype = 'continuous'; >> >> cfg = definetrial(cfg); >> >> >> I don't know if it makes a difference, but I have also tried specifying the >> entire path for the file, working as root, and including various >> configurations for definetrial included in the tutorial (see end of email). >> >> Does any one have any idea why Fieldtrip cannot read my .fif files? >> >> Many thanks, >> >> Matt >> >> >> cfg.channel = {'0111'}; >> cfg.trialdef.eventtype = 'backpanel trigger'; >> cfg.trialdef.eventvalue = 3; % trigger for the FIC condition >> cfg.trialdef.prestim = 1; % time in seconds before trigger >> cfg.trialdef.poststim = 2; % time in seconds after trigger >> >> > > From lauri at NEURO.HUT.FI Mon Mar 12 21:23:18 2007 From: lauri at NEURO.HUT.FI (Lauri Parkkonen) Date: Mon, 12 Mar 2007 22:23:18 +0200 Subject: help with reading .fif files in Fieldtrip In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB0110353D@medstudent.medschool.nt.pitt.edu> Message-ID: Hi Matthew, Which Matlab version you're using? With a 7.x Matlab and the newest meg-pd (a.k.a FiffAccess) toolbox you should be able to read fif-files without extra configurations, however, the older 6.x Matlabs with the older meg-pd toolbox require setting the LD_ASSUME_KERNEL environment variable before starting Matlab. Using a 7.x Matlab with the older meg-pd package is likely to give the error messages you're quoting in your email. Best regards, Lauri Shtrahman, Matthew wrote: > Hello, > > I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: > > Warning: Error reading fif-file! > terminate called after throwing an instance of 'MathWorks::System::_utException' > > I simply adapted the settings for reading a continuous data set from the tutorial: > > cfg = []; > cfg.dataset = 'file.fif'; > cfg.hearderfile = 'file.fif'; > cfg.datatype = 'continuous'; > > cfg = definetrial(cfg); > > > I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). > > Does any one have any idea why Fieldtrip cannot read my .fif files? > > Many thanks, > > Matt > > > cfg.channel = {'0111'}; > cfg.trialdef.eventtype = 'backpanel trigger'; > cfg.trialdef.eventvalue = 3; % trigger for the FIC condition > cfg.trialdef.prestim = 1; % time in seconds before trigger > cfg.trialdef.poststim = 2; % time in seconds after trigger > From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 12 21:53:25 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 12 Mar 2007 16:53:25 -0400 Subject: help with reading .fif files in Fieldtrip Message-ID: Hi Lauri, Thanks for the email. I am using Matlab 7.3 and FiffAcess 1.2 (release 4), which I believe is the latest version. Any other ideas perhaps? Thanks again, Matt ________________________________ From: FieldTrip discussion list on behalf of Lauri Parkkonen Sent: Mon 3/12/2007 4:23 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] help with reading .fif files in Fieldtrip Hi Matthew, Which Matlab version you're using? With a 7.x Matlab and the newest meg-pd (a.k.a FiffAccess) toolbox you should be able to read fif-files without extra configurations, however, the older 6.x Matlabs with the older meg-pd toolbox require setting the LD_ASSUME_KERNEL environment variable before starting Matlab. Using a 7.x Matlab with the older meg-pd package is likely to give the error messages you're quoting in your email. Best regards, Lauri Shtrahman, Matthew wrote: > Hello, > > I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: > > Warning: Error reading fif-file! > terminate called after throwing an instance of 'MathWorks::System::_utException' > > I simply adapted the settings for reading a continuous data set from the tutorial: > > cfg = []; > cfg.dataset = 'file.fif'; > cfg.hearderfile = 'file.fif'; > cfg.datatype = 'continuous'; > > cfg = definetrial(cfg); > > > I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). > > Does any one have any idea why Fieldtrip cannot read my .fif files? > > Many thanks, > > Matt > > > cfg.channel = {'0111'}; > cfg.trialdef.eventtype = 'backpanel trigger'; > cfg.trialdef.eventvalue = 3; % trigger for the FIC condition > cfg.trialdef.prestim = 1; % time in seconds before trigger > cfg.trialdef.poststim = 2; % time in seconds after trigger > From Brian.Roach at YALE.EDU Mon Mar 12 23:12:08 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Mon, 12 Mar 2007 18:12:08 -0400 Subject: write_tri.m file and results from volplot Message-ID: Hi all, I am using this example script: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:create_bem_headmodel_for_eeg To construct a headmodel for EEG source analysis. I have attached the result from a call to: volplot(skin+skull+brain); I am new to this, and wonder how to judge the success of this script in creating a new model. What kinds of things do I want to see in this plot, or the volplot of the skin, skull, or brain, individually? The example script says that it requires a lot of trial and error, so I am assuming that just running that script is not all that is necessary, but I do not know. Related to this, the prepare_bemmodel.m script calls a function "write_tri.m" when using the dipoli option. I need this script and hope someone can send it to me. thanks! Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testSkinSkullBrain.png Type: application/octet-stream Size: 15516 bytes Desc: not available URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 13 09:04:22 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 09:04:22 +0100 Subject: help with reading .fif files in Fieldtrip In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB01103542@medstudent.medschool.nt.pitt.edu> Message-ID: Hi Matthew, In addition to Lauri's remarks about making sure that the MEG-PD and MATLAB you're using are indeed compatible and fully aware of each other, it would be helpful if you could try the following lines of code in Matlab (which uses FieldTrip reading functions) and send us the screen output: % specify filename filename = 'fullpath/name.fif'; % read the header hdr = read_fcdc_header(filename); hdr % get the indices of the STI channels idx = strmatch('STI',hdr.label); % display them and the channel labels on screen as sanity check idx hdr.label(idx) % NOTE: if you know you use only one STI channel and you know which one it is, % e.g., 'STI 001' then you can also do this: % idx = strmatch('STI 001',hdr.label); % extract only the STI channels from the file dat = read_fcdc_data(filename,'chanindx',idx); % although Neuromag data is "continuous" it is actually written in the file in blocks % and reading only part of the data will return a 3-D array rather than a 2-D array % hence the reshape operation in the following [nchans, nsamps, nblocks] = size(dat); if (nblocks>1), dat = reshape(dat, [nchans, nsamps*nblocks]); end; size(dat) % this should be an nchans x ntotalsamples matirx If all of these commands produce sensible output using your fif file, then the problem has to do with the options being passed to DEFINETRIAL (which uses the above lower level functions). But we first need to establish that you have correctly set up MEG-PD, MATLAB and FieldTrip, and that there is not a problem with the data file itself. Regards, Christian On 12 Mar 2007, at 21:53, Shtrahman, Matthew wrote: > Hi Lauri, > > Thanks for the email. I am using Matlab 7.3 and FiffAcess 1.2 > (release 4), which I believe is the latest version. Any other ideas > perhaps? > > Thanks again, > > Matt > > ________________________________ > > From: FieldTrip discussion list on behalf of Lauri Parkkonen > Sent: Mon 3/12/2007 4:23 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] help with reading .fif files in Fieldtrip > > > > Hi Matthew, > > Which Matlab version you're using? With a 7.x Matlab and the newest > meg-pd (a.k.a FiffAccess) toolbox you should be able to read fif-files > without extra configurations, however, the older 6.x Matlabs with the > older meg-pd toolbox require setting the LD_ASSUME_KERNEL environment > variable before starting Matlab. Using a 7.x Matlab with the older > meg-pd package is likely to give the error messages you're quoting in > your email. > > Best regards, > Lauri > > > Shtrahman, Matthew wrote: >> Hello, >> >> I am new to Fieldtrip and I am having difficulty getting the >> fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) >> files. I have installed the MEG-PD toolbox in my matlab path and >> regularly use it in my own code to read the same .fif files with >> no errors. I also have tried copying the toolbox files to the >> fieldtrip/private directory. Regardless of what I do when I use >> DEFINETRIAL Matlab crashes and I get the following error: >> >> Warning: Error reading fif-file! >> terminate called after throwing an instance of >> 'MathWorks::System::_utException' >> >> I simply adapted the settings for reading a continuous data set >> from the tutorial: >> >> cfg = []; >> cfg.dataset = 'file.fif'; >> cfg.hearderfile = 'file.fif'; >> cfg.datatype = 'continuous'; >> >> cfg = definetrial(cfg); >> >> >> I don't know if it makes a difference, but I have also tried >> specifying the entire path for the file, working as root, and >> including various configurations for definetrial included in the >> tutorial (see end of email). >> >> Does any one have any idea why Fieldtrip cannot read my .fif files? >> >> Many thanks, >> >> Matt >> >> >> cfg.channel = {'0111'}; >> cfg.trialdef.eventtype = 'backpanel trigger'; >> cfg.trialdef.eventvalue = 3; % trigger for the FIC condition >> cfg.trialdef.prestim = 1; % time in seconds before trigger >> cfg.trialdef.poststim = 2; % time in seconds after trigger >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 13 09:45:19 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 09:45:19 +0100 Subject: ICA with averaged data In-Reply-To: <45F14EF2.10808@uke.uni-hamburg.de> Message-ID: Hi Niki, I fully concur with Stefan's advice and add a brief (technical) explanation for why doing ICA on time-locked averaged data is unlikely to give you a good separation. One of the most common application of ICA to EEG/MEG data in cognitive neuroscience seems to be to remove (what the users assume/ judge to be) artifact (i.e. non-brain or non-task related brain) activity from the data, and then to proceed with conventional sensor level analysis on the "clean" data. ICA assumes that the underlying source signals (component waveforms) in the data are statistically independent and have non-gaussian marginal distributions. If either of these assumptions are violated, then the sources are not uniquely identifiable w.r.t. the ICA search criteria, meaning that ICA will tend to give "funny" decompositions. Now consider that (time-locked) averaging essentially involves summing your data over trials at each time point, and that the distribution of the sum of several random variables with any distribution (including non-gaussian) approaches a gaussian distribution in the limit. From this it is clear that time-locked averaging tends to make all non-time locked activity in your data (i.e. the stuff you want to remove, and need ICA to identify) appear MORE gaussian and therefore LESS identifiable from an ICA perspective. As a consequence, ICA cannot model the artifact activity sufficiently well to be able to separate it from your brain activity of interest. Thus, if the aim of using ICA is to remove non-time locked artifacts (i.e. asynchronous oscillatory activity or intermittent transients) from your data, then following the reasoning above it is advisable to decompose the raw data (making sure to include examples of the artifact you wish to remove). Then either remove the artifacts and project back to the sensor space to do your averaging, or just do the averaging on the components themselves. Hope this helps, Christian On 9 Mar 2007, at 13:11, Stefan Debener wrote: > Hi Niki, > > It does, in my opinion, not make much sense to average first and > then run ICA, you unlikely obtain a robust decomposition this way > and may not be able to remove the stimulator artefact. ICA needs > quite a few training data to find a decent decomposition, and this > is not provided by ERPs, even though some commercial software > packages may allow you to apply ICA to ERPs/ERFs. Only if (!) all > your data are recorded such that there was no substantial head > movement (that is, the position between sensors and sources did not > change), you may get a decent artefact IC (or several ICs) from > combined data (there is a few more ifs involved, please see > previous ICA discussions here and in the EEGLAB mailing list). YI'd > suggest using the pca option and decomposse, say, about 50 > components, to start with, and then try to optimize the result by > playing with the pca option and by running ICAs for separate > recording blocks. > Best, > Stefan > > Niki Ray wrote: >> Hi, >> I'm very new to fieldtrip. I have three questions. I have >> collected MEG >> data from patients with a deep brain stimulator implanted. I'd >> like to do an >> ICA to reject the stimulator related artifacts. Sometimes the >> stimulator is >> on and sometimes off. So my first question is, do i combine all >> the data >> together and then perform the ICA, or do i do different ICA >> analyses for >> each condition(on and off stimulation), and hence reject different >> components for each condition? >> One possibility for deciding wich of the artifacts were related >> to the >> stimulator was to use the example matlab script you provide for >> rejecting >> ECG components. Some of the channels (about 13, i'm using a ctf >> 275 system) >> have a lot of very distinct artifact that is obviously from the >> stimulator, >> so i wanted to use one of these channels as the "ECG" channel. Is >> this >> sensible, or not?? >> Finally, I've been getting conflicting advice about whether it >> is okay to >> first average data, and then perform an ICA. What do you suggest >> is the >> right thing to do? >> >> Many thanks! >> Niki >> >> >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 13 12:59:43 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 12:59:43 +0100 Subject: No subject In-Reply-To: <45EEB4A5.9090406@cs.ru.nl> Message-ID: Hi Paul, I have just tested the following FieldTrip functions READ_FCDC_HEADER READ_FCDC_DATA READ_FCDC_EVENT using a test BDF file and I got no errors. This leads me to suspect that there is either something different about your BDF file, or that you are calling these functions in a "non-recommended" way. In order to help you figure out what is going in, can you please give me more detailed information about what is in your file (especially w.r.t. triggers and events), and also send me the segment of code (cut & paste into email is fine) where you call the functions, i.e. what are the cfg fields you are using, or rather what it the content of varargin, exactly. Thanks, Christian On 7 Mar 2007, at 13:48, P.vandenHurk wrote: > Hello Christian, > > I am sorry, but of course. It is a .bdf file. > > The read_fcdc_header function does work by the way. > > Regards, > Paul > > Christian Hesse schreef: >> Hi Paul, >> >> in order to be able to help you, can you please specify which type >> of data format you are trying to read events from? >> >>> Hello, >>> >>> Each time I use the 'read_fcdc_event' function, I get the >>> following error: >>> >>> ??? Error using ==> read_event >>> type field not defined for each event >>> >>> Error in ==> read_fcdc_event at 51 >>> [event] = read_event(varargin{:}); >>> >>> Can you tell me how I can fix this error? >> >> We'll fix the error if there is one, we give you advice on how to >> avoid them :-) >> >> Regards, >> Christian >> >> --------------------------------------------------------------------- >> - >> Christian Hesse, PhD, MIEEE >> >> F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 >> NL-6500 HB Nijmegen The Netherlands >> >> Tel.: +31 (0)24 36 68293 >> Fax: +31 (0)24 36 10989 >> >> Email: c.hesse at fcdonders.ru.nl >> Web: www.fcdonders.ru.nl >> --------------------------------------------------------------------- >> - >> >> >> >> > > -- > > ----------------------------------------------------------- > Paul van den Hurk > > Joint Principal Investigator > Mindfulness Project > Inserm U280, Lyon, France, > > Radboud University Nijmegen: > Department of computer sciences and > Department of Medical Physics and Biophysics/126 > Geert Grooteplein 21 6525 EZ Nijmegen > > Email: P.vandenHurk at cs.ru.nl > > Tel: 024-3613326 > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From juan.vidal at FCDONDERS.RU.NL Tue Mar 13 15:15:39 2007 From: juan.vidal at FCDONDERS.RU.NL (Juan R. Vidal) Date: Tue, 13 Mar 2007 15:15:39 +0100 Subject: heart artifacts with planar transformed data Message-ID: Hi everybody, i have a general question. Is it possible to find heart artifacts in planar transformed MEG data? I had a discussion with a collegue about it but we did not get at any conclusion. I did some ICA on these MEG data and found 2-3 components that had a veery broad scalp distribution, heart like. Thanks for sharing any experience or knowledge about it. Best, Juan -- Juan R. Vidal, PhD Neuronal Coherence Group F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen Kapittelweg 29 6525 EN Nijmegen The Netherlands Phone: (+31) (0)24 36 10880 Fax: (+31) (0)24 36 10989 e-mail: juan.vidal at fcdonders.ru.nl website: www.ru.nl/fcdonders/ From sameer at ANDREW.CMU.EDU Tue Mar 13 15:27:56 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 13 Mar 2007 10:27:56 -0400 Subject: MNI aligned grids, mris and segmentation Message-ID: Hi, I want to start DICS analysis of my MEG data. For this I need to have MRI and MEG data coregistered. I also need multisphere forward models for which segmentation is necessary. Am I correct in understanding that the following webpage contains info about segmentation? (in addition to MNI aligning all grids) From (http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) Here, in the very beginning, SUBJ = {'subj1','subj2','subj3'}; PREINMRI = '~/mri/'; PREOUT = '~/grids/'; TEMPL = 'mni_standards/t1_icbm_normal_1mm_pn0_rf0.mnc'; RES = 1; % grid resolution [cm] OUTWARDSHIFT = 1.5; % outwardshift for inside/outside detection [cm] % segment the template brain and construct volume templmri = read_fcdc_mri(sprintf('%s%s',PREINMRI,TEMPL)); clear cfg; cfg.coordinates = 'spm'; seg = volumesegment(cfg,templmri); vol = prepare_singleshell([],seg); I understand that in the commands above, first we are creating a template mri to which all other grids will later be aligned. What exactly is t1_icbm_normal_1mm_pn0_rf0.mnc ? Is it a slice from an mri image. Can I give the path to my dicom mri images directory and the name of a file ending in .dcm? Incidently >> mri = read_fcdc_mri('Z:\KarmaCond\BIRC_images_foolaround\070207134421\2\02-0001-000001.dcm'); ??? Undefined function or variable "hdr". Error in ==> read_fcdc_mri at 179 [z, indx] = sort(cell2mat({hdr.SliceLocation})); Thanks you very much. sameer From c.hesse at FCDONDERS.RU.NL Tue Mar 13 15:54:31 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 15:54:31 +0100 Subject: heart artifacts with planar transformed data In-Reply-To: <45F6B20B.4090809@fcdonders.ru.nl> Message-ID: Hi Juan, are you doing this ICA on concatenated single trials of MEG data that has been put back together with COMBINEPLANAR? And is this time- domain or frequency domain data (output 'pow')? Cheers, Christian On 13 Mar 2007, at 15:15, Juan R. Vidal wrote: > Hi everybody, > > i have a general question. Is it possible to find heart > artifacts in planar transformed MEG data? I had a discussion with a > collegue about it but we did not get at any conclusion. I did some > ICA on these MEG data and found 2-3 components that had a veery > broad scalp distribution, heart like. Thanks for sharing any > experience or knowledge about it. > > Best, > > Juan > > -- > Juan R. Vidal, PhD > Neuronal Coherence Group > F.C. Donders Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Kapittelweg 29 > 6525 EN Nijmegen > The Netherlands > > Phone: (+31) (0)24 36 10880 > Fax: (+31) (0)24 36 10989 > e-mail: juan.vidal at fcdonders.ru.nl > website: www.ru.nl/fcdonders/ > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ychen at BME.UFL.EDU Tue Mar 13 20:49:24 2007 From: ychen at BME.UFL.EDU (Y Chen) Date: Tue, 13 Mar 2007 20:49:24 +0100 Subject: Problem with BESA coordinate system Message-ID: Hi Robert, Thanks for your kind reply. However when I check the createlayout.m function, it turns out that in line 229, the coordinate has been rotated 90 degree (multiply [0 1; -1 0]). For my electrode file, when I remove this coordinate transformation, I get the right layout. Chen From r.oostenveld at FCDONDERS.RU.NL Wed Mar 14 10:18:18 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 14 Mar 2007 10:18:18 +0100 Subject: sourceanalysis.m on EEG data In-Reply-To: <6.1.2.0.2.20070312135517.01cdada0@email.med.yale.edu> Message-ID: On 12 Mar 2007, at 18:56, Brian Roach wrote: > The prepare_bemmodel calls a function "write_tri" when using the > dipoli option. I cannot find this function on the server or in any > of my downloaded files. Does anyone have it to share? please find it attached. Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: write_tri.m Type: application/octet-stream Size: 651 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Wed Mar 14 10:43:54 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 14 Mar 2007 10:43:54 +0100 Subject: Problem with BESA coordinate system In-Reply-To: Message-ID: Dear Chen, I have just made some changes to the layout parts of the code. If you download the latest FT zip file from our FTP server you can see the changes. I replaced the private/createlayout function by a new main function PREPARE_LAYOUT. I also updated the LAYOUTPLOT function (actually I forgot in my previous mail to mention the existence of that function). The specification of the 2D positions for topo and multiplotting can now be done more explicitely, and is documented in prepare_layout. Also the conversion from 3D to 2D locations is also more easily to recognize. The layoutplot function is there to help in the debugging. What now happens is that in the case of specifying cfg.gradfile or cfg.grad, it will rotate by default with 90 deg. When specifying cfg.elecfile or cfg.elec, it will NOT rotate. When specifying cfg.layout, it will just read the *.lay file, or it will read it as matlab *.mat file without further manipulation, or it will read it as electrode file and in that case not rotate it. It now would be easy to explicitely add an cfg.rotate option to the prepare_layout implementation, but I think that the current version should already solve your problem. best regards, Robert On 13 Mar 2007, at 20:49, Y Chen wrote: > Hi Robert, > > Thanks for your kind reply. However when I check the createlayout.m > function, it turns out that in line 229, the coordinate has been > rotated > 90 degree (multiply [0 1; -1 0]). For my electrode file, when I remove > this coordinate transformation, I get the right layout. > > Chen From gmcauley at LLU.EDU Wed Mar 14 20:32:51 2007 From: gmcauley at LLU.EDU (McAuley, Grant (LLU)) Date: Wed, 14 Mar 2007 12:32:51 -0700 Subject: Error in FREQANALYSIS Message-ID: I am seeing an error in FREQANALYSIS (see output below). It seems centered around the 'cfg.tapper' field. I have tried 'dpss', 'hanning' (output below), and 'sine' (which gives an Out of Memory Error). (Not sure where to find info on WINDOW). My data is in a structure as described here: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:frequently_asked_questions (How can I import my own dataformat?) Relevant MATLAB output is below. Pardon me if I am missing something obvious - this is new territory for me. Any ideas on what might be the problem? % my data structure with example values >> hv1_69 hv1_69 = label: {2x1 cell} fsample: 200 trial: {[2x48528 double]} time: {[1x48529 double]} >> hv1_69.trial{1}(1,1:5) ans = 4.9460 4.2540 1.9510 0.0820 0.6380 >> hv1_69.time{1}(1,1:5) ans = 0 0.0050 0.0100 0.0150 0.0200 % here are cfg values >> cfg cfg = output: 'pow' method: 'mtmfft' tapsmofrq: 4 pad: 'maxperlen' taper: 'dpss' foilim: [0 100] >> [freq] = freqanalysis(cfg, hv1_69); ??? Undefined function or method 'dpss' for input arguments of type 'double'. Error in ==> freqanalysis_mtmfft>double_dpss at 560 tap = dpss(double(a), double(b), varargin{:}); Error in ==> freqanalysis_mtmfft at 387 tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; Error in ==> freqanalysis at 193 [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), cfg, data); % try different 'cfg.taper' value >> cfg.taper = 'hanning'; >> [freq] = freqanalysis(cfg, hv1_69); ??? Undefined function or method 'window' for input arguments of type 'char'. Error in ==> freqanalysis_mtmfft at 393 tap = window(cfg.taper, numdatbns)'; Error in ==> freqanalysis at 193 [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), cfg, data); %MATLAB version >> version ans = 7.3.0.267 (R2006b) From gmcauley at LLU.EDU Wed Mar 14 20:37:18 2007 From: gmcauley at LLU.EDU (McAuley, Grant (LLU)) Date: Wed, 14 Mar 2007 12:37:18 -0700 Subject: Spectral Medium, Edge and Dominant Frequency Functions Message-ID: Pardon me if I missed it, but are there functions in FT for computing Spectral Edge, Medium and Dominant Frequency for a data trial? If not, perhaps someone knows of an implementation of such algorithms somewhere else? From c.hesse at FCDONDERS.RU.NL Wed Mar 14 22:12:45 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 14 Mar 2007 22:12:45 +0100 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Hi Grant, Ahhh ... you're trying to do all of this without the signal processing toolbox, aren't you. In that case I must apologize for having given you slightly inaccurate info before: the DPSS and WINDOW functions are from the signal processing toolbox. Having just had a play with FREQANALYSIS it turns out that in it's current version a taper must be specified (e.g., cfg.taper = 'none') gives an error. This means that you apparently cannot use FieldTrip (in its current form) to do simple, "no-frills" spectral estimation. I will have a closer look to see if we can change it so allow cfg.taper = 'none', since this means that you could apply your own taper to your data before using FREQANALYSIS or just leave it out. Realistically speaking though, it seems to me that your best options are basically a) to get the signal processing toolbox, or b) to just write your own matlab functions to estimate your power spectra (about 3 lines of code) and then calculate your SEF and MF measures (another few lines at most). Cheers, Christian > I am seeing an error in FREQANALYSIS (see output below). It seems > centered around the 'cfg.tapper' field. I have tried 'dpss', > 'hanning' (output below), and 'sine' (which gives an Out of Memory > Error). (Not sure where to find info on WINDOW). > > > My data is in a structure as described here: > http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:frequently_asked_questions > (How can I import my own dataformat?) > > > Relevant MATLAB output is below. > > > Pardon me if I am missing something obvious - this is new territory > for me. Any ideas on what might be the problem? > > > > > % my data structure with example values >>> hv1_69 > > hv1_69 = > > label: {2x1 cell} > fsample: 200 > trial: {[2x48528 double]} > time: {[1x48529 double]} > > >>> hv1_69.trial{1}(1,1:5) > > ans = > > 4.9460 4.2540 1.9510 0.0820 0.6380 > >>> hv1_69.time{1}(1,1:5) > > ans = > > 0 0.0050 0.0100 0.0150 0.0200 > > % here are cfg values >>> cfg > > cfg = > > output: 'pow' > method: 'mtmfft' > tapsmofrq: 4 > pad: 'maxperlen' > taper: 'dpss' > foilim: [0 100] > > >>> [freq] = freqanalysis(cfg, hv1_69); > ??? Undefined function or method 'dpss' for input arguments of type > 'double'. > > Error in ==> freqanalysis_mtmfft>double_dpss at 560 > tap = dpss(double(a), double(b), varargin{:}); > > Error in ==> freqanalysis_mtmfft at 387 > tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./ > data.fsample))'; > > Error in ==> freqanalysis at 193 > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > cfg, data); > > > > % try different 'cfg.taper' value >>> cfg.taper = 'hanning'; >>> [freq] = freqanalysis(cfg, hv1_69); > ??? Undefined function or method 'window' for input arguments of > type 'char'. > > Error in ==> freqanalysis_mtmfft at 393 > tap = window(cfg.taper, numdatbns)'; > > Error in ==> freqanalysis at 193 > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > cfg, data); > > > %MATLAB version >>> version > > ans = > > 7.3.0.267 (R2006b) > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Wed Mar 14 22:39:08 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 14 Mar 2007 22:39:08 +0100 Subject: Spectral Medium, Edge and Dominant Frequency Functions In-Reply-To: Message-ID: Hi Grant, > Pardon me if I missed it, but are there functions in FT for > computing Spectral Edge, Medium and Dominant Frequency for a data > trial? > > If not, perhaps someone knows of an implementation of such > algorithms somewhere else? As far as I am aware, there are no direct functions in Fieldtrip for extracting these measures from power spectra (since this sort of approach to spectral analysis is a tad more reductionist that is useful for most FT purposes). There is also nothing in the Signal Processing Toolbox, since this has mainly to do with spectral estimation as such, filter design, prediction, etc ... However, computing these measures is quite straightforward in matlab assuming you have the power spectum of the data (The matlab help for FFT tells you how to compute the power spectrum in a few simple lines, which you can turn into your own function). The following is only pseudo/outline code for a little function to get median, spectral edge and dominant frequencies: function [mf, sef, df] = specstats(freq, pyy) % your frequency axis is freq (a vector) % your power spectrum is pyy (a vector) % normalize spectrum to get a density pyy_norm = pyy./sum(pyy); % compute cumulative density pyy_cum = cumsum(pyy_norm); % median frequency corresponds to the frequency at (nearest to) % the point on the freq axis where pyy_cum = 0.5 [val, idx] = min(abs(pyy_cum-0.5)); mf = freq(idx); % spectral edge frequency corresponds to the frequency at (nearest to) % the point on the freq axis where pyy_cum = 0.05 [val, idx] = min(abs(pyy_cum-0.05)); sef = freq(idx); % you can extend this code for dominant frequency accordingly ... if all you mean % is the peak frequency then you have [val, idx] = max(pyy); df = freq(idx); Depending on how sophisticated you want to get you can apply a bit of interpolation to pyy as well, but that is probably overkill. I hope that helps Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Mar 15 13:53:46 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 15 Mar 2007 13:53:46 +0100 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Hi Grant On 14 Mar 2007, at 22:12, Christian Hesse wrote: > Ahhh ... you're trying to do all of this without the signal > processing toolbox, aren't you. In that case I must apologize for > having given you slightly inaccurate info before: the DPSS and > WINDOW functions are from the signal processing toolbox. > > ... > Realistically speaking though, it seems to me that your best > options are basically a) to get the signal processing toolbox, or > b) to just write your own matlab functions to estimate your power > spectra (about 3 lines of code) and then calculate your SEF and MF > measures (another few lines at most). with respect to option "b": I think the easiest is to replicate the WINDOW function from the signal preocessing toolbox. The dpss is difficult, but hanning, triangle, rectwin and some others are trivial. The WINDOW function is just a convenient wrapper function for various tapers. See at the bottom of this mail for the full help. The window replacement function to be written should behave as >> tap = window('hanning', 10) tap = 0.0794 0.2923 0.5712 0.8274 0.9797 0.9797 0.8274 0.5712 0.2923 0.0794 >> tap = window('rectwin', 10) tap = 1 1 1 1 1 1 1 1 1 1 >> tap = window('triang', 10) tap = 0.1000 0.3000 0.5000 0.7000 0.9000 0.9000 0.7000 0.5000 0.3000 0.1000 I hope that this suggestion helps, Robert --------------- >> help window WINDOW Window function gateway. WINDOW(@WNAME,N) returns an N-point window of type specified by the function handle @WNAME in a column vector. @WNAME can be any valid window function name, for example: @bartlett - Bartlett window. @barthannwin - Modified Bartlett-Hanning window. @blackman - Blackman window. @blackmanharris - Minimum 4-term Blackman-Harris window. @bohmanwin - Bohman window. @chebwin - Chebyshev window. @flattopwin - Flat Top window. @gausswin - Gaussian window. @hamming - Hamming window. @hann - Hann window. @kaiser - Kaiser window. @nuttallwin - Nuttall defined minimum 4-term Blackman-Harris window. @parzenwin - Parzen (de la Valle-Poussin) window. @rectwin - Rectangular window. @tukeywin - Tukey window. @triang - Triangular window. WINDOW(@WNAME,N,OPT) designs the window with the optional input argument specified in OPT. To see what the optional input arguments are, see the help for the individual windows, for example, KAISER or CHEBWIN. WINDOW launches the Window Design & Analysis Tool (WinTool). EXAMPLE: N = 65; w = window(@blackmanharris,N); w1 = window(@hamming,N); w2 = window(@gausswin,N,2.5); plot(1:N,[w,w1,w2]); axis([1 N 0 1]); legend('Blackman-Harris','Hamming','Gaussian'); See also bartlett, barthannwin, blackman, blackmanharris, bohmanwin, chebwin, gausswin, hamming, hann, kaiser, nuttallwin, parzenwin, rectwin, triang, tukeywin, WINTOOL. From Brian.Roach at YALE.EDU Wed Mar 14 23:25:06 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Wed, 14 Mar 2007 18:25:06 -0400 Subject: results of prepare_bemmodel Message-ID: FT users, after running vol = prepare_bemmodel(cfg, mri) where cfg = tissue: [1 2 3] numvertices: [1000 2000 3000] conductivity: [1 0.0125 1] isolatedsource: 3 method: 'dipoli' dipoli: '/home/bjr39/FTsource/dipoli' and mri = dim: [181 217 181] xgrid: [1x181 double] ygrid: [1x217 double] zgrid: [1x181 double] anatomy: [181x217x181 double] transform: [4x4 double] hdr: [1x1 struct] seg: [181x217x181 double] I am trying to make figures of the surfaces with triplot.m: >> triplot(vol.bnd(1).pnt, vol.bnd(1).tri, 'faces_skin'); rotate3d ??? Subscript indices must either be real positive integers or logicals. Error in ==> triplot at 38 h = plot(x(d), y(d),c,varargin{start:end}); -------------------------------------------------------------------------- I must have done something wrong along the way, but I am not sure what. Any ideas? thanks, Brian From t.schneider at UKE.UNI-HAMBURG.DE Thu Mar 15 15:45:35 2007 From: t.schneider at UKE.UNI-HAMBURG.DE (Till Schneider) Date: Thu, 15 Mar 2007 15:45:35 +0100 Subject: results of prepare_bemmodel In-Reply-To: <6.1.2.0.2.20070314181408.02df3d70@email.med.yale.edu> Message-ID: Dear Brian, there are actually two triplot functions: one in the fieldtrip private directory and one 'official' matlab function. You should use the fieldtrip function, for the line of code below. It should work then. Regards, Till Brian Roach schrieb: > FT users, > > after running vol = prepare_bemmodel(cfg, mri) > > where cfg = > > tissue: [1 2 3] > numvertices: [1000 2000 3000] > conductivity: [1 0.0125 1] > isolatedsource: 3 > method: 'dipoli' > dipoli: '/home/bjr39/FTsource/dipoli' > > and mri = > > dim: [181 217 181] > xgrid: [1x181 double] > ygrid: [1x217 double] > zgrid: [1x181 double] > anatomy: [181x217x181 double] > transform: [4x4 double] > hdr: [1x1 struct] > seg: [181x217x181 double] > > > I am trying to make figures of the surfaces with triplot.m: > > >> triplot(vol.bnd(1).pnt, vol.bnd(1).tri, 'faces_skin'); rotate3d > ??? Subscript indices must either be real positive integers or logicals. > > Error in ==> triplot at 38 > h = plot(x(d), y(d),c,varargin{start:end}); > -------------------------------------------------------------------------- > > I must have done something wrong along the way, but I am not sure > what. Any ideas? > > thanks, > Brian > > -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf Körperschaft des öffentlichen Rechts Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Jörg F. Debatin (Vorsitzender) Dr. Alexander Kirstein Ricarda Klein Prof. Dr. Rolf A.K. Stahl From Brian.Roach at YALE.EDU Thu Mar 15 16:00:25 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 15 Mar 2007 11:00:25 -0400 Subject: results of prepare_bemmodel In-Reply-To: <45F95C0F.1020408@uke.uni-hamburg.de> Message-ID: That did it - thanks!!! At 10:45 AM 3/15/2007, you wrote: >Dear Brian, > >there are actually two triplot functions: one in the fieldtrip private >directory and one 'official' matlab function. >You should use the fieldtrip function, for the line of code below. It >should work then. > >Regards, >Till > > >Brian Roach schrieb: >>FT users, >> >>after running vol = prepare_bemmodel(cfg, mri) >> >>where cfg = >> >> tissue: [1 2 3] >> numvertices: [1000 2000 3000] >> conductivity: [1 0.0125 1] >> isolatedsource: 3 >> method: 'dipoli' >> dipoli: '/home/bjr39/FTsource/dipoli' >> >>and mri = >> >> dim: [181 217 181] >> xgrid: [1x181 double] >> ygrid: [1x217 double] >> zgrid: [1x181 double] >> anatomy: [181x217x181 double] >> transform: [4x4 double] >> hdr: [1x1 struct] >> seg: [181x217x181 double] >> >> >>I am trying to make figures of the surfaces with triplot.m: >> >> >> triplot(vol.bnd(1).pnt, vol.bnd(1).tri, 'faces_skin'); rotate3d >>??? Subscript indices must either be real positive integers or logicals. >> >>Error in ==> triplot at 38 >>h = plot(x(d), y(d),c,varargin{start:end}); >>-------------------------------------------------------------------------- >>I must have done something wrong along the way, but I am not sure what. >>Any ideas? >> >>thanks, >>Brian >> > > > >-- > >Pflichtangaben gemäß Gesetz über elektronische Handelsregister und >Genossenschaftsregister sowie das Unternehmensregister (EHUG): > >Universitätsklinikum Hamburg-Eppendorf >Körperschaft des öffentlichen Rechts >Gerichtsstand: Hamburg > >Vorstandsmitglieder: >Prof. Dr. Jörg F. Debatin (Vorsitzender) >Dr. Alexander Kirstein >Ricarda Klein >Prof. Dr. Rolf A.K. Stahl >ca From gmcauley at LLU.EDU Fri Mar 16 17:30:51 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Fri, 16 Mar 2007 09:30:51 -0700 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Thanks Christian, I will go with option b. ~ Grant On Wed, 2007-03-14 at 22:12 +0100, Christian Hesse wrote: > Hi Grant, > > > Ahhh ... you're trying to do all of this without the signal processing > toolbox, aren't you. In that case I must apologize for having given > you slightly inaccurate info before: the DPSS and WINDOW functions are > from the signal processing toolbox. > > > Having just had a play with FREQANALYSIS it turns out that in it's > current version a taper must be specified (e.g., cfg.taper = 'none') > gives an error. This means that you apparently cannot use FieldTrip > (in its current form) to do simple, "no-frills" spectral estimation. I > will have a closer look to see if we can change it so allow cfg.taper > = 'none', since this means that you could apply your own taper to your > data before using FREQANALYSIS or just leave it out. > > > Realistically speaking though, it seems to me that your best options > are basically a) to get the signal processing toolbox, or b) to just > write your own matlab functions to estimate your power spectra (about > 3 lines of code) and then calculate your SEF and MF measures (another > few lines at most). > > > Cheers, > Christian > > > > > > > > I am seeing an error in FREQANALYSIS (see output below). It seems > > centered around the 'cfg.tapper' field. I have tried 'dpss', > > 'hanning' (output below), and 'sine' (which gives an Out of Memory > > Error). (Not sure where to find info on WINDOW). > > > > > > > > > > My data is in a structure as described here: > > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:frequently_asked_questions > > (How can I import my own dataformat?) > > > > > > > > > > Relevant MATLAB output is below. > > > > > > > > > > Pardon me if I am missing something obvious - this is new territory > > for me. Any ideas on what might be the problem? > > > > > > > > > > > > > > > > > > % my data structure with example values > > > > hv1_69 > > > > > > hv1_69 = > > > > > > label: {2x1 cell} > > fsample: 200 > > trial: {[2x48528 double]} > > time: {[1x48529 double]} > > > > > > > > > > > > hv1_69.trial{1}(1,1:5) > > > > > > ans = > > > > > > 4.9460 4.2540 1.9510 0.0820 0.6380 > > > > > > > > hv1_69.time{1}(1,1:5) > > > > > > ans = > > > > > > 0 0.0050 0.0100 0.0150 0.0200 > > > > > > % here are cfg values > > > > cfg > > > > > > cfg = > > > > > > output: 'pow' > > method: 'mtmfft' > > tapsmofrq: 4 > > pad: 'maxperlen' > > taper: 'dpss' > > foilim: [0 100] > > > > > > > > > > > > [freq] = freqanalysis(cfg, hv1_69); > > ??? Undefined function or method 'dpss' for input arguments of type > > 'double'. > > > > > > Error in ==> freqanalysis_mtmfft>double_dpss at 560 > > tap = dpss(double(a), double(b), varargin{:}); > > > > > > Error in ==> freqanalysis_mtmfft at 387 > > tap = > > double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; > > > > > > Error in ==> freqanalysis at 193 > > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > > cfg, data); > > > > > > > > > > > > > > % try different 'cfg.taper' value > > > > cfg.taper = 'hanning'; > > > > [freq] = freqanalysis(cfg, hv1_69); > > ??? Undefined function or method 'window' for input arguments of > > type 'char'. > > > > > > Error in ==> freqanalysis_mtmfft at 393 > > tap = window(cfg.taper, numdatbns)'; > > > > > > Error in ==> freqanalysis at 193 > > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > > cfg, data); > > > > > > > > > > %MATLAB version > > > > version > > > > > > ans = > > > > > > 7.3.0.267 (R2006b) > > > > > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From gmcauley at LLU.EDU Fri Mar 16 17:46:09 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Fri, 16 Mar 2007 09:46:09 -0700 Subject: Spectral Medium, Edge and Dominant Frequency Functions In-Reply-To: Message-ID: Thanks Christian, This is very helpful. I did not know about the 'cumsum' function - it makes this almost trivial. ~ Grant On Wed, 2007-03-14 at 22:39 +0100, Christian Hesse wrote: > Hi Grant, > > > > Pardon me if I missed it, but are there functions in FT for > > computing Spectral Edge, Medium and Dominant Frequency for a data > > trial? > > > > > > If not, perhaps someone knows of an implementation of such > > algorithms somewhere else? > > > As far as I am aware, there are no direct functions in Fieldtrip for > extracting these measures from power spectra (since this sort of > approach to spectral analysis is a tad more reductionist that is > useful for most FT purposes). There is also nothing in the Signal > Processing Toolbox, since this has mainly to do with spectral > estimation as such, filter design, prediction, etc ... > > > However, computing these measures is quite straightforward in matlab > assuming you have the power spectum of the data (The matlab help for > FFT tells you how to compute the power spectrum in a few simple lines, > which you can turn into your own function). The following is only > pseudo/outline code for a little function to get median, spectral edge > and dominant frequencies: > > > > > function [mf, sef, df] = specstats(freq, pyy) > % your frequency axis is freq (a vector) > % your power spectrum is pyy (a vector) > > > % normalize spectrum to get a density > pyy_norm = pyy./sum(pyy); > > > % compute cumulative density > pyy_cum = cumsum(pyy_norm); > > > % median frequency corresponds to the frequency at (nearest to) > % the point on the freq axis where pyy_cum = 0.5 > [val, idx] = min(abs(pyy_cum-0.5)); > mf = freq(idx); > > > % spectral edge frequency corresponds to the frequency at (nearest to) > % the point on the freq axis where pyy_cum = 0.05 > [val, idx] = min(abs(pyy_cum-0.05)); > sef = freq(idx); > > > % you can extend this code for dominant frequency accordingly ... if > all you mean > % is the peak frequency then you have > [val, idx] = max(pyy); > df = freq(idx); > > > > > Depending on how sophisticated you want to get you can apply a bit of > interpolation to pyy as well, but that is probably overkill. > > > > > I hope that helps > Christian > > > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From gmcauley at LLU.EDU Fri Mar 16 17:50:52 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Fri, 16 Mar 2007 09:50:52 -0700 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Thanks Robert, I have decided to go with option b). The 'WINDOW' information is enlightening and very helpful. ~ Grant On Thu, 2007-03-15 at 13:53 +0100, Robert Oostenveld wrote: > Hi Grant > > On 14 Mar 2007, at 22:12, Christian Hesse wrote: > > Ahhh ... you're trying to do all of this without the signal > > processing toolbox, aren't you. In that case I must apologize for > > having given you slightly inaccurate info before: the DPSS and > > WINDOW functions are from the signal processing toolbox. > > > > ... > > Realistically speaking though, it seems to me that your best > > options are basically a) to get the signal processing toolbox, or > > b) to just write your own matlab functions to estimate your power > > spectra (about 3 lines of code) and then calculate your SEF and MF > > measures (another few lines at most). > > with respect to option "b": I think the easiest is to replicate the > WINDOW function from the signal preocessing toolbox. The dpss is > difficult, but hanning, triangle, rectwin and some others are > trivial. The WINDOW function is just a convenient wrapper function > for various tapers. See at the bottom of this mail for the full help. > The window replacement function to be written should behave as > > >> tap = window('hanning', 10) > tap = > 0.0794 > 0.2923 > 0.5712 > 0.8274 > 0.9797 > 0.9797 > 0.8274 > 0.5712 > 0.2923 > 0.0794 > > >> tap = window('rectwin', 10) > tap = > 1 > 1 > 1 > 1 > 1 > 1 > 1 > 1 > 1 > 1 > > >> tap = window('triang', 10) > tap = > 0.1000 > 0.3000 > 0.5000 > 0.7000 > 0.9000 > 0.9000 > 0.7000 > 0.5000 > 0.3000 > 0.1000 > > I hope that this suggestion helps, > Robert > > > --------------- > > >> help window > WINDOW Window function gateway. > WINDOW(@WNAME,N) returns an N-point window of type specified > by the function handle @WNAME in a column vector. @WNAME can > be any valid window function name, for example: > @bartlett - Bartlett window. > @barthannwin - Modified Bartlett-Hanning window. > @blackman - Blackman window. > @blackmanharris - Minimum 4-term Blackman-Harris window. > @bohmanwin - Bohman window. > @chebwin - Chebyshev window. > @flattopwin - Flat Top window. > @gausswin - Gaussian window. > @hamming - Hamming window. > @hann - Hann window. > @kaiser - Kaiser window. > @nuttallwin - Nuttall defined minimum 4-term Blackman-Harris > window. > @parzenwin - Parzen (de la Valle-Poussin) window. > @rectwin - Rectangular window. > @tukeywin - Tukey window. > @triang - Triangular window. > WINDOW(@WNAME,N,OPT) designs the window with the optional input > argument > specified in OPT. To see what the optional input arguments are, > see the help > for the individual windows, for example, KAISER or CHEBWIN. > WINDOW launches the Window Design & Analysis Tool (WinTool). > EXAMPLE: > N = 65; > w = window(@blackmanharris,N); > w1 = window(@hamming,N); > w2 = window(@gausswin,N,2.5); > plot(1:N,[w,w1,w2]); axis([1 N 0 1]); > legend('Blackman-Harris','Hamming','Gaussian'); > > See also bartlett, barthannwin, blackman, blackmanharris, > bohmanwin, > chebwin, gausswin, hamming, hann, kaiser, nuttallwin, > parzenwin, > rectwin, triang, tukeywin, WINTOOL. -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From c.hesse at FCDONDERS.RU.NL Fri Mar 16 17:56:21 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Fri, 16 Mar 2007 17:56:21 +0100 Subject: Spectral Medium, Edge and Dominant Frequency Functions In-Reply-To: <1174063569.11369.63.camel@localhost.localdomain> Message-ID: Hi Grant, glad I was (eventually) able to help you out; good luck and success with option b) ! On 16 Mar 2007, at 17:46, Grant McAuley wrote: > Thanks Christian, > > This is very helpful. I did not know about the 'cumsum' function - it > makes this almost trivial. > > ~ Grant b.t.w. you could have also done it in 2 lines of code without the cumsum function: pyy_cum = pyy_norm; for i=1:length(pyy_cum), if (i>1), pyy_cum(i) = pyy_cum(i) + pyy_cum (i-1); end; end; % or leave out the if statement if you are sure that length(pyy_cum) >=2 ;-) ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Mon Mar 19 00:14:35 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Sun, 18 Mar 2007 16:14:35 -0700 Subject: MultiplotER using Neuromag lay In-Reply-To: Message-ID: Hi, Christian, Sorry I didn't reply this for a long time. Thanks for these suggestions. They work well. And I found after using read_data, the other processing still can work for whole data. However, I met another problem. After I did timelockanalysis, I tried to plot average data using multiplotER. I downloaded the file "NM306mag.lay" and other two you offered. The layoutplot(cfg) shows that the files are correct. However, when I used multiplotER(cfg,avgdata), the figure showed up was blank. Nothing on it even the lables. Could you or other experts tell me the possible way to figure it out? Thanks so much. Best, Eve Christian Hesse wrote: Hi Eve, I can use meg-pd toolbox now. However, it seems all the functions in FieldTrip are for evoked data while my raw data is continuous data. FieldTrip handles a variety of data, and the low level reading functions can deal with continuous or epoch based raw data. When you analyze your data in FT, you usually start by defining your trials, i.e. epochs in your continuous data that are of interest, w.r.t. to some sort of trigger or event. The function PREPROCESSING then scans through your raw data file and returns a data structure which contains all of the specified epochs (for a particular trial definition) in a field data.trial. Please note that this has nothing to do with evoked vs induced responses just yet. You can use the output of PREPROCESSING as input to either TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced phenomena, respectively. Afterwards you can call various statistical functions such as FREQDESCRIPTIVES, etc ... So the reason why I have been giving you the examples using read_header and read_data is because I needed to determine the nature of the error you were getting without really knowning anything about what sort of data is in your file. In your use of FT you do not actually use these functions yourself, but basically use functions like DEFINE_TRIAL and PREPROCESSING to start with. --------------------------------- No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Mon Mar 19 08:52:40 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Mon, 19 Mar 2007 08:52:40 +0100 Subject: MultiplotER using Neuromag lay In-Reply-To: <448639.81069.qm@web56614.mail.re3.yahoo.com> Message-ID: Hi Eve, > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. Could you email (cut past from matlab) any of the warnings and errors that the call to MULTIPLOTER produced, thanks. It is also possible that this strange behaviour of MULTIPLOTER may have something to do with some minor changes that were recently made to the layout structure used by FT. There is now a function called PREPARE_LAYOUT (download the latest version of FT, and it lives in the fieldtrip directory) which will generate the correct layout structure for you, using the gradiometer information in your data structure. Try using the layout generated by this function for plotting, and please let me know if there are any errors. Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From jgross at UNI-DUESSELDORF.DE Mon Mar 19 10:38:12 2007 From: jgross at UNI-DUESSELDORF.DE (Joachim Gross) Date: Mon, 19 Mar 2007 09:38:12 +0000 Subject: MultiplotER using Neuromag lay In-Reply-To: <448639.81069.qm@web56614.mail.re3.yahoo.com> Message-ID: Hi Eve, I think I had a similar problem. In my case the channel labels in NM306mag.lay did not exactly match the labels in avgdata.label. After changing either set of labels it worked for me. Joachim alotof eve wrote: > Hi, Christian, > > Sorry I didn't reply this for a long time. Thanks for these > suggestions. They work well. And I found after using read_data, the > other processing still can work for whole data. > > However, I met another problem. > > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. > > Could you or other experts tell me the possible way to figure it > out? Thanks so much. > > Best, > Eve > > > */Christian Hesse /* wrote: > > Hi Eve, > >> I can use meg-pd toolbox now. However, it seems all the functions >> in FieldTrip are for evoked data while my raw data is continuous >> data. > > FieldTrip handles a variety of data, and the low level reading > functions can deal with continuous or epoch based raw data. > > When you analyze your data in FT, you usually start by defining > your trials, i.e. epochs in your continuous data that are of > interest, w.r.t. to some sort of trigger or event. The function > PREPROCESSING then scans through your raw data file and returns a > data structure which contains all of the specified epochs (for a > particular trial definition) in a field data.trial. Please note > that this has nothing to do with evoked vs induced responses just yet. > > You can use the output of PREPROCESSING as input to either > TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced > phenomena, respectively. Afterwards you can call various > statistical functions such as FREQDESCRIPTIVES, etc ... > > So the reason why I have been giving you the examples using > read_header and read_data is because I needed to determine the > nature of the error you were getting without really knowning > anything about what sort of data is in your file. In your use of > FT you do not actually use these functions yourself, but basically > use functions like DEFINE_TRIAL and PREPROCESSING to start with. > > ------------------------------------------------------------------------ > No need to miss a message. Get email on-the-go > > with Yahoo! Mail for Mobile. Get started. > From sameer at ANDREW.CMU.EDU Mon Mar 19 14:26:39 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 19 Mar 2007 09:26:39 -0400 Subject: cross spectral density issues Message-ID: Hi, When I do cfgCSD = []; cfgCSD.output = 'powandcsd'; cfgCSD.method = 'mtmfft'; cfgCSD.foilim = [5 100]; cfgCSD.tapsmofrq = 5; cfgCSD.keeptrials = 'yes'; cfgCSD.channel = {'MEG'} ; cfgCSD.channelcmb = {'MEG' 'MEG'}; freqCSD_RR_One = freqanalysis(cfgCSD,dataRR_One); I get the following error. ??? Error using ==> unknown Maximum variable size allowed by the program is exceeded. Error in ==> freqanalysis_mtmfft at 342 if csdflg, crsspctrm = complex(zeros(numper,numsgncmb,numboi)); end Error in ==> freqanalysis at 167 [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); But I remember using something very close to this some ten days ago. So I am not sure what I might be doing wrong. Any suggestions are very welcome. I tried using method 'mtmwelch' but that gave a host of other errors including looking for cfg.foi instead of cfg.foilim (non uniformity in application). best, sameer From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 19 15:27:39 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 19 Mar 2007 10:27:39 -0400 Subject: MultiplotER using Neuromag lay Message-ID: Hi, Can someone give me the link where I can download NM306mag.lay? Thanks, Matt -----Original Message----- From: FieldTrip discussion list on behalf of Joachim Gross Sent: Mon 3/19/2007 5:38 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay Hi Eve, I think I had a similar problem. In my case the channel labels in NM306mag.lay did not exactly match the labels in avgdata.label. After changing either set of labels it worked for me. Joachim alotof eve wrote: > Hi, Christian, > > Sorry I didn't reply this for a long time. Thanks for these > suggestions. They work well. And I found after using read_data, the > other processing still can work for whole data. > > However, I met another problem. > > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. > > Could you or other experts tell me the possible way to figure it > out? Thanks so much. > > Best, > Eve > > > */Christian Hesse /* wrote: > > Hi Eve, > >> I can use meg-pd toolbox now. However, it seems all the functions >> in FieldTrip are for evoked data while my raw data is continuous >> data. > > FieldTrip handles a variety of data, and the low level reading > functions can deal with continuous or epoch based raw data. > > When you analyze your data in FT, you usually start by defining > your trials, i.e. epochs in your continuous data that are of > interest, w.r.t. to some sort of trigger or event. The function > PREPROCESSING then scans through your raw data file and returns a > data structure which contains all of the specified epochs (for a > particular trial definition) in a field data.trial. Please note > that this has nothing to do with evoked vs induced responses just yet. > > You can use the output of PREPROCESSING as input to either > TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced > phenomena, respectively. Afterwards you can call various > statistical functions such as FREQDESCRIPTIVES, etc ... > > So the reason why I have been giving you the examples using > read_header and read_data is because I needed to determine the > nature of the error you were getting without really knowning > anything about what sort of data is in your file. In your use of > FT you do not actually use these functions yourself, but basically > use functions like DEFINE_TRIAL and PREPROCESSING to start with. > > ------------------------------------------------------------------------ > No need to miss a message. Get email on-the-go > > with Yahoo! Mail for Mobile. Get started. > From Daria.Osipova at FCDONDERS.RU.NL Mon Mar 19 15:47:57 2007 From: Daria.Osipova at FCDONDERS.RU.NL (Daria Osipova) Date: Mon, 19 Mar 2007 15:47:57 +0100 Subject: FW: [FIELDTRIP] .lay layout file for neuromag 306 channels Message-ID: Hi Matt Here they are. Best regards, Dasha PS Robert, wouldn't it be a good idea to include these layouts in fieldtrip? _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daria Osipova Sent: Monday, February 19, 2007 4:31 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Attached are 306-channel Neuromag layout files (also for magnetometers and gradiometers separately). Cheers, Dasha _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Christian Hesse Sent: Monday, February 19, 2007 9:19 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Sameer, please have a look at the FT (in fieldtrip/private) function "createlayout.m" (in the fieldtrip/private directory) which should be able to create a layout for your Neuromag306 data on the fly. The function takes a structure containing gradiometer information as input. If you read in your data using "preprocessing.m" then the gradiometer info will be contained in a field called data.grad. Hope this helps, Christian On 16 Feb 2007, at 21:46, Sameer Walawalkar wrote: Hi, As I had written some time ago, I could not find a .lay file which would be useful for neuromag 306 (there is a NM122.lay file there). Is there some way around this? sameer ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 19 16:30:42 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 19 Mar 2007 11:30:42 -0400 Subject: FW: [FIELDTRIP] .lay layout file for neuromag 306 channels Message-ID: Hi Dasha, Sorry,I don't see the attachment. Matt ________________________________ From: FieldTrip discussion list on behalf of Daria Osipova Sent: Mon 3/19/2007 10:47 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] FW: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Matt Here they are. Best regards, Dasha PS Robert, wouldn't it be a good idea to include these layouts in fieldtrip? _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daria Osipova Sent: Monday, February 19, 2007 4:31 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Attached are 306-channel Neuromag layout files (also for magnetometers and gradiometers separately). Cheers, Dasha _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Christian Hesse Sent: Monday, February 19, 2007 9:19 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Sameer, please have a look at the FT (in fieldtrip/private) function "createlayout.m" (in the fieldtrip/private directory) which should be able to create a layout for your Neuromag306 data on the fly. The function takes a structure containing gradiometer information as input. If you read in your data using "preprocessing.m" then the gradiometer info will be contained in a field called data.grad. Hope this helps, Christian On 16 Feb 2007, at 21:46, Sameer Walawalkar wrote: Hi, As I had written some time ago, I could not find a .lay file which would be useful for neuromag 306 (there is a NM122.lay file there). Is there some way around this? sameer ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- From Daria.Osipova at FCDONDERS.RU.NL Mon Mar 19 16:42:28 2007 From: Daria.Osipova at FCDONDERS.RU.NL (Daria Osipova) Date: Mon, 19 Mar 2007 16:42:28 +0100 Subject: MultiplotER using Neuromag lay In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB01103578@medstudent.medschool.nt.pitt.edu> Message-ID: Oops they didn't get attached Hopefully now it works -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Shtrahman, Matthew Sent: Monday, March 19, 2007 3:28 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay Hi, Can someone give me the link where I can download NM306mag.lay? Thanks, Matt -----Original Message----- From: FieldTrip discussion list on behalf of Joachim Gross Sent: Mon 3/19/2007 5:38 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay Hi Eve, I think I had a similar problem. In my case the channel labels in NM306mag.lay did not exactly match the labels in avgdata.label. After changing either set of labels it worked for me. Joachim alotof eve wrote: > Hi, Christian, > > Sorry I didn't reply this for a long time. Thanks for these > suggestions. They work well. And I found after using read_data, the > other processing still can work for whole data. > > However, I met another problem. > > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. > > Could you or other experts tell me the possible way to figure it > out? Thanks so much. > > Best, > Eve > > > */Christian Hesse /* wrote: > > Hi Eve, > >> I can use meg-pd toolbox now. However, it seems all the functions >> in FieldTrip are for evoked data while my raw data is continuous >> data. > > FieldTrip handles a variety of data, and the low level reading > functions can deal with continuous or epoch based raw data. > > When you analyze your data in FT, you usually start by defining > your trials, i.e. epochs in your continuous data that are of > interest, w.r.t. to some sort of trigger or event. The function > PREPROCESSING then scans through your raw data file and returns a > data structure which contains all of the specified epochs (for a > particular trial definition) in a field data.trial. Please note > that this has nothing to do with evoked vs induced responses just yet. > > You can use the output of PREPROCESSING as input to either > TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced > phenomena, respectively. Afterwards you can call various > statistical functions such as FREQDESCRIPTIVES, etc ... > > So the reason why I have been giving you the examples using > read_header and read_data is because I needed to determine the > nature of the error you were getting without really knowning > anything about what sort of data is in your file. In your use of > FT you do not actually use these functions yourself, but basically > use functions like DEFINE_TRIAL and PREPROCESSING to start with. > > ------------------------------------------------------------------------ > No need to miss a message. Get email on-the-go > > with Yahoo! Mail for Mobile. Get started. > -------------- next part -------------- A non-text attachment was scrubbed... Name: NM306planar.lay Type: application/octet-stream Size: 9638 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NM306mag.lay Type: application/octet-stream Size: 5027 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NM306all.lay Type: application/octet-stream Size: 14476 bytes Desc: not available URL: From c.hesse at FCDONDERS.RU.NL Mon Mar 19 17:02:38 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Mon, 19 Mar 2007 17:02:38 +0100 Subject: MultiplotER using Neuromag lay In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB01103578@medstudent.medschool.nt.pitt.edu> Message-ID: Hi Matt, you can use the function PREPARE_LAYOUT to generate a layout using the gradiometer information in your data. Regards, Christian On 19 Mar 2007, at 15:27, Shtrahman, Matthew wrote: > Hi, > > Can someone give me the link where I can download NM306mag.lay? > > Thanks, > > Matt > > > -----Original Message----- > From: FieldTrip discussion list on behalf of Joachim Gross > Sent: Mon 3/19/2007 5:38 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay > > Hi Eve, > > I think I had a similar problem. > In my case the channel labels in NM306mag.lay did not exactly match > the > labels in avgdata.label. > After changing either set of labels it worked for me. > > Joachim > > alotof eve wrote: >> Hi, Christian, >> >> Sorry I didn't reply this for a long time. Thanks for these >> suggestions. They work well. And I found after using read_data, the >> other processing still can work for whole data. >> >> However, I met another problem. >> >> After I did timelockanalysis, I tried to plot average data using >> multiplotER. I downloaded the file "NM306mag.lay" and other two you >> offered. The layoutplot(cfg) shows that the files are correct. >> However, when I used multiplotER(cfg,avgdata), the figure showed up >> was blank. Nothing on it even the lables. >> >> Could you or other experts tell me the possible way to figure it >> out? Thanks so much. >> >> Best, >> Eve >> >> >> */Christian Hesse /* wrote: >> >> Hi Eve, >> >>> I can use meg-pd toolbox now. However, it seems all the >>> functions >>> in FieldTrip are for evoked data while my raw data is continuous >>> data. >> >> FieldTrip handles a variety of data, and the low level reading >> functions can deal with continuous or epoch based raw data. >> >> When you analyze your data in FT, you usually start by defining >> your trials, i.e. epochs in your continuous data that are of >> interest, w.r.t. to some sort of trigger or event. The function >> PREPROCESSING then scans through your raw data file and returns a >> data structure which contains all of the specified epochs (for a >> particular trial definition) in a field data.trial. Please note >> that this has nothing to do with evoked vs induced responses >> just yet. >> >> You can use the output of PREPROCESSING as input to either >> TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and >> induced >> phenomena, respectively. Afterwards you can call various >> statistical functions such as FREQDESCRIPTIVES, etc ... >> >> So the reason why I have been giving you the examples using >> read_header and read_data is because I needed to determine the >> nature of the error you were getting without really knowning >> anything about what sort of data is in your file. In your use of >> FT you do not actually use these functions yourself, but >> basically >> use functions like DEFINE_TRIAL and PREPROCESSING to start with. >> >> --------------------------------------------------------------------- >> --- >> No need to miss a message. Get email on-the-go >> >> with Yahoo! Mail for Mobile. Get started. >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicola.ray at DPAG.OX.AC.UK Mon Mar 19 18:03:26 2007 From: nicola.ray at DPAG.OX.AC.UK (Niki Ray) Date: Mon, 19 Mar 2007 18:03:26 +0100 Subject: Exporting back to CTF tools Message-ID: Hi, Thank you for your previous answers re: ICA. Things are mush clearer now. I want to use the CTF tools to do a SAM analysis, but want to first run the ICA in fieldtrip. Is it possible to export data back into the format required by the CTF SAMsuite after preprocessing in fieldtrip? Thank you in advance! Niki From sameer at ANDREW.CMU.EDU Mon Mar 19 19:22:19 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 19 Mar 2007 14:22:19 -0400 Subject: frequencies of interest not assigned properly in freqanalysis Message-ID: I am trying to understand why the frequencies of interest do not seem to get assigned properly as shown below. cfgPre = ouput: 'powandcsd' method: 'mtmfft' keeptrials: 'no' tapsmofrq: 4 foilim: [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100] channel: 'MEG' channelcmb: {'MEG' 'MEG'} freqPreRR = freqanalysis(cfgPre,dataRRpre_One); freqPreRR = label: {306x1 cell} dimord: 'chan_freq' freq: [5.9880 7.9840 9.9800] powspctrm: [306x3 double] labelcmb: {46665x2 cell} crsspctrm: [46665x3 double] grad: [1x1 struct] cfg: [1x1 struct] thanks, sameer From ingrid.nieuwenhuis at FCDONDERS.RU.NL Mon Mar 19 19:49:30 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Mon, 19 Mar 2007 19:49:30 +0100 Subject: frequencies of interest not assigned properly in freqanalysis In-Reply-To: Message-ID: Hi Sameer, The frequency resolution with mtmfft depends on the length of your trials. Cfg.foilim should be only two numbers, the lower and upper boundary of the frequency. It seems as if you are confusing mtmconvol and mtmfft. In mtmconvol you can specify the cfg.foi as a vector with more than 2 frequencies. See the help information of these both functions. Hopes this helps you along, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Monday, March 19, 2007 7:22 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] frequencies of interest not assigned properly in freqanalysis I am trying to understand why the frequencies of interest do not seem to get assigned properly as shown below. cfgPre = ouput: 'powandcsd' method: 'mtmfft' keeptrials: 'no' tapsmofrq: 4 foilim: [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100] channel: 'MEG' channelcmb: {'MEG' 'MEG'} freqPreRR = freqanalysis(cfgPre,dataRRpre_One); freqPreRR = label: {306x1 cell} dimord: 'chan_freq' freq: [5.9880 7.9840 9.9800] powspctrm: [306x3 double] labelcmb: {46665x2 cell} crsspctrm: [46665x3 double] grad: [1x1 struct] cfg: [1x1 struct] thanks, sameer From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:22:55 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:22:55 +0100 Subject: write_tri.m file and results from volplot In-Reply-To: <6.1.2.0.2.20070312180158.05005420@email.med.yale.edu> Message-ID: On 12 Mar 2007, at 23:12, Brian Roach wrote: > To construct a headmodel for EEG source analysis. I have attached > the result from a call to: > > volplot(skin+skull+brain); I am new to this, and wonder how to > judge the success of this script in creating a new model. What > kinds of things do I want to see in this plot, or the volplot of > the skin, skull, or brain, individually? The example script says > that it requires a lot of trial and error, so I am assuming that > just running that script is not all that is necessary, but I do not > know. Hi Brian The segmentation in your figure looks fine to me. There are three tissue types visible at the locatins where you expect them, and the boundaries between the tissue types are also well defined and smooth. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:28:41 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:28:41 +0100 Subject: first steps using lcmv In-Reply-To: <8A3F5CCB-C26C-46E7-BE2C-22CF761817E0@lyon.inserm.fr> Message-ID: Hi Nathan On 7 Mar 2007, at 18:08, Nathan Weisz wrote: > i found a standard bem in the dipfit plugin folder of eeglab > (standard_vol.mat). > > >> vol > > vol = > > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > mat: [3000x3000 double] > type: 'dipoli' > > i guess that i can simply exchange my standard spherical model > (same as in eeglab) and use this bem volume for calculating the > leadfield. Yes, that volume conduction model is fine. > one aspect are the electrode locations: the positions are given on > a sphere ... so probably there'll has to be some transformation of > the positions. There should be EEG electrode locations for the 10-20, the 10-10 and the 10-5 system with the EEGLAB-dipfit release as well. If not, please use attached electrode file. It should match the BEM model. You can check the match with HEADMODELPLOT. you can do elec = read_fcdc_elec('standard_1005.elc'); and then cfg.elec = elec; or alternatively cfg.elecfile = 'standard_1005.elc'; in sourceanalysis. best Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: standard_1005.elc Type: application/octet-stream Size: 11176 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:40:58 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:40:58 +0100 Subject: Exporting back to CTF tools In-Reply-To: Message-ID: Hi Niki On 19 Mar 2007, at 18:03, Niki Ray wrote: > I want to use the CTF tools to do a SAM analysis, but want to > first run > the ICA in fieldtrip. Is it possible to export data back into the > format > required by the CTF SAMsuite after preprocessing in fieldtrip? We do not have tools to write CTF data. However, the CTF meg4 format is very simple. As long as you apply the same (inverse) amplitude calibration and convert the double data back to int32, it should be possible to insert the processed values back into a CTF meg4 file. You can have a look at fieldtrip/private/read_ctf_meg4.m and try to reverse-engineer the reading function. The code looks more complex than it is, that is due to the multi-file handling (files cannot be larger than 2GB). If I recall correctly, the meg4 file consists of a 8 byte header, followed by blocks of data. Each block is hdr.nSamples*hdr.nChans*4 butes large. Within a block the data is not multiplexed, but instead one channel after the other. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:58:57 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:58:57 +0100 Subject: cross spectral density issues In-Reply-To: Message-ID: Hi Sameer, On 19 Mar 2007, at 14:26, Sameer Walawalkar wrote: > When I do > > cfgCSD = []; > cfgCSD.output = 'powandcsd'; > cfgCSD.method = 'mtmfft'; > cfgCSD.foilim = [5 100]; > cfgCSD.tapsmofrq = 5; > cfgCSD.keeptrials = 'yes'; > cfgCSD.channel = {'MEG'} ; > cfgCSD.channelcmb = {'MEG' 'MEG'}; > freqCSD_RR_One = freqanalysis(cfgCSD,dataRR_One); > > I get the following error. > > ??? Error using ==> unknown > Maximum variable size allowed by the program is exceeded. > > Error in ==> freqanalysis_mtmfft at 342 > if csdflg, crsspctrm = complex(zeros > (numper,numsgncmb,numboi)); end How large is the matrix that you are trying to allocate? I.e. how large is Ntrials times (Nchans^2)/2 times the number of frequency bins? The number of frequency bins depends on the data, specifically on the length of your trials. For 1-sec trials, you have one frequency bin per Herz, for 2-sec trials you have two, etc. The total amount of memory is the number of elements in the matrix times 16 bytes (since each matrix element has a double precision real and imaginary number). > Error in ==> freqanalysis at 167 > [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, > data); > > > But I remember using something very close to this some ten days > ago. So I am not sure what I might be doing wrong. Any suggestions > are very welcome. You may have used fewer frequency bins (cfg.foilim) or the data may have had fewer trials. > I tried using method 'mtmwelch' but that gave a host of other > errors including looking for cfg.foi instead of cfg.foilim (non > uniformity in application). Please look at the documentation in FREQANALYSIS_MTMWELCH. I suspect that the mtmwelch method will require even more memory. Are you sure with the amount of data that you have that you want to keep trials? Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 22:12:29 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 22:12:29 +0100 Subject: MNI aligned grids, mris and segmentation In-Reply-To: Message-ID: Hi Sameer On 13 Mar 2007, at 15:27, Sameer Walawalkar wrote: > I want to start DICS analysis of my MEG data. For this I need to > have MRI and MEG data coregistered. I also need multisphere forward > models for which segmentation is necessary. > > Am I correct in understanding that the following webpage contains > info about segmentation? (in addition to MNI aligning all grids) > > From (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:create_single- > subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_spa > ce) I suggest that you also look at http://www2.ru.nl/fcdonders/fieldtrip/ doku.php? id=fieldtrip:documentation:make_leadfields_using_different_headmodels > Here, in the very beginning, > ... > I understand that in the commands above, first we are creating a > template mri to which all other grids will later be aligned. What > exactly is t1_icbm_normal_1mm_pn0_rf0.mnc ? Is it a slice from an > mri image. The idea here is to use an existing template MRI to construct a headmodel, and define a dipole grid in it. Then, each individual MRI is warped to the template MRI, and the inverse of that warp is applied to the dipole grid. Subsequently, an individual headmodel is made for each individual MRI and the warped dipole grid (in individual subjects' coordinates) is used together with the individual headmodel for the beaming. The source reconstructions are computed, and can immediately be averaged over subjects. The underlying motivation relates to group statistics without the neccessity to interpolate the source reconstructions to an artifical higher resolution. Since you are just starting with beamforming, I advice that you do not immediately try to follow the "MNI common grids" approach. Better is first to explore some single subject beamed data. > Can I give the path to my dicom mri images directory and the name > of a file ending in .dcm? > > Incidently >>> mri = > read_fcdc_mri('Z:\KarmaCond\BIRC_images_foolaround\070207134421\2 > \02-0001-000001.dcm'); > ??? Undefined function or variable "hdr". > > Error in ==> read_fcdc_mri at 179 > [z, indx] = sort(cell2mat({hdr.SliceLocation})); If you have the image processing toolbox, you should be able to read in a set of DICOM files. Note that the homogenous transformation matrix then is not yet correct, i.e. the slice resolution and spacing and the coordinate axes are not yet specified. Figuring the slice ordering from a set of loose dicom files is tricky. I think that the naming of your dicom files differs from ours, we have a directory containing files like this: ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.92.2003.7.31.11.19.16.578000.53834891.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.93.2003.7.31.11.19.16.578000.53834906.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.94.2003.7.31.11.19.16.578000.53834921.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.95.2003.7.31.11.19.16.578000.53834936.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.96.2003.7.31.11.19.16.578000.53834951.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.97.2003.7.31.11.19.16.578000.53834966.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.98.2003.7.31.11.19.16.15000.53831961.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.99.2003.7.31.11.19.16.15000.53831976.IMA The detection of the correct dcm files in your directory seems not to work. I suggest that you set a debugger breakpoint in read_fcdc_mri and that you step through it one line at a time. best regards, Robert From sghosh at HSS.IITD.AC.IN Tue Mar 20 09:37:42 2007 From: sghosh at HSS.IITD.AC.IN (Shantanu Ghosh) Date: Tue, 20 Mar 2007 09:37:42 +0100 Subject: Datastructure inclusion Message-ID: Hi Christian It took me sometime to figure out the dtaformat, so I prepared the format like this using a .MAT file and some synthetic data like this data = []; data.fsample = 115.3402; data.label = {'FP1'; 'FP2'; 'Fz'; %presently using only 3 channels %'F3'; 'F4'; 'F7'; 'F8'; ... %'T3'; 'T4'; 'T5'; 'T6';... %'P3'; 'P4'; 'Pz'; 'O1'; 'O2'; 'Oz';... %'C3'; 'C4'; 'Cz'; 'A1'; 'A2'; 'EKG'}; data.nTrial=3; trial1 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];% other channel data to be added here trial2 = [[2.9;2.2;2.3;2.4;2.2],[7.5;7.9;7.8;7.2;7.1],[1.5;1.9;1.8;1.2;1.1]];%sllrly, other channel data to be added here trial3 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];% sllrly,other channel data to be added here time1 = [1,2,3,4,5];%and here time2 = [.1,.2,.3,.4,.5];%and here time3 = [1,2,3,4,5];%and here %Is there another way to do this as the same time axis is there for all channels? data.trial = cell(data.nTrial,1); data.trial{1,1} = trial1 ; data.trial{2,1} = trial2 ; data.trial{3,1} = trial3 ; data.time = cell(data.nTrial,1) ; data.time{1,1} = time1; data.time{2,1} = time2; data.time{3,1} = time3; data Gives the output data = fsample: 115.3402 label: {23x1 cell} nTrial: 3 trial: {3x1 cell} time: {3x1 cell} If this is ok, then why am I getting error when I run it for FT? >> read_fcdc_data(data); ??? Function 'exist' is not defined for values of class 'struct'. Error in ==> exist at 41 [varargout{1:nargout}] = builtin('exist', varargin{:}); Error in ==> fieldtrip\private\read_data at 70 if ~exist(filename) Error in ==> read_fcdc_data at 49 [dat] = read_data(varargin{:}); -------------- next part -------------- data = []; data.fsample = 115.3402; data.label = {'FP1'; 'FP2'; 'Fz'; % 'F3'; 'F4'; 'F7'; 'F8'; ... % 'T3'; 'T4'; 'T5'; 'T6';... % 'P3'; 'P4'; 'Pz'; 'O1'; 'O2'; 'Oz';...\exp1\myDataStructure % 'C3'; 'C4'; 'Cz'; 'A1'; 'A2'; 'EKG'}; data.nTrial=3; trial1 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];%...other channels to be added here trial2 = [[2.9;2.2;2.3;2.4;2.2],[7.5;7.9;7.8;7.2;7.1],[1.5;1.9;1.8;1.2;1.1]];%...other channels to be added here trial3 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];%...other channels to be added here time1 = [1,2,3,4,5]; time2 = [.1,.2,.3,.4,.5]; time3 = [1,2,3,4,5]; data.trial = cell(data.nTrial,1); data.trial{1,1} = trial1 ; data.trial{2,1} = trial2 ; data.trial{3,1} = trial3 ; data.time = cell(data.nTrial,1) ; data.time{1,1} = time1; data.time{2,1} = time2; data.time{3,1} = time3; data From c.hesse at FCDONDERS.RU.NL Tue Mar 20 10:59:27 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 20 Mar 2007 10:59:27 +0100 Subject: Neuromag layouts Message-ID: Dear Neuromag Users, to facilitate (any kind of) topographical plotting of your 122 or 306 channel MEG data, fieldtrip now includes (or at least will from the next daily update this evening 22:00 CET) several *.lay files for Neuromag systems. If the labels in your data do not match the labels any of the layout files, then you can readily generate your own layout using the function PREPARE_LAYOUT which requires an input data structure containing a field with gradiometer information, e.g., your data header or the data output from PREPROCESSING. (Note that this function can handle channel labels with and without spaces between the "MEG" and "number" tokens of the label string.) You can check whether the layout is correct using the function LAYOUTPLOT Hope you find this helpful Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 20 12:12:42 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 20 Mar 2007 12:12:42 +0100 Subject: Data structur In-Reply-To: <1416.10.100.2.68.1174375806.squirrel@www.iitd.ac.in> Message-ID: Hi Shantanu, > It took me sometime to figure out the dtaformat, so I prepared the > format > like this using a .MAT file and some synthetic data like this > > data = []; > data.fsample = 115.3402; > data.label = {'FP1'; 'FP2'; 'Fz'; %presently using only 3 channels > %'F3'; 'F4'; 'F7'; 'F8'; ... > %'T3'; 'T4'; 'T5'; 'T6';... > %'P3'; 'P4'; 'Pz'; 'O1'; 'O2'; 'Oz';... > %'C3'; 'C4'; 'Cz'; 'A1'; 'A2'; 'EKG'}; > > data.nTrial=3; > > trial1 = > [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];% > other channel data to be added here > trial2 = > [[2.9;2.2;2.3;2.4;2.2],[7.5;7.9;7.8;7.2;7.1],[1.5;1.9;1.8;1.2;1.1]]; > %sllrly, > other channel data to be added here > trial3 = > [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]]; > %sllrly,other > channel data to be added here > > time1 = [1,2,3,4,5];%and here > time2 = [.1,.2,.3,.4,.5];%and here > time3 = [1,2,3,4,5];%and here > > %Is there another way to do this as the same time axis is there for > all > channels? The FT data structure assumes that there is one time axis for each trial which is the same for all channels. In your case it may even be the same time axis on all trials, however, this is a) not the general case and b) a trial time axis is required later on for averaging and spectral analysis to make sure the data epochs on different trials are correctly aligned over trials. > > data.trial = cell(data.nTrial,1); > > data.trial{1,1} = trial1 ; > data.trial{2,1} = trial2 ; > data.trial{3,1} = trial3 ; > > data.time = cell(data.nTrial,1) ; > > data.time{1,1} = time1; > data.time{2,1} = time2; > data.time{3,1} = time3; > > data > > > Gives the output > > data = > > fsample: 115.3402 > label: {23x1 cell} > nTrial: 3 > trial: {3x1 cell} > time: {3x1 cell} This is the correct format (except that in FT there is no "nTrial" field); > If this is ok, then why am I getting error when I run it for FT? > >>> read_fcdc_data(data); > ??? Function 'exist' is not defined for values of class 'struct'. > > Error in ==> exist at 41 > [varargout{1:nargout}] = builtin('exist', varargin{:}); > > Error in ==> fieldtrip\private\read_data at 70 > if ~exist(filename) > > Error in ==> read_fcdc_data at 49 > [dat] = read_data(varargin{:}); If you look at the function definition (interface) for READ_FCDC_DATA you will see that it expects a sting argument (i.e. a filename) as input since it is used to read data from data files with known format. The error is generated because Matlab is trying to determine whether your input "data" refers to an existing file in the system, which of course it does not. Since the data format you are using is not known to FT, you cannot use any of the READ_FCDC_XXXX (or lower level) functions. Instead, you have to read your data into an FT data structure yourself, as you now seem to have done successfully. Once you have the data structure, you just pass it to the different analysis functions like TIMELOCKANALYSIS or FREQANALYSIS. I hope this helps, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ychen at BME.UFL.EDU Tue Mar 20 15:32:19 2007 From: ychen at BME.UFL.EDU (Chen) Date: Tue, 20 Mar 2007 15:32:19 +0100 Subject: weird result for EEG visual N1 source localization using lcmv Message-ID: Hi, I am doing source localization on EEG biosemi 128 channels recordings and get weird result. I am giving the details in the following to seek any help: KrisS = eeglab2fieldtrip(EEG,'preprocessing'); cfg=[]; cfg.latency=[.08 .12]; %latency of N1 cfg.covariancewindow=[.08 .12]; cfg.covariance='yes'; cfg.keeptrials='no'; datTest=timelockanalysis(cfg,KrisS); clear KrisS cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 5; figure(1);topoplotER(cfg,datTest); datTest.elec.pnt = 1000 * datTest.elec.pnt*[0 -1 0; 1 0 0;0 0 1]; %convert electrode coordinates from m to mm and make the x go to nose load standard_vol.mat %use standard BEM vol from EEGLAB load standard_mri.mat %use standard mri from EEGLAB cfg=[]; cfg.vol=vol; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; [grid] = prepare_leadfield(cfg, datTest); cfg=[]; cfg.grid=source2sparse(grid); cfg.method='lcmv'; cfg.vol=vol; cfg.projectnoise='yes'; cfg.lambda=1; [sourceN1] = sourceanalysis(cfg, datTest); cfg=[]; cfg.powmethod='none'; %only option that works [sourcenai] = sourcedescriptives(cfg, sourceN1); cfg =[]; cfg.downsample = 2; cfg.funparameter = 'nai';%or neural activity indes (nai) sourceN1F=source2full(sourcenai); [interp]=sourceinterpolate(cfg,sourceN1F,mri); figure(3);sliceinterp(cfg,interp) I have the following specific questions: 1. Should the units all be mm? 2. Is my coordinate rotation right? 3. How to choose the value of lambda? I just randomly choose 1 now since without lamda I always get warnings of rank-deficient and divided by zeros. 4. Since I am using the standard BEM and mri, my electrodes are not on the skin( see the attached figure), when I try to realign based on fiducials, it is still the same. I check the function of electroderealign and find out that norm.m is always identy matrix which make the realign doing nothing. Why? Appreciate to point out what I am wrong. Chen -------------- next part -------------- A non-text attachment was scrubbed... Name: TopoN1.jpg Type: image/pjpeg Size: 43181 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1source.jpg Type: image/pjpeg Size: 32703 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ElecHead.jpg Type: image/pjpeg Size: 36116 bytes Desc: not available URL: From sameer at ANDREW.CMU.EDU Tue Mar 20 19:10:36 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 20 Mar 2007 14:10:36 -0400 Subject: MNI aligned grids, mris and segmentation In-Reply-To: Message-ID: Dear Robert, Thank you for your reply to my question about (MNI aligned grids, MRIs and segmentation). I am going to take your advise of exploring single subject beamed data. But, I want to clarify one or two points before going on. I am using Neuromag 306 data. Or the MRIs, I have already used MNE to generate bem head model meshes stored in files of kind _bem_sol.fif, but which fieldtrip program do I use to extract this (the info is for ctf and I could not find an intuitive or obvious extension to my case). Can I simply proceed as bem_head = appropriate-field-trip-function(_bem_sol.fif); hdr = read_fcdc_header(datafile.fif); cfg = []; cfg.grad = hdr.grad; cfg.vol = bem_head; cfg.resolution = 1; grid_bem = prepare_leadfield(cfg); Also am not sure how to extract head shape which is needed for plotting headmodel. Is it shimply the HPI coils information ? thanks for your time. sameer On Mon, 19 Mar 2007, Robert Oostenveld wrote: > Hi Sameer > > On 13 Mar 2007, at 15:27, Sameer Walawalkar wrote: >> I want to start DICS analysis of my MEG data. For this I need to have MRI >> and MEG data coregistered. I also need multisphere forward models for which >> segmentation is necessary. >> >> Am I correct in understanding that the following webpage contains info >> about segmentation? (in addition to MNI aligning all grids) >> >> From (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? >> id=fieldtrip:documentation:create_single- >> subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) > > I suggest that you also look at http://www2.ru.nl/fcdonders/fieldtrip/ > doku.php? > id=fieldtrip:documentation:make_leadfields_using_different_headmodels > >> Here, in the very beginning, >> ... >> I understand that in the commands above, first we are creating a template >> mri to which all other grids will later be aligned. What exactly is >> t1_icbm_normal_1mm_pn0_rf0.mnc ? Is it a slice from an mri image. > > The idea here is to use an existing template MRI to construct a headmodel, > and define a dipole grid in it. Then, each individual MRI is warped to the > template MRI, and the inverse of that warp is applied to the dipole grid. > Subsequently, an individual headmodel is made for each individual MRI and the > warped dipole grid (in individual subjects' coordinates) is used together > with the individual headmodel for the beaming. The source reconstructions are > computed, and can immediately be averaged over subjects. The underlying > motivation relates to group statistics without the neccessity to interpolate > the source reconstructions to an artifical higher resolution. > > Since you are just starting with beamforming, I advice that you do not > immediately try to follow the "MNI common grids" approach. Better is first to > explore some single subject beamed data. > >> Can I give the path to my dicom mri images directory and the name of a file >> ending in .dcm? >> >> Incidently >>>> mri = >> read_fcdc_mri('Z:\KarmaCond\BIRC_images_foolaround\070207134421\2 >> \02-0001-000001.dcm'); >> ??? Undefined function or variable "hdr". >> >> Error in ==> read_fcdc_mri at 179 >> [z, indx] = sort(cell2mat({hdr.SliceLocation})); > > If you have the image processing toolbox, you should be able to read in a set > of DICOM files. Note that the homogenous transformation matrix then is not > yet correct, i.e. the slice resolution and spacing and the coordinate axes > are not yet specified. Figuring the slice ordering from a set of loose dicom > files is tricky. I think that the naming of your dicom files differs from > ours, we have a directory containing files like this: > > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.92.2003.7.31.11.19.16.578000.53834891.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.93.2003.7.31.11.19.16.578000.53834906.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.94.2003.7.31.11.19.16.578000.53834921.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.95.2003.7.31.11.19.16.578000.53834936.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.96.2003.7.31.11.19.16.578000.53834951.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.97.2003.7.31.11.19.16.578000.53834966.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.98.2003.7.31.11.19.16.15000.53831961.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.99.2003.7.31.11.19.16.15000.53831976.IMA > > The detection of the correct dcm files in your directory seems not to work. I > suggest that you set a debugger breakpoint in read_fcdc_mri and that you step > through it one line at a time. > > best regards, > Robert > From h.stoegbauer at GMAIL.COM Wed Mar 21 00:02:59 2007 From: h.stoegbauer at GMAIL.COM (Harald Stoegbauer) Date: Tue, 20 Mar 2007 16:02:59 -0700 Subject: timelockstatistics Message-ID: Hi FieldTrippers, Exist there any example code for the 'timelockstatistics' function ? Thanks, Harald -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Wed Mar 21 07:03:23 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Wed, 21 Mar 2007 07:03:23 +0100 Subject: timelockstatistics In-Reply-To: Message-ID: Dear Harald, Exist there any example code for the 'timelockstatistics' function ? Not yet, but we are working on it. To get started, you could make use of the clusterrandanalysis-tutorial and combine this with the help-information from timelockstatistics. Clusterrandanalysis is the predecessor of timelock-, freq-, and sourcestatistics. Good luck, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulla.rantakokko at TKK.FI Wed Mar 21 09:41:45 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Wed, 21 Mar 2007 10:41:45 +0200 Subject: TFR:boundaries, resolution Message-ID: Hi everyone, 1. Is there a way to get rid of boundary effects for low frequencies. The boundary is moving but it is not disappearing. 2. The output is very grainy i.e. so called pixels are big and sharp edged even with as high tapsmofrq as is possible with available memory. Is there a way to make the output prettier ? 3. TopoplotTFR is not functioning. It only draws a blank figure. MultiplotTFR and singleplotTFR function perfectly. I use .grad generated layout for 306 channel Neuromag. Thanks Ulla From muthuraman10 at HOTMAIL.COM Wed Mar 21 11:02:55 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Wed, 21 Mar 2007 10:02:55 +0000 Subject: Sliceinterp-Sourceplot! Message-ID: Hello Fieldtrippers, I have attached two plots with this mail, one is sliceinterp and the other is the source plot of the same data with MRI taken from the fieldtrip 'subject01.mri' In the sourceplot i do not get the anatomical information, according to the fieldtrip documentation need to interpolate the functional data with the anatomical data by sourceinterpolate.m and then is the configuration for the source plot then i get the error cfg.method='ortho'; cfg.slicedim=3; cfg.anaparamter= 'anatomy'; cfg.funparameter='coh'; cfg.maskparameter='coh'; sourceplot(cfg,interp); I get the error ??? Error using ==> reshape To RESHAPE the number of elements must not change. Error in ==> sourceplot at 409 if hasana, ana = reshape(ana, dim); end; Any suggestions on this will be appreciated Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It�s cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in -------------- next part -------------- A non-text attachment was scrubbed... Name: sliceinterp.jpg Type: image/jpeg Size: 43669 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sourceplot.jpg Type: image/jpeg Size: 35027 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Wed Mar 21 12:44:12 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 21 Mar 2007 12:44:12 +0100 Subject: Sliceinterp-Sourceplot! In-Reply-To: Message-ID: On 21 Mar 2007, at 11:02, Muthuraman Muthuraman wrote: > I get the error > > ??? Error using ==> reshape > To RESHAPE the number of elements must not change. > > Error in ==> sourceplot at 409 > if hasana, ana = reshape(ana, dim); end; > > Any suggestions on this will be appreciated You seem to have constructed an interpolated source reconstruction in which the anatomy and the functional data are not on the same grid of voxels. What is the cfg and the output of sourceinterpolate? Robert From muthuraman10 at HOTMAIL.COM Wed Mar 21 13:04:40 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Wed, 21 Mar 2007 12:04:40 +0000 Subject: Sliceinterp-Sourceplot! In-Reply-To: <8F94F951-2872-456B-A9E3-CB5E07FB15C8@fcdonders.ru.nl> Message-ID: Hello Dr.Robert, Thankyou for the immediate reply, the cfg structure of the sourceinterpolate [mri] = read_fcdc_mri('Subject01.mri') dim: [256 256 256] anatomy: [256x256x256 uint16] hdr: [1x1 struct] transform: [4x4 double] cfg.downsample=4; [interp] = sourceinterpolate(cfg, source1, mri) and the output of sourceinterpolate avg: [1x1 struct] inside: [64x64x64 logical] dim: [64 64 64] transform: [4x4 double] anatomy: [64x64x64 uint16] cfg: [1x1 struct] Thanking you With regards M.Muthuraman. _________________________________________________________________ Sign in and get updated on all the action from Formula One http://content.msn.co.in/Sports/FormulaOne/Default From r.oostenveld at FCDONDERS.RU.NL Wed Mar 21 13:37:39 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 21 Mar 2007 13:37:39 +0100 Subject: MNI aligned grids, mris and segmentation In-Reply-To: Message-ID: On 20 Mar 2007, at 19:10, Sameer Walawalkar wrote: > I am using Neuromag 306 data. Or the MRIs, I have already used MNE > to generate bem head model meshes stored in files of kind > _bem_sol.fif, but which fieldtrip program do I use to > extract this (the info is for ctf and I could not find an intuitive > or obvious extension to my case). > > Can I simply proceed as You can use neuromag BEM models, but that requires a licensed copy of the meg-calc toolbox (which contans some mex files that are then called by fieldtrip). > bem_head = appropriate-field-trip-function(_bem_sol.fif); > hdr = read_fcdc_header(datafile.fif); > > cfg = []; > cfg.grad = hdr.grad; instead of cfg.grad please specify cfg.gradfile='datafile.fif', since has to be interpreted by the neuromag mex files. > cfg.vol = bem_head; instead of reading the model with appropriate-field-trip-function() you should specify the file that contains the model. That is done with cfg.hdmfile. The neuromag mex file will then "initialize" with the model in the fif file. > cfg.resolution = 1; > grid_bem = prepare_leadfield(cfg); Then the remainder should in principle work. I have not been able to test it exhaustivelym since I do not have a license for the neuromag meg-calc toolbox. > Also am not sure how to extract head shape which is needed for > plotting headmodel. Is it shimply the HPI coils information ? The head shape is the triangulated boundary. That boundary will be read from the fif file at the appropriate time (e.g. in headmodelplot). Actually, the initialization of the neuromag mex files and reading of the triangulation is done in private/ prepare_vol_sens. I suggest you look in that function and search for 'neuromag_fif'. hope this helps, Robert PS you can also use other head models, such as single and multiple spheres and a analytic realistic single-shell model. Those are all implemneted in plain Matlab. From r.oostenveld at FCDONDERS.RU.NL Wed Mar 21 13:40:27 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 21 Mar 2007 13:40:27 +0100 Subject: Sliceinterp-Sourceplot! In-Reply-To: Message-ID: On 21 Mar 2007, at 13:04, Muthuraman Muthuraman wrote: > cfg.downsample=4; > [interp] = sourceinterpolate(cfg, source1, mri) > > and the output of sourceinterpolate > > avg: [1x1 struct] > inside: [64x64x64 logical] > dim: [64 64 64] > transform: [4x4 double] > anatomy: [64x64x64 uint16] > cfg: [1x1 struct] What is in interp.avg? I would expect it to contain interp.avg.pow [64x64x64 double] interp.avg.nai [64x64x64 double] If that is the case, then sourceplot should just work and not complain about different dimensions. Robert From c.hesse at FCDONDERS.RU.NL Wed Mar 21 15:43:52 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 21 Mar 2007 15:43:52 +0100 Subject: TFR:boundaries, resolution In-Reply-To: <20070321104145.g0i8xwoj4sok0s8c@webmail1.tkk.fi> Message-ID: Hi Ulla, > 1. Is there a way to get rid of boundary effects for low > frequencies. The boundary is moving but it is not disappearing. You can't get rid of boundary effects as such. However, you could use a longer window in your time-frequency analysis and then only plot the part of the window without the edge effects. > 2. The output is very grainy i.e. so called pixels are big and > sharp edged even with as high tapsmofrq as is possible with > available memory. Is there a way to make the output prettier ? The "pixels" are partly determined by the size of the time-frequency tiles (whose and their size is determined by the width of your time- window and frequency band at each point in your TFR) and the degree of overlap between the tiles. If you want to make things look "smoother" then you could try increasing the time resolution (spacing between windows) and the temporal smoothing (size of each window), and do the same for the frequency axis. > 3. TopoplotTFR is not functioning. It only draws a blank figure. > MultiplotTFR and singleplotTFR function perfectly. I use .grad > generated layout for 306 channel Neuromag. I have made a small change to the function PREPARE_LAYOUT which should fix the problem in TOPOPLOTTFR. The new version will be available with the daily update this evening at approximately 22:00 CET (and is also attached). The layout stuff has been undergoing some changes recently, and at present there does not really seem to be an appropriate way of passing a "pre-prepared, grad-generated" layout structure to the plotting functions. Currently, provided the gradiometer information is either in cfg.grad or in dat.grad, the plotting functions will automatically generate a layout structure using lay = prepare_layout (cfg, dat) every time they are called. As a sort of compromise, you are (for the time being at least) allowed to put the pre-computed layout structure in cfg.layout, when you call TOPOPLOTTFR and it should work. In the future, I expect that an additional field for pre-computed layout structures might be added at some point. Regards, Christian  ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: prepare_layout.m.zip Type: application/zip Size: 3721 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Wed Mar 21 21:39:32 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 21 Mar 2007 21:39:32 +0100 Subject: importing BESA *.tfc files Message-ID: When using besa2fieldtrip on a *.tfc file I get the following errors in Matlab: ??? Error using ==> colon First and last colon operands must be char. Error in ==> fieldtrip-20070320\private\read_besa_tfc at 77 Time = [TimeStartInMS:TimeIntervalInMS:(NumberTimeSamples-1)*TimeIntervalInMS+TimeStartInMS]; Error in ==> besa2fieldtrip at 140 [ChannelLabels, Time, Frequency, Data, Info] = read_besa_tfc(filename); any suggestions? An example file is attached. Thanks andy -------------- next part -------------- A non-text attachment was scrubbed... Name: Coercion_01_ERA.tfc Type: application/octet-stream Size: 27561 bytes Desc: not available URL: From h.stoegbauer at GMAIL.COM Thu Mar 22 06:09:56 2007 From: h.stoegbauer at GMAIL.COM (Harald Stoegbauer) Date: Wed, 21 Mar 2007 22:09:56 -0700 Subject: timelockstatistics In-Reply-To: <007a01c76b7e$a24b6590$6501a8c0@fcdonders.nl> Message-ID: Dear Eric, Looking forward to get an example code, at the moment I tried to use "Clusterrandanalysis" as guideline. It was hard to guess all the necessary cfg settings, particular ' cfg.correctm' and 'cfg.design' are not listed in the index. In the end it was running but I don't know how to interpret/plot the output (looks quiet different to 'Clusterrandanalysis'). Would be thankful about any short example. A short additional question, it is also possible to make a 'normal' ttest on a particular time window of an ordinary VEP-ERP ? Thanks, Harald On 3/20/07, Eric Maris wrote: > > Dear Harald, > > > > > > Exist there any example code for the 'timelockstatistics' function ? > > Not yet, but we are working on it. To get started, you could make use of > the clusterrandanalysis-tutorial and combine this with the help-information > from timelockstatistics. Clusterrandanalysis is the predecessor of > timelock-, freq-, and sourcestatistics. > > > > Good luck, > > > > Eric > > > > > -- -------------------------------- Harald Stoegbauer, PhD 1200 E. California Blvd CALTECH - Mail code 114-96 Pasadena, CA 91125 Phone: +1-626-395-8959 -------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Mar 22 09:49:57 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Mar 2007 09:49:57 +0100 Subject: timelockstatistics In-Reply-To: <5bbfdea0703212209k1b4c9149wc19daa37767872c5@mail.gmail.com> Message-ID: On 22 Mar 2007, at 6:09, Harald Stoegbauer wrote: > A short additional question, it is also possible to make a 'normal' > ttest on a particular time window of an ordinary VEP-ERP ? TIMELOCKSTATISTICS (idem for freq/source) allows you to do conventional tests as well. Instead of cfg.method = 'montecarlo' % since the p-value is a monte- carlo estimate cfg.correctm = 'cluster' you would specify cfg.method = 'analytic' % since it is an analytic p- value that will be computed cfg.correctm = 'no' % or bonferoni, fdr, holms The cfg.statistic is the same, just as the cfg.design matrix. The choises that you have for multiple-comparison correction are different. See the help of STATISTICS_ANALYTIC for more details. best Robert From ulla.rantakokko at TKK.FI Thu Mar 22 10:10:02 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Thu, 22 Mar 2007 10:10:02 +0100 Subject: TFR:boundaries, resolution Message-ID: Thanks Christian, 1. & 2. Ok. I haven't succeeded well with multitapers because of memory problems. For some reason 'wltconvol' is also impossible for the same reason but this far 'tfr' works well (?) which is a little suprizing . I can get this far singleplot only. 3. I found the new layout files the minute I sent the mail... However, I get >> multiplotTFR(cfg, TFRmult_th_ad); ??? Undefined function or variable "Lbl". Error in ==> fieldtrip-20070226/private/createlayout at 244 if ~any(strcmp('COMNT', Lbl)) Error in ==> multiplotTFR at 234 lay = createlayout(cfg.layout); .................... even though the neuromag data is recognized well. 4. A new idea to reduce the length of trial and thus get better pictures is to separate baseline from the data-trials to one baseline set. How can I relate the baseline with the data as whole information and not just time limits. Am I making myself clear ? Best regs Ulla From c.hesse at FCDONDERS.RU.NL Thu Mar 22 10:40:38 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Thu, 22 Mar 2007 10:40:38 +0100 Subject: TFR:boundaries, resolution In-Reply-To: Message-ID: Hi Ulla, On 22 Mar 2007, at 10:10, Ulla Rantakokko wrote: > Thanks Christian, > > 1. & 2. Ok. I haven't succeeded well with multitapers because of > memory > problems. For some reason 'wltconvol' is also impossible for the > same reason > but this far 'tfr' works well (?) which is a little suprizing . I > can get > this far singleplot only. Using multitapers is not really equally appropriate at all frequencies, and especially not recommended at the "lower" frequencies (say below 20 Hz). I guess it would be fair to say that multitapers are most useful for "pulling out" activity in the high gamma bands (> 60Hz). At frequencies below 40 Hz, I would just use a hanning window and specify the time frequency tiles using cfg = []; cfg.method = 'mtmconvol'; cfg.output = 'pow'; cfg.taper = 'hanning'; cfg.foi = [fbeg:fshift:fend]; cfg.toi = [tbeg:tshift:tend]; cfg.f_timwin = ones(max(size(cfg.foi)),1).*twin; these cfg options essentially give you a "classic" spectrogram which (in my opinion) should be the first step in any time frequency analysis before using more "advanced" techniques such as wavelets or multitapers (both of which, by the way, are much greedier in terms of memory and computation time than the spectrogram). Depending on the goals of your analysis and the frequency range of interest, there may also simply not be sufficient motivation to use either wavelets or multitapers at all. In any event, in the above cfg options, twin is the width of your time window in seconds, and the rest is probably self explanatory. You can also adjust cfg.f_timwin to have different lengths for different frequencies if you wish. With the current settings you should have less problems with running out of memory. > I found the new layout files the minute I sent the mail... However, > I get > >>> multiplotTFR(cfg, TFRmult_th_ad); > ??? Undefined function or variable "Lbl". > > Error in ==> fieldtrip-20070226/private/createlayout at 244 > if ~any(strcmp('COMNT', Lbl)) > > Error in ==> multiplotTFR at 234 > lay = createlayout(cfg.layout); You may want to get the latest version of FT since there have been a lot of changes in the past 2 weeks to the layout stuff. The call to the function CREATELAYOUT (and the date stamp in your fieldtrip directory :-) suggest that you are using an FT version which predates the key changes made on 14.03.2007. It should be fine in the latest version. > 4. A new idea to reduce the length of trial and thus get better > pictures is > to separate baseline from the data-trials to one baseline set. How > can I > relate the baseline with the data as whole information and not just > time > limits. Am I making myself clear ? Not 100%, sorry. Can you say (write) that again? Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulla.rantakokko at TKK.FI Thu Mar 22 11:40:13 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Thu, 22 Mar 2007 11:40:13 +0100 Subject: TFR:boundaries, resolution Message-ID: Hi Christian, I enjoy your being so precise :) I actually downloaded the version 20070320, removed the older one from path but still matlab somehow finds the old version... maybe I must delete the old one from the computer for good. > You may want to get the latest version of FT since there have been a lot of changes in the past 2 weeks to the layout stuff. The call to the function CREATELAYOUT (and the date stamp in your fieldtrip directory :-) suggest that you are using an FT version which predates the key changes made on 14.03.2007. It should be fine in the latest version. > > Not 100%, sorry. Can you say (write) that again? > I was thinking that I save data separately for data trials with different trigger and another data set solemnly for baseline purpose with another trigger. Because my perfect baseline signal lies some 2000 ms before the data trial and because the data trial is long already the 2 secs for gap between trial and baseline is memory consuming and of no use. So I thought I could plot the data w.r.t. baseline activity from separate sets, when the data trial actually starts much later than the baseline. Now I have the impression that the baseline wants to refer to the same time limits as the data in trial. So can I select the baseline time and signal from another set and the data activity from another data set ie something like: select and preprocess data for baseline: cfg_baseline, data_baseline ...and for data: cfg, data (actually because this far the computation does not require too much memory, the trial could also be one long data set. I would like to compute the TFRs separately with only the time of interest differing into two sets: ) TFRmult_baseline = freqanalysis(cfg_baseline, data_baseline); TFRmult = freqanalysis(cfg, data); and then plot the latter w.r.t. the previous But here I get lost how to tell to FT that baseline could be the whole information (trial and time) and not only a time limit in cfg that is extracted from the data for baseline purpose. So is it possible or do I have to start to imagine ways around the problem ? I hope this lengthy description didn't make the idea even cloudier Best regs Ulla From k.kessler at PSY.GLA.AC.UK Thu Mar 22 11:35:21 2007 From: k.kessler at PSY.GLA.AC.UK (Klaus Kessler) Date: Thu, 22 Mar 2007 11:35:21 +0100 Subject: postdoc job available at Glasgow Message-ID: Dear all, if you are looking for a postdoc position and would like to work with MEG, EEG, TMS and eye tracking, then you might be interested in the position below. Cheers Klaus UNIVERSITY of GLASGOW DEPARTMENT OF PSYCHOLOGY CENTRE FOR COGNITIVE NEUROIMAGING (CCNi) RESEARCH ASSISTANT Salary: £23,002 - £25,889 / £25,889 - £31,840 (depending on experience and qualifications) REF 13147/DPO/A3 Applications are invited for a Postdoctoral Research Assistant to work with Dr Marie-Helene Grosbras and Dr Klaus Kessler on projects using magnetoencephalography (MEG) and transcranial magnetic stimulation (TMS). MEG experiments will aim at identifying cortical networks involved in cognitive processing and analyzing the underlying connectivity (coherence, synchronization). Functional hypotheses will then be tested by means of TMS and simultaneous eye tracking (ET). Future work may also include TMS during EEG recordings. Research projects focus on visual attention, vigilance, consciousness and action observation. You will have the opportunity to: contribute to the design of experiments; collect data with state of the art systems; develop, validate and apply cutting edge techniques to analyse brain signals in the time and frequency domain; search for solutions to the inverse problem in order to identify processing networks. Finally, this will also give you the opportunity to apply your skills in writing scientific articles for high impact journals. For at least two years you will be part of a successful team of researchers in Glasgow who work on related topics. The current creation of a Centre for Cognitive Neuroimaging (CCNi) within the Department of Psychology is a strategic priority of Glasgow University. Equipment will include a 3T fMRI scanner, a MEG system, two TMS systems with frameless stereotaxy, and several EEG systems – including fMRI compatible systems, providing a comprehensive platform of complementary, state-of-the-art brain imaging facilities dedicated to Cognitive Neuroscience research. The centre is scheduled to be opened in autumn. This post is initially available from 1 May 2007 for 2 years. You will be qualified, with a PhD, or equivalent, in Psychology, Neuroscience, Bioengineering, Physics or a related discipline. Experience with MEG/EEG, TMS and/or eye tracking is highly desirable. Programming skills (preferably with MATLAB) and experience with signal analysis in the time-frequency domain (including phase coherence/ synchronisation) is also highly desirable. Salary scale will depend on qualifications and experience. Finally you should have a strong interest in developing your own scientific programme and pursuing a research career. Informal enquiries may be made to Marie-Helene Grosbras (+44 (0)141 330 5264; m.grosbras at psy.gla.ac.uk) or Klaus Kessler (+44 (0)141 330 4774; k.kessler at psy.gla.ac.uk). For further details about the post and how to apply: see our web site at http://www.psy.gla.ac.uk/jobs.php or contact Clare Alexander, Department of Psychology, University of Glasgow, G12 8QQ (+44 (0) 141 330 5090, c.alexander at psy.gla.ac.uk Closing date: 16 April 2007. From sameer at ANDREW.CMU.EDU Thu Mar 22 17:09:08 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 22 Mar 2007 12:09:08 -0400 Subject: prepare_single_shell errors Message-ID: Hi, I am trying to use prepare_singleshell to try and get a single shell model using brain surface from segmented mri. I try to generate this segmented mri using (is this correct) >> [mri]= read_fcdc_mri('/mnt/condor2/sameer/Software/freesurfer/subjects/WS/mri/T1-neuromag/sets/COR.fif') mri = dim: [256 256 256] anatomy: [256x256x256 uint8] hdr: [1x1 struct] transform: [4x4 double] The file COR.fif is acquired by implementing mne_setup_mri of MNE-suite, and it in turn acts upon freeserfer treatment of dicom files of mri data. Then, >> cfg = []; cfg.gradfile = 'ws_011207_1_checkers.fif'; >> ft_singleshell = prepare_singleshell(cfg,mri); smoothing the segmentation with a 5-pixel FWHM kernel Warning: Divide by zero. > In mean at 29 In prepare_singleshell at 100 Warning: Divide by zero. > In mean at 29 In prepare_singleshell at 101 Warning: Divide by zero. > In mean at 29 In prepare_singleshell at 102 ??? Subscript indices must either be real positive integers or logicals. Error in ==> fieldtrip/private/triangulate_seg at 55 int = seg(sel); Error in ==> prepare_singleshell at 103 pnt = triangulate_seg(seg, cfg.spheremesh, ori); >> ft_segment = prepare_localspheres(cfg,mri); gives me similar errors. Any ideas how to troubleshoot these problems? If it will help, (fiff_read_mri is a MNE-suite utility) >> [stack] = fiff_read_mri(' Software/freesurfer/subjects/WS/mri/T1-neuromag/sets/COR.fif') Creating tag directory for /mnt/condor2/sameer/Software/freesurfer/subjects/WS/mri/T1-neuromag/sets/COR.fif...[done] Reading slices..50..100..150..200..250..256..[done] stack = id: [1x1 struct] trans: [1x1 struct] nslice: 256 slices: [1x256 struct] thanks for your time. best, sameer From r.oostenveld at FCDONDERS.RU.NL Thu Mar 22 17:47:00 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Mar 2007 17:47:00 +0100 Subject: prepare_single_shell errors In-Reply-To: Message-ID: Hi Sameer, The second input of prepare_singleshell should be a segmented MRI (i.e the output of VOLUMESEGMENT) and not an original gray-value MRI. On 22 Mar 2007, at 17:09, Sameer Walawalkar wrote: > I am trying to use prepare_singleshell to try and get a single > shell model using brain surface from segmented mri. > > I try to generate this segmented mri using (is this correct) > >>> [mri]= > read_fcdc_mri('/mnt/condor2/sameer/Software/freesurfer/subjects/WS/ > mri/T1-neuromag/sets/COR.fif') > > mri = > > dim: [256 256 256] > anatomy: [256x256x256 uint8] > hdr: [1x1 struct] > transform: [4x4 double] The anatomy here contains (that is what I suspect) all values between 0 and 255 that, when plotted, represent the anatomical MRI. > The file COR.fif is acquired by implementing mne_setup_mri of MNE- > suite, and it in turn acts upon freeserfer treatment of dicom files > of mri data. The output of volumesegment would contain mri.gray 256^3 mri.white 256^3 mri.csf 256^3 subsequently what prepare_singleshell does (see the first part in the code) is seg = zeros(mri.dim); if isfield(mri, 'gray') fprintf('including gray matter in segmentation for brain compartment\n') seg = seg | (mri.gray>(cfg.threshold*max(mri.gray(:)))); end if isfield(mri, 'white') fprintf('including white matter in segmentation for brain compartment\n') seg = seg | (mri.white>(cfg.threshold*max(mri.white(:)))); end if isfield(mri, 'csf') fprintf('including CSF in segmentation for brain compartment\n') seg = seg | (mri.csf>(cfg.threshold*max(mri.csf(:)))); end i.e. it fuses gray+white+csf into a single black-white 3-D volume that represents the skull content. Around that part of the 3-D volume the triangulation is constructed. Note that the mri.transform has to be correct and match with the headcoordinates of the gradiometers (you can use VOLUMEREALIGN if the coordinates are not properly aligned yet). Robert From levy at NMR.MGH.HARVARD.EDU Thu Mar 22 17:44:25 2007 From: levy at NMR.MGH.HARVARD.EDU (Robert Levy) Date: Thu, 22 Mar 2007 12:44:25 -0400 Subject: Field Trip and MNE Localization In-Reply-To: Message-ID: Hello, I just discovered Fieldtrip, and it seems like a very powerful tool for spectral analysis of MEG data. Our lab uses Matti Hamalainen's Neuromag MNE tools to localize ERMF generator sources. A spectral analysis feature is in development for these tools, but at present it can be done using Matlab either from scratch or potentially it seems with the help Fieldtrip. So as not to attempt reinventing the wheel I was wondering if anyone here has used Fieldtrip in conjunction with the Neuromag tools to both localize MEG data and analyze it spectrally. If anyone has done this already I would appreciate any suggestions, pointers or references to papers. Thanks, Rob From christoph.braun at UNI-TUEBINGEN.DE Thu Mar 22 18:21:43 2007 From: christoph.braun at UNI-TUEBINGEN.DE (Dr. Christoph Braun) Date: Thu, 22 Mar 2007 18:21:43 +0100 Subject: Postdoc position at the MEG-Center in T=?ISO-8859-15?Q?=FCbingen?= , Germany Message-ID: *Postdoctoral position in a "Bernstein Cooperation Project" related to voluntary control of brain activity* *for three years * The MEG-Center of the University of Tübingen offers a postdoc position in neuroscience. The candidate should have received a PhD in neuroscience, physics, mathematics, bio-informatics, medicine, psychology, or other disciplines related to studies in human neuroscience. The project investigates decoding of movement-related brain signals in close collaboration with the "Bernstein Center for Computational Neuroscience" of Freiburg. The project aims to improve neuronal decoding by voluntary modulation of brain signals using MEG and EEG recordings. Experience in psycho- and physiological experimentation and in the analysis of neurophysiological data is requested. Since the project requires intensive exchange with our cooperation partner, the candidate should be skilled in project organization and team-work. Salary is according to the German TV-L E13 (previously BAT IIa) which is about 43.000 € gross pay per year. The appointment is for a term of three years. Applicants should send an email including a statement of their research background and interests. Furthermore, a curriculum vitae, publication record and a list of scientific talks is requested. Finally three references should be provided. In case of questions and for your application please contact Dr. Christoph Braun, MEG-Center, Otfried-Müller-Str. 47, 72076 Tübingen, Germany. Email: christoph.braun at uni-tuebingen.de . Applications should be handed in before 15^th April 2007. -- Christoph Braun MEG-Zentrum Universität Tübingen Otfried-Müller-Str. 47 Telefon: +49(0)7071-2987705 Fax: +49(0)7071-295706 email: christoph.braun at uni-tuebingen.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From muthuraman10 at HOTMAIL.COM Thu Mar 22 18:38:17 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Thu, 22 Mar 2007 17:38:17 +0000 Subject: coherence in TFR! Message-ID: Hello Fieldtrippers, Is there way to plot the coherence in the TFR representation after using the 'mtmconvol' method with the output configuration 'powandcsd'. Thanking you With regards M.Muthuraman. _________________________________________________________________ Catch all the cricketing action right here. Live score, match reports, photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 22 19:44:05 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 22 Mar 2007 19:44:05 +0100 Subject: coherence in TFR!!! In-Reply-To: Message-ID: Yes, it is possible to plot coherence. Compute the coherence-spectrum using freqdescriptives, and plot it with topoplotTFR, setting cfg.zparam = 'cohspctrm', and specifying a cfg.cohrefchannel. It's documented in the help of topoplotTFR, which you can read, when you open the corresponding m-file, or type 'help topoplotTFR' on the commandline. JM -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Thursday, March 22, 2007 6:38 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] coherence in TFR! Hello Fieldtrippers, Is there way to plot the coherence in the TFR representation after using the 'mtmconvol' method with the output configuration 'powandcsd'. Thanking you With regards M.Muthuraman. _________________________________________________________________ Catch all the cricketing action right here. Live score, match reports, photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx From conrado.bosman at GMAIL.COM Fri Mar 23 13:47:04 2007 From: conrado.bosman at GMAIL.COM (Conrado Bosman) Date: Fri, 23 Mar 2007 13:47:04 +0100 Subject: Problem to configurate electrode positions for freqstatistic analysis Message-ID: Dear Fieldtrippers, I am currently analyzing some old EEG data., butI have some problems to define the electrode configuration to run clusterrandanalysis or freqstatistics. All data were register in a Neuroscan equipment with a strange configuration of 80 channels that is not easy to find in the internet or in the Neuroscan website. However, using the script prepare_layout, I could get a .lay file with the positions, that is very useful to make topographies, but I am not able to use this file to define electrode position for statistical analysis. My question is: Is there any way to obtain a cfg.elec configuration starting from the .lay file so i could use with freqstatistics? Thanks in advance, -- Conrado From maris at NICI.RU.NL Fri Mar 23 13:59:05 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Fri, 23 Mar 2007 13:59:05 +0100 Subject: Problem to configurate electrode positions for freqstatistic analysis In-Reply-To: Message-ID: Hi Conrado, > I am currently analyzing some old EEG data., butI have some problems > to define the electrode configuration to run clusterrandanalysis or > freqstatistics. All data were register in a Neuroscan equipment with a > strange configuration of 80 channels that is not easy to find in the > internet or in the Neuroscan website. However, using the script > prepare_layout, I could get a .lay file with the positions, that is > very useful to make topographies, but I am not able to use this file > to define electrode position for statistical analysis. My question is: > > Is there any way to obtain a cfg.elec configuration starting from the > .lay file so i could use with freqstatistics? I think not, because the .lay file contains coordinates in a plane, whereas the cfg.elec structure must contain coordinates in 3 dimensions. You can construct the neighborhood-structure manually. This is described in the help documentation of clusterrandanalysis (and in one of the subfunctions that is called by freqstatistics). This is a boring job and takes a couple of hours, but it may well be the most time-efficient approach. Good luck, Eric Maris From ulla.rantakokko at TKK.FI Fri Mar 23 15:04:46 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Fri, 23 Mar 2007 15:04:46 +0100 Subject: Layout lay Message-ID: Hello, Concerning the layout created with lay=prepare_layout(cfg, data), where data is from preprocessing and FT version is 20070320 (for sure, previous deleted), I still get: multiplotTFR(cfg, TFRspect); creating layout from data.grad creating layout for neuromag306 system ??? Reference to non-existent field 'lbl'. Error in ==> multiplotTFR at 275 k = cellstrmatch('COMNT',lay.lbl); >> ...from before..: suggest that you are using an FT version which predates the key changes made on 14.03.2007. It should be fine in the latest version. >>>>>>>>>> Regards Ulla From c.hesse at FCDONDERS.RU.NL Fri Mar 23 15:16:02 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Fri, 23 Mar 2007 15:16:02 +0100 Subject: Layout lay In-Reply-To: Message-ID: Hi Ulla, the changes in PREPARE_LAYOUT (which is the "key" function here) were made on 21.03.2007 (see recent changes at http://www2.ru.nl/fcdonders/ fieldtrip/doku.php?id=fieldtrip) the day after your newest FT version. If it does not work with the absolute newest version either, then please let me know. Regards, Christian On 23 Mar 2007, at 15:04, Ulla Rantakokko wrote: > Hello, > > Concerning the layout created with > lay=prepare_layout(cfg, data), > where data is from preprocessing and FT version is 20070320 (for sure, > previous deleted), > > I still get: > > multiplotTFR(cfg, TFRspect); > creating layout from data.grad > creating layout for neuromag306 system > ??? Reference to non-existent field 'lbl'. > > Error in ==> multiplotTFR at 275 > k = cellstrmatch('COMNT',lay.lbl); > > >>> ...from before..: > suggest that you are using an FT version which predates > the key changes made on 14.03.2007. It should be fine in the latest > version. >>>>>>>>>>> > > Regards > > Ulla > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From muthuraman10 at HOTMAIL.COM Fri Mar 23 16:43:44 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Fri, 23 Mar 2007 15:43:44 +0000 Subject: coherence in TFR!!! In-Reply-To: <000301c76cb2$113e42e0$902dae83@fcdonders.nl> Message-ID: Hello Filedtripers, Thanks for the reply, and when i use the fdTFRmult = freqdescriptives([], TFRmult); to calculate the coherence after the time frequency analysis i get all the values of coherence to be 1.0. Is there any other configuration steps need to be followed in fieldtrip before calculating the coherence from the 'mtmconvol' method. Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It�s cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in From Brian.Roach at YALE.EDU Fri Mar 23 16:47:22 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Fri, 23 Mar 2007 11:47:22 -0400 Subject: coherence in TFR!!! In-Reply-To: Message-ID: You're not running on the average, are you? That would give coherence of 1. At 11:43 AM 3/23/2007, you wrote: >Hello Filedtripers, > >Thanks for the reply, and when i use the >fdTFRmult = freqdescriptives([], TFRmult); to calculate the >coherence after the time frequency analysis i get all the values of >coherence to be 1.0. > >Is there any other configuration steps need to be followed in fieldtrip >before calculating the coherence >from the 'mtmconvol' method. > > >Thanking you > >With regards >M.Muthuraman. > >_________________________________________________________________ >Tried the new MSN Messenger? It's cool! Download now. >http://messenger.msn.com/Download/Default.aspx?mkt=en-in > From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 23 16:54:33 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 23 Mar 2007 16:54:33 +0100 Subject: coherence in TFR!!!!! In-Reply-To: Message-ID: Hi Muthumaran, I agree with Brian. In fact, there are two other ways to achieve a coherence of 1: 1) the two signals you are computing the coherence for, are identical 2) you data-structure only specifies one trial (which you achieve when running the analysis on the average) I guess that the second way applies to your data. In this context, it does not make sense to compute coherence, because by definition it will be 1. In either case, there is nothing fieldtrip can do for you. Your data should be defined such, that it makes sense to compute coherence. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Friday, March 23, 2007 4:44 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] coherence in TFR!!! Hello Filedtripers, Thanks for the reply, and when i use the fdTFRmult = freqdescriptives([], TFRmult); to calculate the coherence after the time frequency analysis i get all the values of coherence to be 1.0. Is there any other configuration steps need to be followed in fieldtrip before calculating the coherence from the 'mtmconvol' method. Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It's cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in From sameer at ANDREW.CMU.EDU Fri Mar 23 17:18:54 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Fri, 23 Mar 2007 12:18:54 -0400 Subject: volumesegment has spm2 related memory issues Message-ID: Hi, When I run >> [segment] = volumesegment(cfg,mri) I get memory problems at a particular line in a spm2 matlab file. The error message is : performing the segmentation on the specified volume ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> spm_smoothto8bit>smoothto8bit at 41 buff = zeros([V.dim(1:2) r{3}.s*2+1]); On printing out these numbers, I find that spm2 is attempting to create a file Of size (256 x 256 x 23783). Has anyone else has had these kind of problems with spm2? Or is there (this is more likely) my problem with implementation. The information about mri is: >> mri mri = dim: [256 256 256] anatomy: [256x256x256 uint8] hdr: [1x1 struct] transform: [4x4 double] Thanks a lot. best, sameer From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 23 20:57:39 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 23 Mar 2007 20:57:39 +0100 Subject: volumesegment has spm2 related memory issues In-Reply-To: Message-ID: Dear Sameer, To give a short answer to your question: I never noticed a problem like this. I indeed think, that there is something not completely correct with the input. Let have a look at the code together to get a clue what might go wrong. You were on the good track working out the numbers, but let's pursue it a bit further: >Error in ==> spm_smoothto8bit>smoothto8bit at 41 >buff = zeros([V.dim(1:2) r{3}.s*2+1]); > >On printing out these numbers, I find that spm2 is attempting to create a >file >Of size (256 x 256 x 23783). The number 23783 likely causes the problem, because it's rather big. Apparently, r{3}.s*2+1 = 23783. So what is r{3}.s? Clearly this amounts to 11891. When we have a look into the for-loop, preceding the line which causes the crash, we see that r{3}.s = ceil(3.5*sqrt(s(i))). So, the variable s(i) (as an element of the 1x3-vector) is about 1.15e7. A few lines up, it says that s = (fwhm./vx./sqrt(8*log(2)) + eps).^2 Let's forget about eps (which is the numerical round-off error), some juggling with the numbers leads to fwhm./vx being [8000 8000 8000]. Typically fwhm = [8 8 8] (in mm), so vx in your case was something like 0.001. And this vx is derived from a variable V.mat, which is the affine-matrix which came along with the volume the function tries to smooth. This affine-matrix is needed to interpret the voxels in terms of a physical coordinate system. Importantly, since the smoothing kernel is defined in mm, the mapping which this matrix brings about, should also be defined in mm. Because there's a factor 1000 difference here, I suspect that your matrix has metres as a unit, instead of mm. The V.mat variable is taken from the input-mri, and is equal to mri.transform. Apparently, implicitly it assumes it to be defined in mm. So for now, I'd suggest to massage this mri.transform a bit such that starts to behave nicely. I guess it should be something like mri.transform(1:3,:) = 1000.*mri.transform(1:3,:); Then you should have a look at mri.transform(1:3,1:3). If you have a 1mm resolution mri, then sqrt(sum(mri.transform(1:3,1:3).^2)) should be one-ish. Good luck, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Friday, March 23, 2007 5:19 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] volumesegment has spm2 related memory issues Hi, When I run >> [segment] = volumesegment(cfg,mri) I get memory problems at a particular line in a spm2 matlab file. The error message is : performing the segmentation on the specified volume ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> spm_smoothto8bit>smoothto8bit at 41 buff = zeros([V.dim(1:2) r{3}.s*2+1]); On printing out these numbers, I find that spm2 is attempting to create a file Of size (256 x 256 x 23783). Has anyone else has had these kind of problems with spm2? Or is there (this is more likely) my problem with implementation. The information about mri is: >> mri mri = dim: [256 256 256] anatomy: [256x256x256 uint8] hdr: [1x1 struct] transform: [4x4 double] Thanks a lot. best, sameer From ulla.rantakokko at TKK.FI Tue Mar 27 12:03:46 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Tue, 27 Mar 2007 12:03:46 +0200 Subject: Layout lay Message-ID: Hi Christian I reloaded the version: File: fieldtrip-20070320.zip 1665 KB 03/20/2007 08:06:00 PM which is the most resent version accessible at the moment. However, >> multiplotTFR(cfg, TFRwave); reverting to 151 channel CTF default when using lay as cfg.layout. Regards, Ulla Hi Ulla, the changes in PREPARE_LAYOUT (which is the "key" function here) were made on 21.03.2007 (see recent changes at http://www2.ru.nl/fcdonders/ fieldtrip/doku.php?id=fieldtrip) the day after your newest FT version. If it does not work with the absolute newest version either, then please let me know. Regards, Christian From c.hesse at FCDONDERS.RU.NL Wed Mar 28 11:58:06 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 28 Mar 2007 11:58:06 +0200 Subject: Layout lay In-Reply-To: Message-ID: Hi Ulla, there was a temporary (accidental) suspension of FT daily updates since 20.03.2007, which has just been spotted and stopped. The latest version of FT is available on the FTP-server NOW, so please download and let me know if the layout bugs persist. Regards, Christian On 23 Mar 2007, at 15:04, Ulla Rantakokko wrote: > Hello, > > Concerning the layout created with > lay=prepare_layout(cfg, data), > where data is from preprocessing and FT version is 20070320 (for sure, > previous deleted), > > I still get: > > multiplotTFR(cfg, TFRspect); > creating layout from data.grad > creating layout for neuromag306 system > ??? Reference to non-existent field 'lbl'. > > Error in ==> multiplotTFR at 275 > k = cellstrmatch('COMNT',lay.lbl); > > >>> ...from before..: > suggest that you are using an FT version which predates > the key changes made on 14.03.2007. It should be fine in the latest > version. >>>>>>>>>>> > > Regards > > Ulla > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brian.Roach at YALE.EDU Thu Mar 29 01:07:37 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Wed, 28 Mar 2007 19:07:37 -0400 Subject: source analysis attempt using DICS method Message-ID: Attached is the output from a call to sourceinterp on source analysis output data. I am trying to use the DICS method, but my output looks nothing like the tutorial pictures. I am including what I believe to be the relevant code, and advice on the source of my mistake(s) would be appreciated: [EEG com] = pop_loadbv('/home/bjr39/FTsource', 'B22001hal.vhdr') EEG1 = pop_select(EEG) help eeglab2fieldtrip data = eeglab2fieldtrip(EEG1, 'preprocessing') %%% there is some code which I have not included that string matches my electrodes and uses coordinate that put the sites in MNI space according to the coordinates listed here:http://oase.uci.ru.nl/~roberto/electrode/realistic_1005.txt %%% cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [5 100]; cfg.tapsmofrq = 2; cfg.foilim = [35 45]; freq = freqanalysis(cfg, data) cfg = []; cfg.method = 'dics'; cfg.frequency = 40; cfg.hdmfile = '/home/bjr39/FTsource/vol.mat'; cfg.resolution = 2 pack;source = sourceanalysis(cfg, freq) sourcePost = sourcedescriptives([], source) cfg =[]; cfg.downsample = 2; cfg.funparameter = 'nai'; cfg.colmin = 'auto'; cfg.colmax = 'auto'; sourcePostF = source2full(sourcePost); sliceinterp(cfg,sourceInterp); I can share more info if it will help, related to the size of different data structures, or whatever anyone would need to know. I followed the guide for head model creation and plotted it at various points (one plot previously posted to the list). Could a poor head model create this problem? thanks, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TestSourceAnalysis.png Type: application/octet-stream Size: 278081 bytes Desc: not available URL: From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 29 08:29:06 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 29 Mar 2007 08:29:06 +0200 Subject: source analysis attempt using DICS method In-Reply-To: <6.1.2.0.2.20070328185248.01c377a0@email.med.yale.edu> Message-ID: Dear Brian, Allow me to point you to a quite related problem which has been posted by Nathan about a month ago. I think it was the beginning of March. You can browse through the discussion list's history when you go to the fieldtrip-website and click around a bit at the appropriate links. Even though the question here was related to LCMV-beamformer, the problems might have the same cause. Following Nathan's thread, a very likely cause is the incorrect specification of cfg.mriunits, and cfg.sourceunits prior to calling sourceinterpolate (I did not find back in the code you sent in your mail that you actually called it, but I assume you did). If not specified, fieldtrip puts cfg.mriunits to 'mm', and cfg.sourceunits to 'cm'. There might be a discrepancy in your data there. Perhaps you even explicitly have to check, whether your headmodel (in hdmfile) is defined in cm. At least the dipole-grid on which sourceanalysis performs the beamformer-scanning is defined in cm, and I guess the units should be identical here as well. Good luck, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Brian Roach Sent: Thursday, March 29, 2007 1:08 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] source analysis attempt using DICS method Attached is the output from a call to sourceinterp on source analysis output data. I am trying to use the DICS method, but my output looks nothing like the tutorial pictures. I am including what I believe to be the relevant code, and advice on the source of my mistake(s) would be appreciated: [EEG com] = pop_loadbv('/home/bjr39/FTsource', 'B22001hal.vhdr') EEG1 = pop_select(EEG) help eeglab2fieldtrip data = eeglab2fieldtrip(EEG1, 'preprocessing') %%% there is some code which I have not included that string matches my electrodes and uses coordinate that put the sites in MNI space according to the coordinates listed here:http://oase.uci.ru.nl/~roberto/electrode/realistic_1005.txt %%% cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [5 100]; cfg.tapsmofrq = 2; cfg.foilim = [35 45]; freq = freqanalysis(cfg, data) cfg = []; cfg.method = 'dics'; cfg.frequency = 40; cfg.hdmfile = '/home/bjr39/FTsource/vol.mat'; cfg.resolution = 2 pack;source = sourceanalysis(cfg, freq) sourcePost = sourcedescriptives([], source) cfg =[]; cfg.downsample = 2; cfg.funparameter = 'nai'; cfg.colmin = 'auto'; cfg.colmax = 'auto'; sourcePostF = source2full(sourcePost); sliceinterp(cfg,sourceInterp); I can share more info if it will help, related to the size of different data structures, or whatever anyone would need to know. I followed the guide for head model creation and plotted it at various points (one plot previously posted to the list). Could a poor head model create this problem? thanks, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Thu Mar 29 13:59:42 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Thu, 29 Mar 2007 04:59:42 -0700 Subject: problem on wavelet analysis In-Reply-To: <005c01c771cb$8d631850$902dae83@fcdonders.nl> Message-ID: Dear experts, Could you give me ome suggestion for wavelet analysis? These parameters are OK in EEG data I count using ohter software. I don't think it's different for MEG data but the error happened... >> cfg=[]; >> cfg.sgn='MEG'; >> cfg.method='wltconvol'; >> cfg.width=3; >> cfg.foi=4:1:30; >> cfg.toi=-0.4:0.05:1.4; >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis_wltconvol.m On line 234 ==> if csdflg, crsspctrm = complex(zeros(numsgncmb,numfoi,numtoi)); end Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); Any suggestions are appreciated. Best, Eve --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Mar 29 15:24:57 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Mar 2007 15:24:57 +0200 Subject: source analysis attempt using DICS method In-Reply-To: <005c01c771cb$8d631850$902dae83@fcdonders.nl> Message-ID: On 29 Mar 2007, at 8:29, Jan Mathijs Schoffelen wrote: > a very likely cause is the incorrect specification of cfg.mriunits, > and cfg.sourceunits prior to calling sourceinterpolate (I did not > find back in the code you sent in your mail that you actually > called it, but I assume you did). If not specified, fieldtrip puts > cfg.mriunits to ‘mm’, and cfg.sourceunits to ‘cm’. There might be a > discrepancy in your data there. Perhaps you even explicitly have to > check, whether your headmodel (in hdmfile) is defined in cm. At > least the dipole-grid on which sourceanalysis performs the > beamformer-scanning is defined in cm, and I guess the units should > be identical here as well. The standard BEM EEG volume conduction model that you might have copied from EEGLAB is one that is based on the MNI template brain. It is in MNI coordinates (linked to the AC and PC) and the units are in mm (corresponding with SPM standards). Robert From sameer at ANDREW.CMU.EDU Thu Mar 29 16:20:56 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 29 Mar 2007 10:20:56 -0400 Subject: NANs in Time frequency analysis. Message-ID: Hi, I am using the following settng to run time frequency analysis. cfgTFR = []; cfgTFR.output = 'pow'; cfgTFR.channel = 'MEG'; cfgTFR.method = 'mtmconvol'; cfgTFR.foi = 05 : 2 : 35; cfgTFR.t_ftimwin = 5./cfgTFR.foi; cfgTFR.tapsmofrq = 0.4 *cfgTFR.foi; cfgTFR.toi = 1:0.05:2.5; cfgTFR.pad = 'maxperlen'; TFRmult = freqanalysis(cfgTFR, data); and find that the TFRplots for all channels (plottd using multiplot) are always deep blue in the high time end, especially at low frequencies. Inspection of TFR mult shows many NANs in the corresponding time regions. Does anyone has any ideas about this? thanks for your reply. best, sameer From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 29 16:34:31 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 29 Mar 2007 16:34:31 +0200 Subject: NANs in Time frequency analysis. In-Reply-To: Message-ID: Dear Sameer, A nan is given back at those time-frequency points at which no value can be estimated. This means that at the toi-foi pairs you specified in your configuration, the corresponding timewindow as specified in t_ftimwin cannot be completely filled with data. In your case, I therefore expect this 'problem' to be worse for the lower frequencies. It might seem a sorry answer, but this is just a thing you have to live with. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Thursday, March 29, 2007 4:21 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] NANs in Time frequency analysis. Hi, I am using the following settng to run time frequency analysis. cfgTFR = []; cfgTFR.output = 'pow'; cfgTFR.channel = 'MEG'; cfgTFR.method = 'mtmconvol'; cfgTFR.foi = 05 : 2 : 35; cfgTFR.t_ftimwin = 5./cfgTFR.foi; cfgTFR.tapsmofrq = 0.4 *cfgTFR.foi; cfgTFR.toi = 1:0.05:2.5; cfgTFR.pad = 'maxperlen'; TFRmult = freqanalysis(cfgTFR, data); and find that the TFRplots for all channels (plottd using multiplot) are always deep blue in the high time end, especially at low frequencies. Inspection of TFR mult shows many NANs in the corresponding time regions. Does anyone has any ideas about this? thanks for your reply. best, sameer From sameer at ANDREW.CMU.EDU Thu Mar 29 16:39:22 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 29 Mar 2007 10:39:22 -0400 Subject: NANs in Time frequency analysis. In-Reply-To: <007f01c7720f$5d4d4750$902dae83@fcdonders.nl> Message-ID: Thanks Jan-Mathijs, That was my expectation given how TFRs are calculated. sameer On Thu, 29 Mar 2007, Jan Mathijs Schoffelen wrote: > Dear Sameer, > > A nan is given back at those time-frequency points at which no value can be > estimated. This means that at the toi-foi pairs you specified in your > configuration, the corresponding timewindow as specified in t_ftimwin cannot > be completely filled with data. In your case, I therefore expect this > 'problem' to be worse for the lower frequencies. It might seem a sorry > answer, but this is just a thing you have to live with. > > Yours, > > Jan-Mathijs > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Sameer Walawalkar > Sent: Thursday, March 29, 2007 4:21 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] NANs in Time frequency analysis. > > Hi, > > I am using the following settng to run time frequency analysis. > > cfgTFR = []; > cfgTFR.output = 'pow'; > cfgTFR.channel = 'MEG'; > cfgTFR.method = 'mtmconvol'; > cfgTFR.foi = 05 : 2 : 35; > cfgTFR.t_ftimwin = 5./cfgTFR.foi; > cfgTFR.tapsmofrq = 0.4 *cfgTFR.foi; > cfgTFR.toi = 1:0.05:2.5; > cfgTFR.pad = 'maxperlen'; > > TFRmult = freqanalysis(cfgTFR, data); > > and find that the TFRplots for all channels (plottd using multiplot) are > always deep blue in the high time end, especially at low frequencies. > > Inspection of TFR mult shows many NANs in the corresponding time regions. > > Does anyone has any ideas about this? > > thanks for your reply. > > best, > sameer > > From alotof_xd at YAHOO.COM Fri Mar 30 05:48:06 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Thu, 29 Mar 2007 20:48:06 -0700 Subject: problem on wavelet analysis, combine channel Message-ID: Dear experts, I checked the script of freqanalysis_wltconvol and founf the default for output was 'powandcsd'. This output needs combine channels. My meuromag data seems has problem on something related "combine channels". It works when I change output as 'pow'. However, I wonder what might happen when using combining channels? I suppose it relates layout? Thanks for suggestion. Best, Eve alotof eve wrote: Date: Thu, 29 Mar 2007 04:59:42 -0700 From: alotof eve Subject: [FIELDTRIP] problem on wavelet analysis To: FIELDTRIP at NIC.SURFNET.NL Dear experts, Could you give me ome suggestion for wavelet analysis? These parameters are OK in EEG data I count using ohter software. I don't think it's different for MEG data but the error happened... >> cfg=[]; >> cfg.sgn='MEG'; >> cfg.method='wltconvol'; >> cfg.width=3; >> cfg.foi=4:1:30; >> cfg.toi=-0.4:0.05:1.4; >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis_wltconvol.m On line 234 ==> if csdflg, crsspctrm = complex(zeros(numsgncmb,numfoi,numtoi)); end Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); Any suggestions are appreciated. Best, Eve --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. --------------------------------- 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Fri Mar 30 09:21:18 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Fri, 30 Mar 2007 00:21:18 -0700 Subject: sensortype Message-ID: Sorry for sending so many emails. The error for combine channel is due to sensortype.m cannot get my neuromag data type. I checked the length(grad.label). It's 612, double of 306 which is supposed. How can I settle it? Thanks in advance. Best, Eve alotof eve wrote: Date: Thu, 29 Mar 2007 20:48:06 -0700 From: alotof eve Subject: [FIELDTRIP] problem on wavelet analysis, combine channel To: FIELDTRIP at NIC.SURFNET.NL Dear experts, I checked the script of freqanalysis_wltconvol and founf the default for output was 'powandcsd'. This output needs combine channels. My meuromag data seems has problem on something related "combine channels". It works when I change output as 'pow'. However, I wonder what might happen when using combining channels? I suppose it relates layout? Thanks for suggestion. Best, Eve alotof eve wrote: Date: Thu, 29 Mar 2007 04:59:42 -0700 From: alotof eve Subject: [FIELDTRIP] problem on wavelet analysis To: FIELDTRIP at NIC.SURFNET.NL Dear experts, Could you give me ome suggestion for wavelet analysis? These parameters are OK in EEG data I count using ohter software. I don't think it's different for MEG data but the error happened... >> cfg=[]; >> cfg.sgn='MEG'; >> cfg.method='wltconvol'; >> cfg.width=3; >> cfg.foi=4:1:30; >> cfg.toi=-0.4:0.05:1.4; >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis_wltconvol.m On line 234 ==> if csdflg, crsspctrm = complex(zeros(numsgncmb,numfoi,numtoi)); end Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); Any suggestions are appreciated. Best, Eve --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. --------------------------------- 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut. --------------------------------- Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From weisz at LYON.INSERM.FR Fri Mar 30 09:31:17 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Fri, 30 Mar 2007 09:31:17 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <50358.94104.qm@web56614.mail.re3.yahoo.com> Message-ID: hi eve, i'm not too familiar with the fieldtrip specifications, but: > Out of memory. Type HELP MEMORY for your options. do you have enough RAM? this would then not be a real fieldtrip problem, but a rather common problem generally when using matlab. good luck! nathan From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 30 09:38:15 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 30 Mar 2007 09:38:15 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <8B34AB95-3A47-4E90-9F37-33DFB292296B@lyon.inserm.fr> Message-ID: Dear Eve, I totally agree with Nathan. Specifying (unintended, but still... ;o) ) 'powandcsd', in particular in combination with a spectro-temporal reconstruction really blows up your memory requirements. Especially when (again probably unintended) you are computing csd's for all channelcombination. I'll leave it up to you to calculate how many bytes are needed only to represent your output csd-matrix in memory. Some hints: -each double precision number requires 8 bytes of memory in matlab -each complex number consists of two double precision numbers -(numberoftrials)x(numberofchannelcombinations)x(numberoffrequencypoints)x (numberoftimepoints) can become really big. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Friday, March 30, 2007 9:31 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem on wavelet analysis, combine channel hi eve, i'm not too familiar with the fieldtrip specifications, but: > Out of memory. Type HELP MEMORY for your options. do you have enough RAM? this would then not be a real fieldtrip problem, but a rather common problem generally when using matlab. good luck! nathan From alotof_xd at YAHOO.COM Fri Mar 30 15:49:35 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Fri, 30 Mar 2007 06:49:35 -0700 Subject: problem on wavelet analysis, combine channel In-Reply-To: <001201c7729e$60b2ac70$902dae83@fcdonders.nl> Message-ID: Dear Jan and Nathan, Thank you so much. But I am 80 percent sure it's not a common memory problem. My computer is 1GB of RAM. And if I don't use combination, I can select very fine parameters for wavelet analysis. My data is neuromag .fif data. I suppose something wrong with the channel counting. Thanks. Best, eve Jan Mathijs Schoffelen wrote: Dear Eve, I totally agree with Nathan. Specifying (unintended, but still... ;o) ) 'powandcsd', in particular in combination with a spectro-temporal reconstruction really blows up your memory requirements. Especially when (again probably unintended) you are computing csd's for all channelcombination. I'll leave it up to you to calculate how many bytes are needed only to represent your output csd-matrix in memory. Some hints: -each double precision number requires 8 bytes of memory in matlab -each complex number consists of two double precision numbers -(numberoftrials)x(numberofchannelcombinations)x(numberoffrequencypoints)x (numberoftimepoints) can become really big. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Friday, March 30, 2007 9:31 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem on wavelet analysis, combine channel hi eve, i'm not too familiar with the fieldtrip specifications, but: > Out of memory. Type HELP MEMORY for your options. do you have enough RAM? this would then not be a real fieldtrip problem, but a rather common problem generally when using matlab. good luck! nathan --------------------------------- Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. -------------- next part -------------- An HTML attachment was scrubbed... URL: From weisz at LYON.INSERM.FR Fri Mar 30 16:23:47 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Fri, 30 Mar 2007 16:23:47 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <419502.11257.qm@web56614.mail.re3.yahoo.com> Message-ID: hi eve, > Thank you so much. But I am 80 percent sure it's not a common > memory problem. this leaves 20% uncertainty :-) taking jans' formula: > -(numberoftrials)x(numberofchannelcombinations)x > (numberoffrequencypoints)x > (numberoftimepoints) and assuming for simlicity you have 100 trials (... 302 channels, right). > ((100*90600*27*21)*16)/c(10^9) #90600 equals to number of all pairwise channel combinations [1] 82.19232 1GB RAM is not much help here for such a beast (and probably the lower limit when doing MEG-analysis), if i have no fundamental misunderstanding here. do you really need 'powandcsd'? why don't you first do the 'pow'- thing, look what's interesting (perhaps some stats) and then redo the freqanalysis with 'powandcsd' on time-frequency points of interest, taking account of your RAM. all the best, nathan From c.hesse at FCDONDERS.RU.NL Fri Mar 30 17:22:54 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Fri, 30 Mar 2007 17:22:54 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <419502.11257.qm@web56614.mail.re3.yahoo.com> Message-ID: Hi Eve, just to chip in here: what (in simple terms) do you want to achieve using wavelet analysis of your data? What do you ultimately want to plot? Christian On 30 Mar 2007, at 15:49, alotof eve wrote: > Dear Jan and Nathan, > > Thank you so much. But I am 80 percent sure it's not a common > memory problem. My computer is 1GB of RAM. And if I don't use > combination, I can select very fine parameters for wavelet > analysis. My data is neuromag .fif data. I suppose something wrong > with the channel counting. > Thanks. > > Best, > eve > > Jan Mathijs Schoffelen wrote: > Dear Eve, > > I totally agree with Nathan. Specifying (unintended, but > still... ;o) ) > 'powandcsd', in particular in combination with a spectro-temporal > reconstruction really blows up your memory requirements. Especially > when > (again probably unintended) you are computing csd's for all > channelcombination. I'll leave it up to you to calculate how many > bytes are > needed only to represent your output csd-matrix in memory. > Some hints: > -each double precision number requires 8 bytes of memory in matlab > -each complex number consists of two double precision numbers > -(numberoftrials)x(numberofchannelcombinations)x > (numberoffrequencypoints)x > (numberoftimepoints) can become really big. > > Yours, > > Jan-Mathijs > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Nathan Weisz > Sent: Friday, March 30, 2007 9:31 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] problem on wavelet analysis, combine channel > > hi eve, > > i'm not too familiar with the fieldtrip specifications, but: > > > Out of memory. Type HELP MEMORY for your options. > > do you have enough RAM? > > this would then not be a real fieldtrip problem, but a rather common > problem generally when using matlab. > > good luck! > > nathan > > > Expecting? Get great news right away with email Auto-Check. > Try the Yahoo! Mail Beta. ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brian.Roach at YALE.EDU Fri Mar 30 18:44:38 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Fri, 30 Mar 2007 12:44:38 -0400 Subject: source analysis attempt using DICS method In-Reply-To: <19AD5C31-FFE9-47C6-AE75-0C7B444EA154@fcdonders.ru.nl> Message-ID: Thanks for these replies. I have now specified cfg.mriunits = 'mm' cfg.sourceunits = 'mm' Then, I should re-run sourceinterpolate.m? That seems to produce the new results, but the same new results whether I specify both units as 'cm' or 'mm'. If my MRI is in 'mm' and sourceanalysis.m uses cm, which are you supposed to use? thanks, Brian At 09:24 AM 3/29/2007, Robert Oostenveld wrote: >On 29 Mar 2007, at 8:29, Jan Mathijs Schoffelen wrote: >>a very likely cause is the incorrect specification of cfg.mriunits, >>and cfg.sourceunits prior to calling sourceinterpolate (I did not >>find back in the code you sent in your mail that you actually >>called it, but I assume you did). If not specified, fieldtrip puts >>cfg.mriunits to 'mm', and cfg.sourceunits to 'cm'. There might be a >>discrepancy in your data there. Perhaps you even explicitly have to >>check, whether your headmodel (in hdmfile) is defined in cm. At >>least the dipole-grid on which sourceanalysis performs the >>beamformer-scanning is defined in cm, and I guess the units should >>be identical here as well. > >The standard BEM EEG volume conduction model that you might have >copied from EEGLAB is one that is based on the MNI template brain. It >is in MNI coordinates (linked to the AC and PC) and the units are in >mm (corresponding with SPM standards). > >Robert From litvak at TX.TECHNION.AC.IL Thu Mar 1 13:00:22 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 12:00:22 -0000 Subject: TopoplotTFR Message-ID: Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 1 13:06:50 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 1 Mar 2007 13:06:50 +0100 Subject: TopoplotTFR In-Reply-To: <000001c75bf9$38f23450$f0463ec1@sobell.ion.ucl.ac.uk> Message-ID: Dear Vladimir, Your xlim and ylim should be defined as two-element vectors, specifying the upper and lower boundaries. So you can only plot subsets of contiguous time-frequency points. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 1 13:12:57 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 1 Mar 2007 13:12:57 +0100 Subject: TopoplotTFR In-Reply-To: <000001c75bf9$38f23450$f0463ec1@sobell.ion.ucl.ac.uk> Message-ID: Oops. I'm sorry, I misread your mail; I thought you were talking about multiplotTFR. Forget what I said before. To my knowledge, a subplotted topoplotTFR only works in the time dimension, but I'm not sure. Did you check the code? So if it is true, that it only works in the time dimension, there are two ways of doing what you want: Repeatedly call topoplotTFR for different frequencies, or adjust the function such that it also works the other way. Maybe you could look into if and why the assignment of the yparam and xparam should always be 'time', and 'freq' respectively. I guess the original reason stems from the fact that we are used to depict TFRs like that. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TX.TECHNION.AC.IL Thu Mar 1 13:19:18 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 12:19:18 -0000 Subject: TopoplotTFR In-Reply-To: <000901c75bfa$18299b40$902dae83@fcdonders.nl> Message-ID: So how do I do a multiple plot? It did work before and works even now for time. Thanks, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jan Mathijs Schoffelen Sent: Thursday, March 01, 2007 12:07 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR Dear Vladimir, Your xlim and ylim should be defined as two-element vectors, specifying the upper and lower boundaries. So you can only plot subsets of contiguous time-frequency points. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TX.TECHNION.AC.IL Thu Mar 1 15:46:28 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 14:46:28 -0000 Subject: TopoplotTFR In-Reply-To: <000e01c75bfa$f2dd27c0$902dae83@fcdonders.nl> Message-ID: I looked at the code and the problem is in line 264 of topoplotER where you assume that the yparam is always the second dimension in the data and the xparam is always the third. When this assumption is false, the code fails. Best, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jan Mathijs Schoffelen Sent: Thursday, March 01, 2007 12:13 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR Oops. I'm sorry, I misread your mail; I thought you were talking about multiplotTFR. Forget what I said before. To my knowledge, a subplotted topoplotTFR only works in the time dimension, but I'm not sure. Did you check the code? So if it is true, that it only works in the time dimension, there are two ways of doing what you want: Repeatedly call topoplotTFR for different frequencies, or adjust the function such that it also works the other way. Maybe you could look into if and why the assignment of the yparam and xparam should always be 'time', and 'freq' respectively. I guess the original reason stems from the fact that we are used to depict TFRs like that. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TX.TECHNION.AC.IL Thu Mar 1 16:22:24 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 15:22:24 -0000 Subject: TopoplotTFR In-Reply-To: <002101c75c10$650113b0$f0463ec1@sobell.ion.ucl.ac.uk> Message-ID: Here is my suggestion for a fix. It should handle any number of dimensions, which is perhaps slightly overkill for this case, but hope it works. I tested it for time and frequency. Best, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 2:46 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR I looked at the code and the problem is in line 264 of topoplotER where you assume that the yparam is always the second dimension in the data and the xparam is always the third. When this assumption is false, the code fails. Best, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jan Mathijs Schoffelen Sent: Thursday, March 01, 2007 12:13 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR Oops. I'm sorry, I misread your mail; I thought you were talking about multiplotTFR. Forget what I said before. To my knowledge, a subplotted topoplotTFR only works in the time dimension, but I'm not sure. Did you check the code? So if it is true, that it only works in the time dimension, there are two ways of doing what you want: Repeatedly call topoplotTFR for different frequencies, or adjust the function such that it also works the other way. Maybe you could look into if and why the assignment of the yparam and xparam should always be 'time', and 'freq' respectively. I guess the original reason stems from the fact that we are used to depict TFRs like that. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: topoplotER.m URL: From Brian.Roach at YALE.EDU Fri Mar 2 00:02:50 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 1 Mar 2007 18:02:50 -0500 Subject: sourceanalysis.m on EEG data In-Reply-To: <45D1E6AA.3080708@uke.uni-hamburg.de> Message-ID: Till, Thanks so much for the tutorial document. After a recent grant submission, we have some time to really dig into this, and I have a question for you: from the doc... 1) Create BEM model using the following example script (link to 'BEM example script'): - create brain, skull and skin compartments using volumesegment.m and image processing functions - use these compartments as input for the prepare_bemmodel.m function (which uses the C-Program 'Dipoli', available upon request ) ... Do you have a BEM example script, or should I try to use what is listed on the field trip website (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:create_bem_headmodel_for_eeg)? I wasn't sure which you intended to have someone use. thanks, Brian At 11:26 AM 2/13/2007, you wrote: >Dear Brian, > >I`ve worked with the prepare_bemmodel script for constructing a forward >model for source localization of EEG data. Find attached a little tutorial >with the steps I took for creating the BEM from an individual MRI. The >plan is to put it also on the fieldtrip wiki (sooner or later). Please let >me know if you have questions on this tutorial. > >Hope this helps, >Till > > >Robert Oostenveld schrieb: >>The prepare_bemmodel function is in the zip file on the ftp server. The >>dipoli executable is attached to this mail. There exists only a linux >>i386 and an apple PPC version. You are not permitted to distribute the >>dipoli executable, it is not covered under the GPL license but made >>available courtesy of Thom Oostendorp. >> >>best regards, >>Robert >> >>On 12 Feb 2007, at 22:32, Brian Roach wrote: >> >>>Where can I find these functions listed below? >>> >>>% the prepare_bemmodel function is available upon request % the dipoli >>>stand-alone executable is available upon request >> > > From weisz at LYON.INSERM.FR Fri Mar 2 18:40:12 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Fri, 2 Mar 2007 18:40:12 +0100 Subject: first steps using lcmv Message-ID: Hi everyone, in order to explore the usage of the lcmv option of sourceanalysis i'm using eeg data (35 electrodes) with an auditory N1. topography is attached. within fieldtrip i did a dipolefit, and the output looks relatively sensible (perhaps a little deep and posterior, but overall not bad for EEG :-)). however when i run lcmv sourceanalysis, plotting the "neural activation index" gives me something really terrible (also attached). since the "solution" appears relatively clear in this case, i guess i have done something stupid at some point. the steps: dat=eeglab2fieldtrip(EEG,'preprocessing'); cfg=[]; cfg.latency=[.09 .12]; %latency of my N1 cfg.covariance='yes'; cfg.keeptrials='yes'; datTest=timelockanalysis(cfg,dat); vol = []; vol.r = [0.88 0.92 1.00]*85; vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; cfg=[]; cfg.vol=vol; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; [grid] = prepare_leadfield(cfg, datTest); %the same LF-matrix used for 'good' dipole fit cfg=[]; cfg.grid=source2sparse(grid); cfg.method='lcmv'; cfg.vol=vol; cfg.projectnoise='yes'; [sourceN1] = sourceanalysis(cfg, datTest); cfg=[]; cfg.powmethod='none'; %only option that works [sourcenai] = sourcedescriptives(cfg, sourceN1); cfg =[]; cfg.funparameter = 'nai'; sourceN1F=source2full(sourcenai); [interp]=sourceinterpolate(cfg,sourceN1F,mri); sliceinterp(cfg,interp) I'd really appreciate pointers of what I may be doing wrong. thanks a lot, nathan ps: as for the mri, i'm using the mri in MRI4Fieldtrip with coordinates transformed to conform my headmodel coordinates. -------------- next part -------------- A non-text attachment was scrubbed... Name: N1Topo.png Type: application/applefile Size: 70 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1Topo.png Type: image/png Size: 23336 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1DipoleFit.png Type: application/applefile Size: 75 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1DipoleFit.png Type: image/png Size: 64060 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1LCMV.png Type: application/applefile Size: 70 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1LCMV.png Type: image/png Size: 197863 bytes Desc: not available URL: -------------- next part -------------- From t.schneider at UKE.UNI-HAMBURG.DE Fri Mar 2 18:17:04 2007 From: t.schneider at UKE.UNI-HAMBURG.DE (Till Schneider) Date: Fri, 2 Mar 2007 18:17:04 +0100 Subject: sourceanalysis.m on EEG data In-Reply-To: <6.1.2.0.2.20070301175929.027d6eb0@email.med.yale.edu> Message-ID: Dear Brian, basically you can use the example script from the field trip website. Additionally, I attach the script we used for most of our subjects. We made some slight changes, in order to adapt it to our individual MRIs. We had for example a very large Field of View containing the whole neck, so we dropped these voxels. You have to adapt the script to your images and make some plots in between to check the results of the intermediate steps (e.g. with sourceplot.m). To align the indiviual electrode positions to the headmodel you can use the fieldtrip function electroderealign.m. See the example script: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:align_eeg_electrode_positions_to_bem_headmodel for usage. Best regards, Till Brian Roach schrieb: > Till, > > Thanks so much for the tutorial document. After a recent grant > submission, we have some time to really dig into this, and I have a > question for you: > > from the doc... > 1) Create BEM model using the following example script (link to > 'BEM example script'): > - create brain, skull and skin compartments using volumesegment.m and > image processing functions > - use these compartments as input for the prepare_bemmodel.m function > (which uses the C-Program 'Dipoli', available upon request ) > > ... > Do you have a BEM example script, or should I try to use what is > listed on the field trip website > (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:create_bem_headmodel_for_eeg)? > > I wasn't sure which you intended to have someone use. > > thanks, > Brian > At 11:26 AM 2/13/2007, you wrote: >> Dear Brian, >> >> I`ve worked with the prepare_bemmodel script for constructing a >> forward model for source localization of EEG data. Find attached a >> little tutorial with the steps I took for creating the BEM from an >> individual MRI. The plan is to put it also on the fieldtrip wiki >> (sooner or later). Please let me know if you have questions on this >> tutorial. >> >> Hope this helps, >> Till >> >> >> Robert Oostenveld schrieb: >>> The prepare_bemmodel function is in the zip file on the ftp server. >>> The dipoli executable is attached to this mail. There exists only a >>> linux i386 and an apple PPC version. You are not permitted to >>> distribute the dipoli executable, it is not covered under the GPL >>> license but made available courtesy of Thom Oostendorp. >>> >>> best regards, >>> Robert >>> >>> On 12 Feb 2007, at 22:32, Brian Roach wrote: >>> >>>> Where can I find these functions listed below? >>>> >>>> % the prepare_bemmodel function is available upon request % the >>>> dipoli stand-alone executable is available upon request >>> >> >> > > -- Till Schneider, Dipl.Psych. Universitaetsklinikum Hamburg-Eppendorf Institut fuer Neurophysiologie und Pathophysiologie Martinistr. 52 20246 Hamburg Germany tel +49-40-42803-3188 fax +49-40-42803-7752 mobil +49-178-2834030 -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf Körperschaft des öffentlichen Rechts Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Jörg F. Debatin (Vorsitzender) Dr. Alexander Kirstein Ricarda Klein Prof. Dr. Rolf A.K. Stahl -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: createbem_example.m URL: From muthuraman10 at HOTMAIL.COM Mon Mar 5 10:42:17 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Mon, 5 Mar 2007 09:42:17 +0000 Subject: Plotting using Slice! In-Reply-To: <010201c75a63$4710e460$642dae83@fcdonders.nl> Message-ID: Hello, Thanks for the reply, i am little confused at this stage okay, to make things clear in the fieldtrip documentation page it is given that i need to specify the anatomy of the data for the source plot in which case i do not have a anatomical MRI, next if i can follow the steps as you have mentioned to plot using 'slice' with the functional data in my case 'coh' coherence Because i cannot use sourceinterpolate.m or volumenormalize.m without any anatomical data these are my configuration steps on the way to 'DICS' in which the eleclead1 contains the locations for the 64 electrodes from the sphere2 standard locations from the fieldtrip page %SOURCE ANALYSIS DICS elec = []; elec.pnt = randn(64,3); load('C:\muthu\work\fieldtrip-20070222\eleclead1.mat') dum = sqrt(sum(elec.pnt.^2,2)); elec.pnt = 12 * elec.pnt ./ [dum dum dum]; vol = []; vol.r = 12 * [0.88 0.92 1.00]; vol.c = [1 1/80 1]; vol.o = [0 0 0]; cfg1 = []; cfg1.elec = elec; cfg1.vol = vol; cfg1.resolution = 2; grid = prepare_leadfield(cfg1); cfg.frequency=9; cfg.method='dics'; cfg.grid=grid; cfg.elec=elec; cfg.vol=vol; [source]=sourceanalysis(cfg,freqmtmfft); What is the configuration for the source plot can be use to plot? So in this case my functional data for the source plot to be coherence 'coh' cfg1.method='slice'; cfg1.funparameter='coh'; cfg1.maskparameter='coh'; cfg1.volume=vol; cfg1.nslices = 20; cfg1.slicedim = 3; sourceplot(cfg1,'..'); Thanking you With regards M.Muthuraman. >From: Ingrid Nieuwenhuis >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] Plotting using Slice! >Date: Tue, 27 Feb 2007 12:34:44 +0100 > >Hi Muthuraman, > >What are you trying to plot? Could you send which fields are in your >freqmtmfft? > >Bests Ingrid > >-----Original Message----- >From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf >Of Muthuraman Muthuraman >Sent: Tuesday, February 27, 2007 12:20 PM >To: FIELDTRIP at NIC.SURFNET.NL >Subject: [FIELDTRIP] Plotting using Slice! > >Hello Fieldtrippers, > >I am not sure whether this mail has reached the group ! I am sending it >again ! >Thanks for the answer, i tried to plot using the source plot with this >configuration >and i get the error, in this case should i need to transform the data >before > >plotting using slice >any comments on this > >cfg.method='slice'; >cfg.funparameter='coh'; >cfg.nslices = 20; >cfg.slicedim = 3; >sourceplot(cfg,freqmtmfft); >??? Reference to non-existent field 'dim'. > >Error in ==> fieldtrip-20070222\private\grid2transform at 9 >if ~isfield(volume, 'xgrid'), volume.xgrid=1:volume.dim(1); end > >Error in ==> sourceplot at 189 >data = grid2transform(data); > >Thanking you > >With regards >M.Muthuraman. > >_________________________________________________________________ >News and updates from Indian diaspora http://content.msn.co.in/NRI/Default _________________________________________________________________ Gossips, movie reviews, photogallery and more http://content.msn.co.in/Entertainment/Default From r.oostenveld at FCDONDERS.RU.NL Mon Mar 5 17:56:33 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 5 Mar 2007 17:56:33 +0100 Subject: first steps using lcmv In-Reply-To: Message-ID: Hi Nathan, On 2 Mar 2007, at 18:40, Nathan Weisz wrote: > in order to explore the usage of the lcmv option of sourceanalysis > i'm using eeg data (35 electrodes) with an auditory N1. topography > is attached. within fieldtrip i did a dipolefit, and the output > looks relatively sensible (perhaps a little deep and posterior, but > overall not bad for EEG :-)). however when i run lcmv > sourceanalysis, plotting the "neural activation index" gives me > something really terrible (also attached). since the "solution" > appears relatively clear in this case, i guess i have done > something stupid at some point. Given that you do not report explicit errors, I suspect problems with different coordinates The topography looks ok, and the source from DIPOLEFITTING seems to match. I don't know whether the small number of electrodes would be a problem for beaming the data. > cfg=[]; > cfg.latency=[.09 .12]; %latency of my N1 > cfg.covariance='yes'; > cfg.keeptrials='yes'; > datTest=timelockanalysis(cfg,dat); You may want to specify cfg.covariancewindow as well. Please read the emails on the list from last week between Marie and me for an explanation on te hcomputation of the covariance. Marie has some meaningfull ideas here (I visited her last Friday and we were able to discuss this directly), but they have not yet been implemented in FT. > cfg=[]; > cfg.vol=vol; > cfg.grid.xgrid='auto'; > cfg.grid.ygrid='auto'; > cfg.grid.zgrid='auto'; > [grid] = prepare_leadfield(cfg, datTest); %the same LF-matrix used > for 'good' dipole fit Are the dipoles (grid.pos) in mm? It should be in mm, just as your head model. Note that beamforming is much more sensitive to head model misspecification than plain dipolefitting, so you may want to use a (standard) BEM model instead of a spherical model. > cfg=[]; > cfg.grid=source2sparse(grid); > cfg.method='lcmv'; > cfg.vol=vol; > cfg.projectnoise='yes'; > [sourceN1] = sourceanalysis(cfg, datTest); I would expect a problem here for you, since the default noise estimate in case of EEG should be zero. The noise (for the projection) is estimated by taking the smallest singular value of the covariance matrix, and given that the ata is supposed to be avg- referenced, the smallest singular value should be zero. I.e. it should give a warning about the matrix being rank-deficient. The solution to that is to explicitely noise regularize using cfg.lambda. > cfg=[]; > cfg.powmethod='none'; %only option that works > [sourcenai] = sourcedescriptives(cfg, sourceN1); Since you have not specified anything fancy in the lcmv beamformer, you indeed do not have to post-process your power here (that requires cfg.powmethod=something). > cfg =[]; > cfg.funparameter = 'nai'; > sourceN1F=source2full(sourcenai); > [interp]=sourceinterpolate(cfg,sourceN1F,mri); I suspect the problem here: please explicitely specyfy cfg.sourceunits and cfg.mriunits. > sliceinterp(cfg,interp) please use sourceplot with cfg.method='slice' instead (sliceinterp is deprecated). > I'd really appreciate pointers of what I may be doing wrong. Not related to the reported problem, but very important in general is the referencing: please ensure that your data is averaged referenced before computing the covariance. The options cfg.preproc.refef='yes' and cfg.preproc.refchan='all' in timelockanalysis should do that for you. You can easily check by summing the potential over all channels: the sum should be zero at every sample. I hope this helps, Robert From gmcauley at LLU.EDU Tue Mar 6 03:32:41 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Mon, 5 Mar 2007 18:32:41 -0800 Subject: Investigating Fieldtrip Message-ID: Hello, I have been asked to help with the analysis of some fetal sheep EEG data. I have a pretty good programing background, and some MATLAB experience, but am lacking in EEG and related background. What we want to do seems rather simple compared to what it looks like Fieldtrip can do. So, before really diving in, it would be helpful to know if this is the right tool for our problem and not overkill. Basically, we need to: 1) Open time series data that is in ASCII format. The data is just one or two channels of potentials from one or two electrodes sampled at 200Hz. 2) Identify regions in the data that have 'high voltage/low frequency' or 'low voltage/high frequency'. (Perhaps this could be determined based on average in data region vs average potential of whole data set). 3) Calculate power spectra for the data regions. 4) Calculate spectral edge frequencies for the data regions 5) Do some simple statistics comparing data regions (eg, spectral edge frequency of controls vs experimental group). 6) Creating m files to automate as much as possible. So my questions are: 1) Is this straight forward to do in Fieldtrip? 2) Do we need anything more than the MATLAB program itself (ie, do we need any other MATLAB toolboxes)? 3) Is there another (free) library that might be better for this kind of a problem? Answers to these questions would be very help and much appreciated. ~ Grant -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From c.hesse at FCDONDERS.RU.NL Tue Mar 6 08:59:57 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 6 Mar 2007 08:59:57 +0100 Subject: Investigating Fieldtrip In-Reply-To: <1173148361.31521.117.camel@localhost.localdomain> Message-ID: Hi Grant, > Basically, we need to: > 1) Open time series data that is in ASCII format. The data is just > one > or two channels of potentials from one or two electrodes sampled at > 200Hz. Assuming that the data format can be read using standard Matlab file I/O functions (fread or dlmread) all that is required is then to convert the data into an appropriate FieldTrip (FT) data structure. This will work best if your data naturally divides into "trials" or epochs, but in principle you can also define intervals of arbitrary length with arbitrary overlap (which may be useful for subsequent spectral / time-frequency analysis). > 2) Identify regions in the data that have 'high voltage/low frequency' > or 'low voltage/high frequency'. (Perhaps this could be determined > based on average in data region vs average potential of whole data > set). There are several ways in which this could be accomplished in FT. > 3) Calculate power spectra for the data regions. > > 4) Calculate spectral edge frequencies for the data regions > > 5) Do some simple statistics comparing data regions (eg, spectral edge > frequency of controls vs experimental group). All easy. > 6) Creating m files to automate as much as possible. That's the essence of FT philosophy :-) > So my questions are: > > 1) Is this straight forward to do in Fieldtrip? Mostly, yes. However, you may need to write the odd small function yourself, which is then passed to and called by FT: at the end of the day, FT is merely a "box of tools" :-) > 2) Do we need anything more than the MATLAB program itself (ie, do we > need any other MATLAB toolboxes)? FT has been written to be as "stand alone" as possible, so you should be OK. I could imagine that the only other Matlab Toolboxes you might need are the Statistics Toolbox (to do paramteric tests, FT can do non-parametric permutation tests using any statistic/measure derived from your data) based on permutation) and perhaps the Signal Processing Toolbox (although I am pretty sure that FT is now self- sufficient there). > 3) Is there another (free) library that might be better for this > kind of > a problem? Not sure about free ones ... you could always write your own stuff in Matlab, I guess. Hope this helps, Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Mar 6 10:29:15 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 Mar 2007 10:29:15 +0100 Subject: No subject In-Reply-To: Message-ID: Hi Sameer, One small comment to start with: please use a subject in your emails to the list. That makes it easier to keep track of discussions and threads. On 28 Feb 2007, at 21:59, Sameer Walawalkar wrote: > I am currently experimenting with beamformers and was playing with > http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:use_your_own_forward_leadfield_model_in_an_ > inverse_beamformer_computation > to generate the grid. You have 306ch Neuromag data, and I don't recall exactly whether that has been fully tested for forward computations. Some background: at each of the 102 locations of each "chip" you have 3 channels: two of those have 2 coils, and one is a magnetometer with only one coil. Please have a look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_are_electrodes _magnetometers_or_gradiometers_described for the description of "grad". I would expect in your case that grad.pnt and ori 102*2+102*2+102= 510 rows long, each with 3 columns grad.tra 306 x 510 The gradiometer coils are shifted w.r.t. the center of the "chip" by a small amount. I think that currently the baseline (i.e. the distance between the coils) is hardcoded. Joachim Gross once gave me code for that, it is included in feldtrip/private/fif2grad. Please look at it and see whether it applies to your 306ch gradiometer design as well. > > I did the following > > > vol = []; > vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius > is 12 cm > vol.c = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; % center of sphere this indicates a 4-shell concentric-sphere EEG model. It does not make sense for MEG, since in MEG teh conductivity of the different layers in the spherical model does not affect the field distribution. > % compute the leadfields that can be used for the beamforming > cfg = []; > cfg.vol = vol; > cfg.resolution = 2; % same unit as above, i.e. in cm > grid = prepare_leadfield(cfg, dataPre); > > (I expect prepare_leadfield to pick up grad definitions from the data) > > ??? Error using ==> fieldtrip/private/compute_leadfield > different number of spheres for the radius and origin FT works with MEG either with a single sphere or multisphere models, i.e. vol.r = 12 vol.o = [0 0 5] This origin is a better guess for the center of the sphere, remember that in the MEG case you do not move the sensors towards the head, but the position of the sensors (coils) is expressed with respect to the head coordinate system. In case of EEG, it is more common to use standard electrodes that are moved towards the head. You can use HEADMODELPLOT to look at the geometry of the sensors and head model. A multisphere model contains a sinsgle sphere for each sensor. Actually, for the forward computation it should contain a single sphere for each coil. Multisphere models currently are not implemented for Neuromag data. The reason for the error is that FT is confused about it being not a single-sphere, but also not a multi-sphere model. Also your later errors are explained by that. Please use a single sphere model. Or alternatively you can use a realistic single-shell (Nolte) model, which is more accurate than the multi-sphere models, but I suggest first to try around with a single sphere. The most important thing for you to check is whether the grad structure is geometrically correct. Lauri Parkonen will probably be able to help you with checking that. best regards, Robert > Error in ==> prepare_leadfield at 209 > grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), > sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); > > Error in ==> SomeMaster at 15 > grid = prepare_leadfield(cfg, dataPre); > > > > To get around this error, I change vol to > > vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ]; > > ??? Error using ==> fieldtrip/private/compute_leadfield > number of spheres is not equal to the number of coils > > Error in ==> prepare_leadfield at 209 > grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), > sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); > > Error in ==> SomeMaster at 15 > grid = prepare_leadfield(cfg, dataPre); > > > I thought this might be due to the 4 HPI coils, so I changed vol to > vol.r = 12 * [0.88 0.92 0.96 1.00]; > vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ; 0 0 0 ]; > > but it was of no use. > > Any suggestions? > > Thanks, > sameer > From P.vandenHurk at CS.RU.NL Tue Mar 6 15:55:53 2007 From: P.vandenHurk at CS.RU.NL (P.vandenHurk) Date: Tue, 6 Mar 2007 15:55:53 +0100 Subject: No subject In-Reply-To: <692D7E98-7D1F-4398-8C9C-AB7D829A273B@fcdonders.ru.nl> Message-ID: Hello, Each time I use the 'read_fcdc_event' function, I get the following error: ??? Error using ==> read_event type field not defined for each event Error in ==> read_fcdc_event at 51 [event] = read_event(varargin{:}); Can you tell me how I can fix this error? Thanks, Best regards, Paul Robert Oostenveld schreef: > Hi Sameer, > > One small comment to start with: please use a subject in your emails > to the list. That makes it easier to keep track of discussions and > threads. > > On 28 Feb 2007, at 21:59, Sameer Walawalkar wrote: >> I am currently experimenting with beamformers and was playing with >> http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:use_your_own_forward_leadfield_model_in_an_inverse_beamformer_computation >> >> to generate the grid. > > You have 306ch Neuromag data, and I don't recall exactly whether that > has been fully tested for forward computations. Some background: at > each of the 102 locations of each "chip" you have 3 channels: two of > those have 2 coils, and one is a magnetometer with only one coil. > > Please have a look at > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:frequently_asked_questions#how_are_electrodes_magnetometers_or_gradiometers_described > > for the description of "grad". I would expect in your case that > grad.pnt and ori 102*2+102*2+102= 510 rows long, each with 3 columns > grad.tra 306 x 510 > > The gradiometer coils are shifted w.r.t. the center of the "chip" by a > small amount. I think that currently the baseline (i.e. the distance > between the coils) is hardcoded. Joachim Gross once gave me code for > that, it is included in feldtrip/private/fif2grad. Please look at it > and see whether it applies to your 306ch gradiometer design as well. > >> >> I did the following >> >> >> vol = []; >> vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is >> 12 cm >> vol.c = [1 1/80 1]; % conductivity >> vol.o = [0 0 0]; % center of sphere > > this indicates a 4-shell concentric-sphere EEG model. It does not make > sense for MEG, since in MEG teh conductivity of the different layers > in the spherical model does not affect the field distribution. > >> % compute the leadfields that can be used for the beamforming >> cfg = []; >> cfg.vol = vol; >> cfg.resolution = 2; % same unit as above, i.e. in cm >> grid = prepare_leadfield(cfg, dataPre); >> >> (I expect prepare_leadfield to pick up grad definitions from the data) >> >> ??? Error using ==> fieldtrip/private/compute_leadfield >> different number of spheres for the radius and origin > > FT works with MEG either with a single sphere or multisphere models, i.e. > vol.r = 12 > vol.o = [0 0 5] > This origin is a better guess for the center of the sphere, remember > that in the MEG case you do not move the sensors towards the head, but > the position of the sensors (coils) is expressed with respect to the > head coordinate system. In case of EEG, it is more common to use > standard electrodes that are moved towards the head. You can use > HEADMODELPLOT to look at the geometry of the sensors and head model. > > A multisphere model contains a sinsgle sphere for each sensor. > Actually, for the forward computation it should contain a single > sphere for each coil. Multisphere models currently are not implemented > for Neuromag data. > > The reason for the error is that FT is confused about it being not a > single-sphere, but also not a multi-sphere model. Also your later > errors are explained by that. Please use a single sphere model. Or > alternatively you can use a realistic single-shell (Nolte) model, > which is more accurate than the multi-sphere models, but I suggest > first to try around with a single sphere. The most important thing for > you to check is whether the grad structure is geometrically correct. > Lauri Parkonen will probably be able to help you with checking that. > > best regards, > Robert > > >> Error in ==> prepare_leadfield at 209 >> grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), >> sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); >> >> Error in ==> SomeMaster at 15 >> grid = prepare_leadfield(cfg, dataPre); >> >> >> >> To get around this error, I change vol to >> >> vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ]; >> >> ??? Error using ==> fieldtrip/private/compute_leadfield >> number of spheres is not equal to the number of coils >> >> Error in ==> prepare_leadfield at 209 >> grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), >> sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); >> >> Error in ==> SomeMaster at 15 >> grid = prepare_leadfield(cfg, dataPre); >> >> >> I thought this might be due to the 4 HPI coils, so I changed vol to >> vol.r = 12 * [0.88 0.92 0.96 1.00]; >> vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ; 0 0 0 ]; >> >> but it was of no use. >> >> Any suggestions? >> >> Thanks, >> sameer >> -- ----------------------------------------------------------- Paul van den Hurk Joint Principal Investigator Mindfulness Project Inserm U280, Lyon, France, Radboud University Nijmegen: Department of computer sciences and Department of Medical Physics and Biophysics/126 Geert Grooteplein 21 6525 EZ Nijmegen Email: P.vandenHurk at cs.ru.nl Tel: 024-3613326 From gmcauley at LLU.EDU Tue Mar 6 18:41:38 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Tue, 6 Mar 2007 09:41:38 -0800 Subject: Investigating Fieldtrip In-Reply-To: Message-ID: Thanks Christian for your helpful reply. FT is sounding very good! > > > 2) Do we need anything more than the MATLAB program itself (ie, do > > we > > need any other MATLAB toolboxes)? > > > FT has been written to be as "stand alone" as possible, so you should > be OK. I could imagine that the only other Matlab Toolboxes you might > need are the Statistics Toolbox (to do paramteric tests, FT can do > non-parametric permutation tests using any statistic/measure derived > from your data) based on permutation) and perhaps the Signal > Processing Toolbox (although I am pretty sure that FT is now > self-sufficient there). > My only immediate remaining question is about if FT is dependent on the MATLAB Signal Processing Toolbox (Statistic Toolbox does not matter). Definite confirmation here would be very helpful. ~ Grant > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From c.hesse at FCDONDERS.RU.NL Wed Mar 7 09:10:48 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 7 Mar 2007 09:10:48 +0100 Subject: Investigating Fieldtrip In-Reply-To: <1173202898.31521.133.camel@localhost.localdomain> Message-ID: Hi Grant, > Thanks Christian for your helpful reply. > > FT is sounding very good! > My only immediate remaining question is about if FT is dependent on > the > MATLAB Signal Processing Toolbox (Statistic Toolbox does not matter). > > Definite confirmation here would be very helpful. For spectral estimation / analysis FT depends only on the FFT function which is part of the basic Matlab package. For signal filtering, you need the signal processing toolbox in order to design your filters, e.g., a 4th order Butterworth band pass filter, but if you generate the filter coefficients (or the polynomial coefficients of the transfer function) yourself, then you can use the FILTER function with those coefficients which is again part of the basic Matlab. I guess you're mainly interested in spectral analysis of your signal rather than filtering, so you should be able get away without the Signal Processing Toolbo (however, I would recommend getting a copy in order to take full advantage of all FT functionality). Hope that helps, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 6 16:53:58 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 6 Mar 2007 16:53:58 +0100 Subject: No subject In-Reply-To: <45ED80F9.6060007@cs.ru.nl> Message-ID: Hi Paul, in order to be able to help you, can you please specify which type of data format you are trying to read events from? > Hello, > > Each time I use the 'read_fcdc_event' function, I get the following > error: > > ??? Error using ==> read_event > type field not defined for each event > > Error in ==> read_fcdc_event at 51 > [event] = read_event(varargin{:}); > > Can you tell me how I can fix this error? We'll fix the error if there is one, we give you advice on how to avoid them :-) Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From P.vandenHurk at CS.RU.NL Wed Mar 7 13:48:37 2007 From: P.vandenHurk at CS.RU.NL (P.vandenHurk) Date: Wed, 7 Mar 2007 13:48:37 +0100 Subject: No subject In-Reply-To: Message-ID: Hello Christian, I am sorry, but of course. It is a .bdf file. The read_fcdc_header function does work by the way. Regards, Paul Christian Hesse schreef: > Hi Paul, > > in order to be able to help you, can you please specify which type of > data format you are trying to read events from? > >> Hello, >> >> Each time I use the 'read_fcdc_event' function, I get the following >> error: >> >> ??? Error using ==> read_event >> type field not defined for each event >> >> Error in ==> read_fcdc_event at 51 >> [event] = read_event(varargin{:}); >> >> Can you tell me how I can fix this error? > > We'll fix the error if there is one, we give you advice on how to > avoid them :-) > > Regards, > Christian > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > -- ----------------------------------------------------------- Paul van den Hurk Joint Principal Investigator Mindfulness Project Inserm U280, Lyon, France, Radboud University Nijmegen: Department of computer sciences and Department of Medical Physics and Biophysics/126 Geert Grooteplein 21 6525 EZ Nijmegen Email: P.vandenHurk at cs.ru.nl Tel: 024-3613326 From gmcauley at LLU.EDU Wed Mar 7 17:01:09 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Wed, 7 Mar 2007 08:01:09 -0800 Subject: Investigating Fieldtrip In-Reply-To: Message-ID: Thank you for your reply. On Wed, 2007-03-07 at 09:10 +0100, Christian Hesse wrote: > Hi Grant, > > > Thanks Christian for your helpful reply. > > > > > > FT is sounding very good! > > > My only immediate remaining question is about if FT is dependent on > > the > > MATLAB Signal Processing Toolbox (Statistic Toolbox does not > > matter). > > > > > > Definite confirmation here would be very helpful. > > > For spectral estimation / analysis FT depends only on the FFT function > which is part of the basic Matlab package. For signal filtering, you > need the signal processing toolbox in order to design your filters, > e.g., a 4th order Butterworth band pass filter, but if you generate > the filter coefficients (or the polynomial coefficients of the > transfer function) yourself, then you can use the FILTER function with > those coefficients which is again part of the basic Matlab. > > > I guess you're mainly interested in spectral analysis of your signal > rather than filtering, so you should be able get away without the > Signal Processing Toolbo (however, I would recommend getting a copy in > order to take full advantage of all FT functionality). Great, at this stage it looks like we can get by without the Signal Processing Toolbox, and can expand if necessary in the future. I will plan to 'dive in' to FT! Thanks again, ~ Grant > > Hope that helps, > Christian > > > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From muthuraman10 at HOTMAIL.COM Wed Mar 7 17:14:56 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Wed, 7 Mar 2007 16:14:56 +0000 Subject: Reference Channel for DICS! Message-ID: Hello, These are the configuration steps of the data for DICS hdr = read_fcdc_header('pd_mof_tr0_c_0306.cnt'); emgindx = strmatch('M', hdr.label); rstindx = setdiff(1:length(hdr.label),emgindx); hdr Fs: 1000 nChans: 64 nSamples: 74520 nSamplesPre: 0 nTrials: 1 label: {1x64 cell} orig: [1x1 struct] %Defining trials trl = []; trl(:,1) = [21:1000:74520-1000]'; trl(:,2) = [1020:1000:74520]'; trl(:,3) = 0; %Data_EEG cfg = []; cfg.dataset = 'pd_mof_tr0_c_0306.cnt'; cfg.trl = trl; cfg.blc = 'yes'; cfg.channel = hdr.label(rstindx); cfg.implicitref='CZ'; cfg.reref='all'; data_eeg = preprocessing(cfg); %Data_EMG cfg.hpfilter = 'yes'; cfg.hpfreq = 10; cfg.channel = hdr.label(emgindx); cfg.refchan='M1'; cfg.blc='yes'; cfg.rectify = 'yes'; data_emg = preprocessing(cfg); data = appenddata([],data_eeg,data_emg); I get the error ??? Error using ==> appenddata cannot determine how the data should be concatenated This is because after including the reference channels with EEG channels are 61 and EMG channels are 5, inorder to execute the DICS method with reference channel these steps are necessary for the CSD to be complete Is there a way to add the data with these two extra reference channels? any comments on this would be appreciated Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It�s cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in From Brian.Roach at YALE.EDU Wed Mar 7 17:35:33 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Wed, 7 Mar 2007 11:35:33 -0500 Subject: units for uncorrected freqanalysis_wltconvol.m Message-ID: FieldTrip Users, I am wondering what the unit scale is for output from the freqanalysis_wltconvol.m function before any type of baseline correction if the input units are microvolts. Is the output magnitude, or magnitude squared (power or power spectra)? Based on this equation from the code: powdum = (2.* abs(autspctrmacttap) ./ data.fsample) .^ 2; I believe abs(autspctrmacttap) = magnitude, and that means powdum = power. If that is the case, I believe I am getting some really huge values compared to the voltage of the pre-processed EEG. Is it possible that I have done something wrong, or is it typically the case for EEG power to be much greater than EEG amplitude? thanks, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From weisz at LYON.INSERM.FR Wed Mar 7 18:08:11 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Wed, 7 Mar 2007 18:08:11 +0100 Subject: first steps using lcmv In-Reply-To: <13CF5947-E369-4D4C-849B-F6444167FA61@fcdonders.ru.nl> Message-ID: hi robert, thanks for your quick help. > Given that you do not report explicit errors, I suspect problems > with different coordinates indeed i overlooked to explicitely state the source and mri-units in sourceinterpolate. the nai-image looks better now, although perhaps a little deep (also sme yellow in the middle; perhaps as a result of correlated bilateral activity?). but it's not the mri of the individual and i still have find out more about the usage and the options of sourceanalysis. > I don't know whether the small number of electrodes would be a > problem for beaming the data. don't know too ... but van Veen et al. used even less in their 1997 paper. > Are the dipoles (grid.pos) in mm? It should be in mm, just as your > head model. Note that beamforming is much more sensitive to head > model misspecification than plain dipolefitting, so you may want to > use a (standard) BEM model instead of a spherical model. i found a standard bem in the dipfit plugin folder of eeglab (standard_vol.mat). >> vol vol = bnd: [1x3 struct] cond: [0.3300 0.0041 0.3300] mat: [3000x3000 double] type: 'dipoli' i guess that i can simply exchange my standard spherical model (same as in eeglab) and use this bem volume for calculating the leadfield. one aspect are the electrode locations: the positions are given on a sphere ... so probably there'll has to be some transformation of the positions. > please use sourceplot with cfg.method='slice' instead (sliceinterp > is deprecated). still used sliceinterp this time ... found it a little more easy to use. all the best, nathan -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 1.png Type: application/applefile Size: 73 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 1.png Type: image/png Size: 150703 bytes Desc: not available URL: -------------- next part -------------- From P.vandenHurk at CS.RU.NL Thu Mar 8 09:51:36 2007 From: P.vandenHurk at CS.RU.NL (P.vandenHurk) Date: Thu, 8 Mar 2007 09:51:36 +0100 Subject: problem using read_fcdc_event function In-Reply-To: <8A3F5CCB-C26C-46E7-BE2C-22CF761817E0@lyon.inserm.fr> Message-ID: Hello, Is it possible to work with .bdf files in the fieldtrip environment? I am asking because I have this problem with the read_fcdc_event function (by the way I don't have any problems when I use the read_fcdc_header function)? Thanks for your comment, Kind regards, Paul Nathan Weisz schreef: > hi robert, > > thanks for your quick help. > >> Given that you do not report explicit errors, I suspect problems with >> different coordinates > > indeed i overlooked to explicitely state the source and mri-units in > sourceinterpolate. > > the nai-image looks better now, although perhaps a little deep (also > sme yellow in the middle; perhaps as a result of correlated bilateral > activity?). but it's not the mri of the individual and i still have > find out more about the usage and the options of sourceanalysis. > >> I don't know whether the small number of electrodes would be a >> problem for beaming the data. > > don't know too ... but van Veen et al. used even less in their 1997 > paper. > >> Are the dipoles (grid.pos) in mm? It should be in mm, just as your >> head model. Note that beamforming is much more sensitive to head >> model misspecification than plain dipolefitting, so you may want to >> use a (standard) BEM model instead of a spherical model. > > i found a standard bem in the dipfit plugin folder of eeglab > (standard_vol.mat). > > >> vol > > vol = > > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > mat: [3000x3000 double] > type: 'dipoli' > > i guess that i can simply exchange my standard spherical model (same > as in eeglab) and use this bem volume for calculating the leadfield. > one aspect are the electrode locations: the positions are given on a > sphere ... so probably there'll has to be some transformation of the > positions. > >> please use sourceplot with cfg.method='slice' instead (sliceinterp is >> deprecated). > > still used sliceinterp this time ... found it a little more easy to use. > > all the best, > nathan > > > > ------------------------------------------------------------------------ > -- ----------------------------------------------------------- Paul van den Hurk Joint Principal Investigator Mindfulness Project Inserm U280, Lyon, France, Radboud University Nijmegen: Department of computer sciences and Department of Medical Physics and Biophysics/126 Geert Grooteplein 21 6525 EZ Nijmegen Email: P.vandenHurk at cs.ru.nl Tel: 024-3613326 From nicola.ray at DPAG.OX.AC.UK Fri Mar 9 12:01:09 2007 From: nicola.ray at DPAG.OX.AC.UK (Niki Ray) Date: Fri, 9 Mar 2007 12:01:09 +0100 Subject: ICA with averaged data Message-ID: Hi, I'm very new to fieldtrip. I have three questions. I have collected MEG data from patients with a deep brain stimulator implanted. I'd like to do an ICA to reject the stimulator related artifacts. Sometimes the stimulator is on and sometimes off. So my first question is, do i combine all the data together and then perform the ICA, or do i do different ICA analyses for each condition(on and off stimulation), and hence reject different components for each condition? One possibility for deciding wich of the artifacts were related to the stimulator was to use the example matlab script you provide for rejecting ECG components. Some of the channels (about 13, i'm using a ctf 275 system) have a lot of very distinct artifact that is obviously from the stimulator, so i wanted to use one of these channels as the "ECG" channel. Is this sensible, or not?? Finally, I've been getting conflicting advice about whether it is okay to first average data, and then perform an ICA. What do you suggest is the right thing to do? Many thanks! Niki From s.debener at UKE.UNI-HAMBURG.DE Fri Mar 9 13:11:30 2007 From: s.debener at UKE.UNI-HAMBURG.DE (Stefan Debener) Date: Fri, 9 Mar 2007 12:11:30 +0000 Subject: ICA with averaged data In-Reply-To: Message-ID: Hi Niki, It does, in my opinion, not make much sense to average first and then run ICA, you unlikely obtain a robust decomposition this way and may not be able to remove the stimulator artefact. ICA needs quite a few training data to find a decent decomposition, and this is not provided by ERPs, even though some commercial software packages may allow you to apply ICA to ERPs/ERFs. Only if (!) all your data are recorded such that there was no substantial head movement (that is, the position between sensors and sources did not change), you may get a decent artefact IC (or several ICs) from combined data (there is a few more ifs involved, please see previous ICA discussions here and in the EEGLAB mailing list). YI'd suggest using the pca option and decomposse, say, about 50 components, to start with, and then try to optimize the result by playing with the pca option and by running ICAs for separate recording blocks. Best, Stefan Niki Ray wrote: > Hi, > I'm very new to fieldtrip. I have three questions. I have collected MEG > data from patients with a deep brain stimulator implanted. I'd like to do an > ICA to reject the stimulator related artifacts. Sometimes the stimulator is > on and sometimes off. So my first question is, do i combine all the data > together and then perform the ICA, or do i do different ICA analyses for > each condition(on and off stimulation), and hence reject different > components for each condition? > > One possibility for deciding wich of the artifacts were related to the > stimulator was to use the example matlab script you provide for rejecting > ECG components. Some of the channels (about 13, i'm using a ctf 275 system) > have a lot of very distinct artifact that is obviously from the stimulator, > so i wanted to use one of these channels as the "ECG" channel. Is this > sensible, or not?? > > Finally, I've been getting conflicting advice about whether it is okay to > first average data, and then perform an ICA. What do you suggest is the > right thing to do? > > Many thanks! > Niki > > > From ychen at BME.UFL.EDU Fri Mar 9 15:11:30 2007 From: ychen at BME.UFL.EDU (Y Chen) Date: Fri, 9 Mar 2007 15:11:30 +0100 Subject: Problem with BESA coordinate system Message-ID: Hi, I used "besa2fieldtrip.m" and "read_fcdc_elec.m" to load BESA .avr file and .sfp electrode file, then used "topoplotEP.m" and got the attached plot. Looks like the coordinate is wrong (90 degree shift). Form your website introduction, the BESA coordinate is right. However in the software implementation, would you please double check it? I could send in my files if you want. Thanks. Chen -------------- next part -------------- A non-text attachment was scrubbed... Name: BESALayout.jpg Type: image/pjpeg Size: 49488 bytes Desc: not available URL: From Brian.Roach at YALE.EDU Sat Mar 10 01:00:59 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Fri, 9 Mar 2007 19:00:59 -0500 Subject: strel_bol function for creating a head model Message-ID: FT users, This tutorial (http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:create_bem_headmodel_for_eeg) calls a function "strel_bol", which I do not have in my matlab library. Does anyone have this function? Is it from one of the toolboxes, FieldTrip, or some other location? I have just downloaded the latest F.T. version and cannot find this function. thanks, Brian From r.oostenveld at FCDONDERS.RU.NL Sun Mar 11 14:48:54 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Sun, 11 Mar 2007 14:48:54 +0100 Subject: strel_bol function for creating a head model In-Reply-To: <6.1.2.0.2.20070309185908.01c4a550@email.med.yale.edu> Message-ID: Dear Brian please find it attached. It is a simple function that I wrote, but it is not used in FieldTrip proper and therefore not included in the zip file. Note that it constructs a spherical smoothing kernel ("structural element"=strel in image processing terminology). Sphere is "bol" in Dutch. best regards, Robert On 10 Mar 2007, at 1:00, Brian Roach wrote: > FT users, > > This tutorial (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:create_bem_headmodel_for_eeg) calls a > function "strel_bol", which I do not have in my matlab library. > Does anyone have this function? Is it from one of the toolboxes, > FieldTrip, or some other location? I have just downloaded the > latest F.T. version and cannot find this function. > > thanks, > Brian -------------- next part -------------- A non-text attachment was scrubbed... Name: strel_bol.m Type: application/octet-stream Size: 442 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Sun Mar 11 15:05:42 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Sun, 11 Mar 2007 15:05:42 +0100 Subject: ICA with averaged data In-Reply-To: Message-ID: Dear Niki On 9 Mar 2007, at 12:01, Niki Ray wrote: > Some of the channels (about 13, i'm using a ctf 275 system) > have a lot of very distinct artifact that is obviously from the > stimulator, > so i wanted to use one of these channels as the "ECG" channel. Is this > sensible, or not?? The demo script on http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:use_independent_component_analysis_ica_to_rem ove_ecg_artifacts uses the measured real ECG channel to facilitate finding the ICA components that represent the heart artifact. It does that by computing the QRS–pek triggererd average of the ICA components, and by computing the coherence between all ICA components and the ECG channel. In your case, you do not seem to have an external channel that can act as the ECG channel in the demo script. However, important is that the ECG channel is _only_ used to facilitate finding the heart components and it does not have a fundamental role in the ICA unmixing or rejection. Apparently you can detect the artifact components in your data in some other way, so you should be fine without a fake ECG channel. best regards Robert From r.oostenveld at FCDONDERS.RU.NL Sun Mar 11 15:12:13 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Sun, 11 Mar 2007 15:12:13 +0100 Subject: Problem with BESA coordinate system In-Reply-To: Message-ID: Dear Chen On 9 Mar 2007, at 15:11, Y Chen wrote: > I used "besa2fieldtrip.m" and "read_fcdc_elec.m" to load BESA .avr > file > and .sfp electrode file, then used "topoplotEP.m" and got the attached > plot. Looks like the coordinate is wrong (90 degree shift). Form your > website introduction, the BESA coordinate is right. However in the > software implementation, would you please double check it? I could > send in > my files if you want. Thanks. The read_fcdc_elec does not know about the coordinate system, and just reads the electrode locations in the way they are represented in the file. In FieldTrip we do not have a fixed coordinate system. However, the topoplotting functions do have a fixed layout of the head, i.e. the schematical drawing of the head (the circle, with the triangle as nose and with the ears) always has the nose at the top. The nose position is at the moment not an option that you can specify in topoplot (it might make sense to implement a cfg.noseposition='positiveY' or 'positiveY'). That means that for topoplottting at the moment you have to rotate your electrode positions (elec.pnt) by 90 degrees. best regards, Robert From muthuraman10 at HOTMAIL.COM Mon Mar 12 10:59:19 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Mon, 12 Mar 2007 09:59:19 +0000 Subject: Reference channel! Message-ID: Hello, I am not sure whether it has reached the group so sending it again! sorry for the inconvience incase it has reached the group These are the configuration steps of the data for DICS hdr = read_fcdc_header('pd_mof_tr0_c_0306.cnt'); emgindx = strmatch('M', hdr.label); rstindx = setdiff(1:length(hdr.label),emgindx); hdr Fs: 1000 nChans: 64 nSamples: 74520 nSamplesPre: 0 nTrials: 1 label: {1x64 cell} orig: [1x1 struct] %Defining trials trl = []; trl(:,1) = [21:1000:74520-1000]'; trl(:,2) = [1020:1000:74520]'; trl(:,3) = 0; %Data_EEG cfg = []; cfg.dataset = 'pd_mof_tr0_c_0306.cnt'; cfg.trl = trl; cfg.blc = 'yes'; cfg.channel = hdr.label(rstindx); cfg.implicitref='CZ'; cfg.reref='all'; data_eeg = preprocessing(cfg); %Data_EMG cfg.hpfilter = 'yes'; cfg.hpfreq = 10; cfg.channel = hdr.label(emgindx); cfg.refchan='M1'; cfg.blc='yes'; cfg.rectify = 'yes'; data_emg = preprocessing(cfg); data = appenddata([],data_eeg,data_emg); I get the error ??? Error using ==> appenddata cannot determine how the data should be concatenated This is because after including the reference channels with EEG channels are 61 and EMG channels are 5, inorder to execute the DICS method with reference channel these steps are necessary for the CSD to be complete Is there a way to add the data with these two extra reference channels? any comments on this would be appreciated Thanking you With regards M.Muthuraman _________________________________________________________________ Palate teasers: Straight from Master Chef Sanjeev Kapoor http://content.msn.co.in/Lifestyle/Moreonlifestyle/LifestylePT_101106_1530.htm From Brian.Roach at YALE.EDU Mon Mar 12 18:56:07 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Mon, 12 Mar 2007 13:56:07 -0400 Subject: sourceanalysis.m on EEG data In-Reply-To: <60A04A24-9EC0-462D-893A-32B5E3F1563A@fcdonders.ru.nl> Message-ID: The prepare_bemmodel calls a function "write_tri" when using the dipoli option. I cannot find this function on the server or in any of my downloaded files. Does anyone have it to share? thanks, Brian At 10:09 AM 2/13/2007, Robert Oostenveld wrote: >The prepare_bemmodel function is in the zip file on the ftp server. >The dipoli executable is attached to this mail. There exists only a >linux i386 and an apple PPC version. You are not permitted to >distribute the dipoli executable, it is not covered under the GPL >license but made available courtesy of Thom Oostendorp. > >best regards, >Robert > >On 12 Feb 2007, at 22:32, Brian Roach wrote: > >>Where can I find these functions listed below? >> >>% the prepare_bemmodel function is available upon request % the >>dipoli stand-alone executable is available upon request > > >********************************************************************** > >This warning has been inserted into this email by the mail system >because this email has an attachment named dipoli.zip > >Specific details: > >Be careful when opening Zip files if you're not sure where they >came from. They can be, and have been, used to transfer viruses >and other destructive programs. > >Attachment of this type have been known to carry viruses or >other programs which could be harmful to your computer. > >We would urge you to be certain that you know who this email >comes from and to save it to disk and check it with an >anti-virus program before using the attachment. If there is any >doubt, DO NOT RUN THE ATTACHMENT. > >If you need help, you can contact your local support provider by following >this link: > http://www.yale.edu/its/supportgroups.html >or contact the ITS Help Desk at 785-3200 or 432-9000. > >Please note that the CONTENTS of the attachment have NOT been >examined in any way, the action taken was entirely based on the >name of the attachment. > >********************************************************************** > > From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 12 19:35:20 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 12 Mar 2007 14:35:20 -0400 Subject: help with reading .fif files in Fieldtrip Message-ID: Hello, I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: Warning: Error reading fif-file! terminate called after throwing an instance of 'MathWorks::System::_utException' I simply adapted the settings for reading a continuous data set from the tutorial: cfg = []; cfg.dataset = 'file.fif'; cfg.hearderfile = 'file.fif'; cfg.datatype = 'continuous'; cfg = definetrial(cfg); I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). Does any one have any idea why Fieldtrip cannot read my .fif files? Many thanks, Matt cfg.channel = {'0111'}; cfg.trialdef.eventtype = 'backpanel trigger'; cfg.trialdef.eventvalue = 3; % trigger for the FIC condition cfg.trialdef.prestim = 1; % time in seconds before trigger cfg.trialdef.poststim = 2; % time in seconds after trigger From sameer at ANDREW.CMU.EDU Mon Mar 12 19:56:08 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 12 Mar 2007 14:56:08 -0400 Subject: help with reading .fif files in Fieldtrip In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB0110353D@medstudent.medschool.nt.pitt.edu> Message-ID: hi Matt, I dont know. Try the fieldtrip discussion list. they are very good at helpinig. you will see I (and others) write them dozens of emails and they reply. sameer On Mon, 12 Mar 2007, Shtrahman, Matthew wrote: > Hello, > > I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: > > Warning: Error reading fif-file! > terminate called after throwing an instance of 'MathWorks::System::_utException' > > I simply adapted the settings for reading a continuous data set from the tutorial: > > cfg = []; > cfg.dataset = 'file.fif'; > cfg.hearderfile = 'file.fif'; > cfg.datatype = 'continuous'; > > cfg = definetrial(cfg); > > > I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). > > Does any one have any idea why Fieldtrip cannot read my .fif files? > > Many thanks, > > Matt > > > cfg.channel = {'0111'}; > cfg.trialdef.eventtype = 'backpanel trigger'; > cfg.trialdef.eventvalue = 3; % trigger for the FIC condition > cfg.trialdef.prestim = 1; % time in seconds before trigger > cfg.trialdef.poststim = 2; % time in seconds after trigger > > From sameer at ANDREW.CMU.EDU Mon Mar 12 20:03:51 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 12 Mar 2007 15:03:51 -0400 Subject: help with reading .fif files in Fieldtrip In-Reply-To: Message-ID: Sorry everybody for this and the earlier email which was sent to the list becasue I failed to notice that the email was to the discussion list. however, I'll use this mix up on my part to reiterte my statement about "very good at helping". I do appreciate it. sameer On Mon, 12 Mar 2007, Sameer Walawalkar wrote: > hi Matt, I dont know. Try the fieldtrip discussion list. they are very good > at helpinig. you will see I (and others) write them dozens of emails and they > reply. > > sameer > > On Mon, 12 Mar 2007, Shtrahman, Matthew wrote: > >> Hello, >> >> I am new to Fieldtrip and I am having difficulty getting the fieldtrip >> function DEFINETRIAL to read continuous .fif (Neuromag) files. I have >> installed the MEG-PD toolbox in my matlab path and regularly use it in my >> own code to read the same .fif files with no errors. I also have tried >> copying the toolbox files to the fieldtrip/private directory. Regardless of >> what I do when I use DEFINETRIAL Matlab crashes and I get the following >> error: >> >> Warning: Error reading fif-file! >> terminate called after throwing an instance of >> 'MathWorks::System::_utException' >> >> I simply adapted the settings for reading a continuous data set from the >> tutorial: >> >> cfg = []; >> cfg.dataset = 'file.fif'; >> cfg.hearderfile = 'file.fif'; >> cfg.datatype = 'continuous'; >> >> cfg = definetrial(cfg); >> >> >> I don't know if it makes a difference, but I have also tried specifying the >> entire path for the file, working as root, and including various >> configurations for definetrial included in the tutorial (see end of email). >> >> Does any one have any idea why Fieldtrip cannot read my .fif files? >> >> Many thanks, >> >> Matt >> >> >> cfg.channel = {'0111'}; >> cfg.trialdef.eventtype = 'backpanel trigger'; >> cfg.trialdef.eventvalue = 3; % trigger for the FIC condition >> cfg.trialdef.prestim = 1; % time in seconds before trigger >> cfg.trialdef.poststim = 2; % time in seconds after trigger >> >> > > From lauri at NEURO.HUT.FI Mon Mar 12 21:23:18 2007 From: lauri at NEURO.HUT.FI (Lauri Parkkonen) Date: Mon, 12 Mar 2007 22:23:18 +0200 Subject: help with reading .fif files in Fieldtrip In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB0110353D@medstudent.medschool.nt.pitt.edu> Message-ID: Hi Matthew, Which Matlab version you're using? With a 7.x Matlab and the newest meg-pd (a.k.a FiffAccess) toolbox you should be able to read fif-files without extra configurations, however, the older 6.x Matlabs with the older meg-pd toolbox require setting the LD_ASSUME_KERNEL environment variable before starting Matlab. Using a 7.x Matlab with the older meg-pd package is likely to give the error messages you're quoting in your email. Best regards, Lauri Shtrahman, Matthew wrote: > Hello, > > I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: > > Warning: Error reading fif-file! > terminate called after throwing an instance of 'MathWorks::System::_utException' > > I simply adapted the settings for reading a continuous data set from the tutorial: > > cfg = []; > cfg.dataset = 'file.fif'; > cfg.hearderfile = 'file.fif'; > cfg.datatype = 'continuous'; > > cfg = definetrial(cfg); > > > I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). > > Does any one have any idea why Fieldtrip cannot read my .fif files? > > Many thanks, > > Matt > > > cfg.channel = {'0111'}; > cfg.trialdef.eventtype = 'backpanel trigger'; > cfg.trialdef.eventvalue = 3; % trigger for the FIC condition > cfg.trialdef.prestim = 1; % time in seconds before trigger > cfg.trialdef.poststim = 2; % time in seconds after trigger > From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 12 21:53:25 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 12 Mar 2007 16:53:25 -0400 Subject: help with reading .fif files in Fieldtrip Message-ID: Hi Lauri, Thanks for the email. I am using Matlab 7.3 and FiffAcess 1.2 (release 4), which I believe is the latest version. Any other ideas perhaps? Thanks again, Matt ________________________________ From: FieldTrip discussion list on behalf of Lauri Parkkonen Sent: Mon 3/12/2007 4:23 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] help with reading .fif files in Fieldtrip Hi Matthew, Which Matlab version you're using? With a 7.x Matlab and the newest meg-pd (a.k.a FiffAccess) toolbox you should be able to read fif-files without extra configurations, however, the older 6.x Matlabs with the older meg-pd toolbox require setting the LD_ASSUME_KERNEL environment variable before starting Matlab. Using a 7.x Matlab with the older meg-pd package is likely to give the error messages you're quoting in your email. Best regards, Lauri Shtrahman, Matthew wrote: > Hello, > > I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: > > Warning: Error reading fif-file! > terminate called after throwing an instance of 'MathWorks::System::_utException' > > I simply adapted the settings for reading a continuous data set from the tutorial: > > cfg = []; > cfg.dataset = 'file.fif'; > cfg.hearderfile = 'file.fif'; > cfg.datatype = 'continuous'; > > cfg = definetrial(cfg); > > > I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). > > Does any one have any idea why Fieldtrip cannot read my .fif files? > > Many thanks, > > Matt > > > cfg.channel = {'0111'}; > cfg.trialdef.eventtype = 'backpanel trigger'; > cfg.trialdef.eventvalue = 3; % trigger for the FIC condition > cfg.trialdef.prestim = 1; % time in seconds before trigger > cfg.trialdef.poststim = 2; % time in seconds after trigger > From Brian.Roach at YALE.EDU Mon Mar 12 23:12:08 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Mon, 12 Mar 2007 18:12:08 -0400 Subject: write_tri.m file and results from volplot Message-ID: Hi all, I am using this example script: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:create_bem_headmodel_for_eeg To construct a headmodel for EEG source analysis. I have attached the result from a call to: volplot(skin+skull+brain); I am new to this, and wonder how to judge the success of this script in creating a new model. What kinds of things do I want to see in this plot, or the volplot of the skin, skull, or brain, individually? The example script says that it requires a lot of trial and error, so I am assuming that just running that script is not all that is necessary, but I do not know. Related to this, the prepare_bemmodel.m script calls a function "write_tri.m" when using the dipoli option. I need this script and hope someone can send it to me. thanks! Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testSkinSkullBrain.png Type: application/octet-stream Size: 15516 bytes Desc: not available URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 13 09:04:22 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 09:04:22 +0100 Subject: help with reading .fif files in Fieldtrip In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB01103542@medstudent.medschool.nt.pitt.edu> Message-ID: Hi Matthew, In addition to Lauri's remarks about making sure that the MEG-PD and MATLAB you're using are indeed compatible and fully aware of each other, it would be helpful if you could try the following lines of code in Matlab (which uses FieldTrip reading functions) and send us the screen output: % specify filename filename = 'fullpath/name.fif'; % read the header hdr = read_fcdc_header(filename); hdr % get the indices of the STI channels idx = strmatch('STI',hdr.label); % display them and the channel labels on screen as sanity check idx hdr.label(idx) % NOTE: if you know you use only one STI channel and you know which one it is, % e.g., 'STI 001' then you can also do this: % idx = strmatch('STI 001',hdr.label); % extract only the STI channels from the file dat = read_fcdc_data(filename,'chanindx',idx); % although Neuromag data is "continuous" it is actually written in the file in blocks % and reading only part of the data will return a 3-D array rather than a 2-D array % hence the reshape operation in the following [nchans, nsamps, nblocks] = size(dat); if (nblocks>1), dat = reshape(dat, [nchans, nsamps*nblocks]); end; size(dat) % this should be an nchans x ntotalsamples matirx If all of these commands produce sensible output using your fif file, then the problem has to do with the options being passed to DEFINETRIAL (which uses the above lower level functions). But we first need to establish that you have correctly set up MEG-PD, MATLAB and FieldTrip, and that there is not a problem with the data file itself. Regards, Christian On 12 Mar 2007, at 21:53, Shtrahman, Matthew wrote: > Hi Lauri, > > Thanks for the email. I am using Matlab 7.3 and FiffAcess 1.2 > (release 4), which I believe is the latest version. Any other ideas > perhaps? > > Thanks again, > > Matt > > ________________________________ > > From: FieldTrip discussion list on behalf of Lauri Parkkonen > Sent: Mon 3/12/2007 4:23 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] help with reading .fif files in Fieldtrip > > > > Hi Matthew, > > Which Matlab version you're using? With a 7.x Matlab and the newest > meg-pd (a.k.a FiffAccess) toolbox you should be able to read fif-files > without extra configurations, however, the older 6.x Matlabs with the > older meg-pd toolbox require setting the LD_ASSUME_KERNEL environment > variable before starting Matlab. Using a 7.x Matlab with the older > meg-pd package is likely to give the error messages you're quoting in > your email. > > Best regards, > Lauri > > > Shtrahman, Matthew wrote: >> Hello, >> >> I am new to Fieldtrip and I am having difficulty getting the >> fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) >> files. I have installed the MEG-PD toolbox in my matlab path and >> regularly use it in my own code to read the same .fif files with >> no errors. I also have tried copying the toolbox files to the >> fieldtrip/private directory. Regardless of what I do when I use >> DEFINETRIAL Matlab crashes and I get the following error: >> >> Warning: Error reading fif-file! >> terminate called after throwing an instance of >> 'MathWorks::System::_utException' >> >> I simply adapted the settings for reading a continuous data set >> from the tutorial: >> >> cfg = []; >> cfg.dataset = 'file.fif'; >> cfg.hearderfile = 'file.fif'; >> cfg.datatype = 'continuous'; >> >> cfg = definetrial(cfg); >> >> >> I don't know if it makes a difference, but I have also tried >> specifying the entire path for the file, working as root, and >> including various configurations for definetrial included in the >> tutorial (see end of email). >> >> Does any one have any idea why Fieldtrip cannot read my .fif files? >> >> Many thanks, >> >> Matt >> >> >> cfg.channel = {'0111'}; >> cfg.trialdef.eventtype = 'backpanel trigger'; >> cfg.trialdef.eventvalue = 3; % trigger for the FIC condition >> cfg.trialdef.prestim = 1; % time in seconds before trigger >> cfg.trialdef.poststim = 2; % time in seconds after trigger >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 13 09:45:19 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 09:45:19 +0100 Subject: ICA with averaged data In-Reply-To: <45F14EF2.10808@uke.uni-hamburg.de> Message-ID: Hi Niki, I fully concur with Stefan's advice and add a brief (technical) explanation for why doing ICA on time-locked averaged data is unlikely to give you a good separation. One of the most common application of ICA to EEG/MEG data in cognitive neuroscience seems to be to remove (what the users assume/ judge to be) artifact (i.e. non-brain or non-task related brain) activity from the data, and then to proceed with conventional sensor level analysis on the "clean" data. ICA assumes that the underlying source signals (component waveforms) in the data are statistically independent and have non-gaussian marginal distributions. If either of these assumptions are violated, then the sources are not uniquely identifiable w.r.t. the ICA search criteria, meaning that ICA will tend to give "funny" decompositions. Now consider that (time-locked) averaging essentially involves summing your data over trials at each time point, and that the distribution of the sum of several random variables with any distribution (including non-gaussian) approaches a gaussian distribution in the limit. From this it is clear that time-locked averaging tends to make all non-time locked activity in your data (i.e. the stuff you want to remove, and need ICA to identify) appear MORE gaussian and therefore LESS identifiable from an ICA perspective. As a consequence, ICA cannot model the artifact activity sufficiently well to be able to separate it from your brain activity of interest. Thus, if the aim of using ICA is to remove non-time locked artifacts (i.e. asynchronous oscillatory activity or intermittent transients) from your data, then following the reasoning above it is advisable to decompose the raw data (making sure to include examples of the artifact you wish to remove). Then either remove the artifacts and project back to the sensor space to do your averaging, or just do the averaging on the components themselves. Hope this helps, Christian On 9 Mar 2007, at 13:11, Stefan Debener wrote: > Hi Niki, > > It does, in my opinion, not make much sense to average first and > then run ICA, you unlikely obtain a robust decomposition this way > and may not be able to remove the stimulator artefact. ICA needs > quite a few training data to find a decent decomposition, and this > is not provided by ERPs, even though some commercial software > packages may allow you to apply ICA to ERPs/ERFs. Only if (!) all > your data are recorded such that there was no substantial head > movement (that is, the position between sensors and sources did not > change), you may get a decent artefact IC (or several ICs) from > combined data (there is a few more ifs involved, please see > previous ICA discussions here and in the EEGLAB mailing list). YI'd > suggest using the pca option and decomposse, say, about 50 > components, to start with, and then try to optimize the result by > playing with the pca option and by running ICAs for separate > recording blocks. > Best, > Stefan > > Niki Ray wrote: >> Hi, >> I'm very new to fieldtrip. I have three questions. I have >> collected MEG >> data from patients with a deep brain stimulator implanted. I'd >> like to do an >> ICA to reject the stimulator related artifacts. Sometimes the >> stimulator is >> on and sometimes off. So my first question is, do i combine all >> the data >> together and then perform the ICA, or do i do different ICA >> analyses for >> each condition(on and off stimulation), and hence reject different >> components for each condition? >> One possibility for deciding wich of the artifacts were related >> to the >> stimulator was to use the example matlab script you provide for >> rejecting >> ECG components. Some of the channels (about 13, i'm using a ctf >> 275 system) >> have a lot of very distinct artifact that is obviously from the >> stimulator, >> so i wanted to use one of these channels as the "ECG" channel. Is >> this >> sensible, or not?? >> Finally, I've been getting conflicting advice about whether it >> is okay to >> first average data, and then perform an ICA. What do you suggest >> is the >> right thing to do? >> >> Many thanks! >> Niki >> >> >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 13 12:59:43 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 12:59:43 +0100 Subject: No subject In-Reply-To: <45EEB4A5.9090406@cs.ru.nl> Message-ID: Hi Paul, I have just tested the following FieldTrip functions READ_FCDC_HEADER READ_FCDC_DATA READ_FCDC_EVENT using a test BDF file and I got no errors. This leads me to suspect that there is either something different about your BDF file, or that you are calling these functions in a "non-recommended" way. In order to help you figure out what is going in, can you please give me more detailed information about what is in your file (especially w.r.t. triggers and events), and also send me the segment of code (cut & paste into email is fine) where you call the functions, i.e. what are the cfg fields you are using, or rather what it the content of varargin, exactly. Thanks, Christian On 7 Mar 2007, at 13:48, P.vandenHurk wrote: > Hello Christian, > > I am sorry, but of course. It is a .bdf file. > > The read_fcdc_header function does work by the way. > > Regards, > Paul > > Christian Hesse schreef: >> Hi Paul, >> >> in order to be able to help you, can you please specify which type >> of data format you are trying to read events from? >> >>> Hello, >>> >>> Each time I use the 'read_fcdc_event' function, I get the >>> following error: >>> >>> ??? Error using ==> read_event >>> type field not defined for each event >>> >>> Error in ==> read_fcdc_event at 51 >>> [event] = read_event(varargin{:}); >>> >>> Can you tell me how I can fix this error? >> >> We'll fix the error if there is one, we give you advice on how to >> avoid them :-) >> >> Regards, >> Christian >> >> --------------------------------------------------------------------- >> - >> Christian Hesse, PhD, MIEEE >> >> F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 >> NL-6500 HB Nijmegen The Netherlands >> >> Tel.: +31 (0)24 36 68293 >> Fax: +31 (0)24 36 10989 >> >> Email: c.hesse at fcdonders.ru.nl >> Web: www.fcdonders.ru.nl >> --------------------------------------------------------------------- >> - >> >> >> >> > > -- > > ----------------------------------------------------------- > Paul van den Hurk > > Joint Principal Investigator > Mindfulness Project > Inserm U280, Lyon, France, > > Radboud University Nijmegen: > Department of computer sciences and > Department of Medical Physics and Biophysics/126 > Geert Grooteplein 21 6525 EZ Nijmegen > > Email: P.vandenHurk at cs.ru.nl > > Tel: 024-3613326 > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From juan.vidal at FCDONDERS.RU.NL Tue Mar 13 15:15:39 2007 From: juan.vidal at FCDONDERS.RU.NL (Juan R. Vidal) Date: Tue, 13 Mar 2007 15:15:39 +0100 Subject: heart artifacts with planar transformed data Message-ID: Hi everybody, i have a general question. Is it possible to find heart artifacts in planar transformed MEG data? I had a discussion with a collegue about it but we did not get at any conclusion. I did some ICA on these MEG data and found 2-3 components that had a veery broad scalp distribution, heart like. Thanks for sharing any experience or knowledge about it. Best, Juan -- Juan R. Vidal, PhD Neuronal Coherence Group F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen Kapittelweg 29 6525 EN Nijmegen The Netherlands Phone: (+31) (0)24 36 10880 Fax: (+31) (0)24 36 10989 e-mail: juan.vidal at fcdonders.ru.nl website: www.ru.nl/fcdonders/ From sameer at ANDREW.CMU.EDU Tue Mar 13 15:27:56 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 13 Mar 2007 10:27:56 -0400 Subject: MNI aligned grids, mris and segmentation Message-ID: Hi, I want to start DICS analysis of my MEG data. For this I need to have MRI and MEG data coregistered. I also need multisphere forward models for which segmentation is necessary. Am I correct in understanding that the following webpage contains info about segmentation? (in addition to MNI aligning all grids) From (http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) Here, in the very beginning, SUBJ = {'subj1','subj2','subj3'}; PREINMRI = '~/mri/'; PREOUT = '~/grids/'; TEMPL = 'mni_standards/t1_icbm_normal_1mm_pn0_rf0.mnc'; RES = 1; % grid resolution [cm] OUTWARDSHIFT = 1.5; % outwardshift for inside/outside detection [cm] % segment the template brain and construct volume templmri = read_fcdc_mri(sprintf('%s%s',PREINMRI,TEMPL)); clear cfg; cfg.coordinates = 'spm'; seg = volumesegment(cfg,templmri); vol = prepare_singleshell([],seg); I understand that in the commands above, first we are creating a template mri to which all other grids will later be aligned. What exactly is t1_icbm_normal_1mm_pn0_rf0.mnc ? Is it a slice from an mri image. Can I give the path to my dicom mri images directory and the name of a file ending in .dcm? Incidently >> mri = read_fcdc_mri('Z:\KarmaCond\BIRC_images_foolaround\070207134421\2\02-0001-000001.dcm'); ??? Undefined function or variable "hdr". Error in ==> read_fcdc_mri at 179 [z, indx] = sort(cell2mat({hdr.SliceLocation})); Thanks you very much. sameer From c.hesse at FCDONDERS.RU.NL Tue Mar 13 15:54:31 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 15:54:31 +0100 Subject: heart artifacts with planar transformed data In-Reply-To: <45F6B20B.4090809@fcdonders.ru.nl> Message-ID: Hi Juan, are you doing this ICA on concatenated single trials of MEG data that has been put back together with COMBINEPLANAR? And is this time- domain or frequency domain data (output 'pow')? Cheers, Christian On 13 Mar 2007, at 15:15, Juan R. Vidal wrote: > Hi everybody, > > i have a general question. Is it possible to find heart > artifacts in planar transformed MEG data? I had a discussion with a > collegue about it but we did not get at any conclusion. I did some > ICA on these MEG data and found 2-3 components that had a veery > broad scalp distribution, heart like. Thanks for sharing any > experience or knowledge about it. > > Best, > > Juan > > -- > Juan R. Vidal, PhD > Neuronal Coherence Group > F.C. Donders Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Kapittelweg 29 > 6525 EN Nijmegen > The Netherlands > > Phone: (+31) (0)24 36 10880 > Fax: (+31) (0)24 36 10989 > e-mail: juan.vidal at fcdonders.ru.nl > website: www.ru.nl/fcdonders/ > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ychen at BME.UFL.EDU Tue Mar 13 20:49:24 2007 From: ychen at BME.UFL.EDU (Y Chen) Date: Tue, 13 Mar 2007 20:49:24 +0100 Subject: Problem with BESA coordinate system Message-ID: Hi Robert, Thanks for your kind reply. However when I check the createlayout.m function, it turns out that in line 229, the coordinate has been rotated 90 degree (multiply [0 1; -1 0]). For my electrode file, when I remove this coordinate transformation, I get the right layout. Chen From r.oostenveld at FCDONDERS.RU.NL Wed Mar 14 10:18:18 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 14 Mar 2007 10:18:18 +0100 Subject: sourceanalysis.m on EEG data In-Reply-To: <6.1.2.0.2.20070312135517.01cdada0@email.med.yale.edu> Message-ID: On 12 Mar 2007, at 18:56, Brian Roach wrote: > The prepare_bemmodel calls a function "write_tri" when using the > dipoli option. I cannot find this function on the server or in any > of my downloaded files. Does anyone have it to share? please find it attached. Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: write_tri.m Type: application/octet-stream Size: 651 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Wed Mar 14 10:43:54 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 14 Mar 2007 10:43:54 +0100 Subject: Problem with BESA coordinate system In-Reply-To: Message-ID: Dear Chen, I have just made some changes to the layout parts of the code. If you download the latest FT zip file from our FTP server you can see the changes. I replaced the private/createlayout function by a new main function PREPARE_LAYOUT. I also updated the LAYOUTPLOT function (actually I forgot in my previous mail to mention the existence of that function). The specification of the 2D positions for topo and multiplotting can now be done more explicitely, and is documented in prepare_layout. Also the conversion from 3D to 2D locations is also more easily to recognize. The layoutplot function is there to help in the debugging. What now happens is that in the case of specifying cfg.gradfile or cfg.grad, it will rotate by default with 90 deg. When specifying cfg.elecfile or cfg.elec, it will NOT rotate. When specifying cfg.layout, it will just read the *.lay file, or it will read it as matlab *.mat file without further manipulation, or it will read it as electrode file and in that case not rotate it. It now would be easy to explicitely add an cfg.rotate option to the prepare_layout implementation, but I think that the current version should already solve your problem. best regards, Robert On 13 Mar 2007, at 20:49, Y Chen wrote: > Hi Robert, > > Thanks for your kind reply. However when I check the createlayout.m > function, it turns out that in line 229, the coordinate has been > rotated > 90 degree (multiply [0 1; -1 0]). For my electrode file, when I remove > this coordinate transformation, I get the right layout. > > Chen From gmcauley at LLU.EDU Wed Mar 14 20:32:51 2007 From: gmcauley at LLU.EDU (McAuley, Grant (LLU)) Date: Wed, 14 Mar 2007 12:32:51 -0700 Subject: Error in FREQANALYSIS Message-ID: I am seeing an error in FREQANALYSIS (see output below). It seems centered around the 'cfg.tapper' field. I have tried 'dpss', 'hanning' (output below), and 'sine' (which gives an Out of Memory Error). (Not sure where to find info on WINDOW). My data is in a structure as described here: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:frequently_asked_questions (How can I import my own dataformat?) Relevant MATLAB output is below. Pardon me if I am missing something obvious - this is new territory for me. Any ideas on what might be the problem? % my data structure with example values >> hv1_69 hv1_69 = label: {2x1 cell} fsample: 200 trial: {[2x48528 double]} time: {[1x48529 double]} >> hv1_69.trial{1}(1,1:5) ans = 4.9460 4.2540 1.9510 0.0820 0.6380 >> hv1_69.time{1}(1,1:5) ans = 0 0.0050 0.0100 0.0150 0.0200 % here are cfg values >> cfg cfg = output: 'pow' method: 'mtmfft' tapsmofrq: 4 pad: 'maxperlen' taper: 'dpss' foilim: [0 100] >> [freq] = freqanalysis(cfg, hv1_69); ??? Undefined function or method 'dpss' for input arguments of type 'double'. Error in ==> freqanalysis_mtmfft>double_dpss at 560 tap = dpss(double(a), double(b), varargin{:}); Error in ==> freqanalysis_mtmfft at 387 tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; Error in ==> freqanalysis at 193 [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), cfg, data); % try different 'cfg.taper' value >> cfg.taper = 'hanning'; >> [freq] = freqanalysis(cfg, hv1_69); ??? Undefined function or method 'window' for input arguments of type 'char'. Error in ==> freqanalysis_mtmfft at 393 tap = window(cfg.taper, numdatbns)'; Error in ==> freqanalysis at 193 [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), cfg, data); %MATLAB version >> version ans = 7.3.0.267 (R2006b) From gmcauley at LLU.EDU Wed Mar 14 20:37:18 2007 From: gmcauley at LLU.EDU (McAuley, Grant (LLU)) Date: Wed, 14 Mar 2007 12:37:18 -0700 Subject: Spectral Medium, Edge and Dominant Frequency Functions Message-ID: Pardon me if I missed it, but are there functions in FT for computing Spectral Edge, Medium and Dominant Frequency for a data trial? If not, perhaps someone knows of an implementation of such algorithms somewhere else? From c.hesse at FCDONDERS.RU.NL Wed Mar 14 22:12:45 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 14 Mar 2007 22:12:45 +0100 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Hi Grant, Ahhh ... you're trying to do all of this without the signal processing toolbox, aren't you. In that case I must apologize for having given you slightly inaccurate info before: the DPSS and WINDOW functions are from the signal processing toolbox. Having just had a play with FREQANALYSIS it turns out that in it's current version a taper must be specified (e.g., cfg.taper = 'none') gives an error. This means that you apparently cannot use FieldTrip (in its current form) to do simple, "no-frills" spectral estimation. I will have a closer look to see if we can change it so allow cfg.taper = 'none', since this means that you could apply your own taper to your data before using FREQANALYSIS or just leave it out. Realistically speaking though, it seems to me that your best options are basically a) to get the signal processing toolbox, or b) to just write your own matlab functions to estimate your power spectra (about 3 lines of code) and then calculate your SEF and MF measures (another few lines at most). Cheers, Christian > I am seeing an error in FREQANALYSIS (see output below). It seems > centered around the 'cfg.tapper' field. I have tried 'dpss', > 'hanning' (output below), and 'sine' (which gives an Out of Memory > Error). (Not sure where to find info on WINDOW). > > > My data is in a structure as described here: > http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:frequently_asked_questions > (How can I import my own dataformat?) > > > Relevant MATLAB output is below. > > > Pardon me if I am missing something obvious - this is new territory > for me. Any ideas on what might be the problem? > > > > > % my data structure with example values >>> hv1_69 > > hv1_69 = > > label: {2x1 cell} > fsample: 200 > trial: {[2x48528 double]} > time: {[1x48529 double]} > > >>> hv1_69.trial{1}(1,1:5) > > ans = > > 4.9460 4.2540 1.9510 0.0820 0.6380 > >>> hv1_69.time{1}(1,1:5) > > ans = > > 0 0.0050 0.0100 0.0150 0.0200 > > % here are cfg values >>> cfg > > cfg = > > output: 'pow' > method: 'mtmfft' > tapsmofrq: 4 > pad: 'maxperlen' > taper: 'dpss' > foilim: [0 100] > > >>> [freq] = freqanalysis(cfg, hv1_69); > ??? Undefined function or method 'dpss' for input arguments of type > 'double'. > > Error in ==> freqanalysis_mtmfft>double_dpss at 560 > tap = dpss(double(a), double(b), varargin{:}); > > Error in ==> freqanalysis_mtmfft at 387 > tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./ > data.fsample))'; > > Error in ==> freqanalysis at 193 > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > cfg, data); > > > > % try different 'cfg.taper' value >>> cfg.taper = 'hanning'; >>> [freq] = freqanalysis(cfg, hv1_69); > ??? Undefined function or method 'window' for input arguments of > type 'char'. > > Error in ==> freqanalysis_mtmfft at 393 > tap = window(cfg.taper, numdatbns)'; > > Error in ==> freqanalysis at 193 > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > cfg, data); > > > %MATLAB version >>> version > > ans = > > 7.3.0.267 (R2006b) > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Wed Mar 14 22:39:08 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 14 Mar 2007 22:39:08 +0100 Subject: Spectral Medium, Edge and Dominant Frequency Functions In-Reply-To: Message-ID: Hi Grant, > Pardon me if I missed it, but are there functions in FT for > computing Spectral Edge, Medium and Dominant Frequency for a data > trial? > > If not, perhaps someone knows of an implementation of such > algorithms somewhere else? As far as I am aware, there are no direct functions in Fieldtrip for extracting these measures from power spectra (since this sort of approach to spectral analysis is a tad more reductionist that is useful for most FT purposes). There is also nothing in the Signal Processing Toolbox, since this has mainly to do with spectral estimation as such, filter design, prediction, etc ... However, computing these measures is quite straightforward in matlab assuming you have the power spectum of the data (The matlab help for FFT tells you how to compute the power spectrum in a few simple lines, which you can turn into your own function). The following is only pseudo/outline code for a little function to get median, spectral edge and dominant frequencies: function [mf, sef, df] = specstats(freq, pyy) % your frequency axis is freq (a vector) % your power spectrum is pyy (a vector) % normalize spectrum to get a density pyy_norm = pyy./sum(pyy); % compute cumulative density pyy_cum = cumsum(pyy_norm); % median frequency corresponds to the frequency at (nearest to) % the point on the freq axis where pyy_cum = 0.5 [val, idx] = min(abs(pyy_cum-0.5)); mf = freq(idx); % spectral edge frequency corresponds to the frequency at (nearest to) % the point on the freq axis where pyy_cum = 0.05 [val, idx] = min(abs(pyy_cum-0.05)); sef = freq(idx); % you can extend this code for dominant frequency accordingly ... if all you mean % is the peak frequency then you have [val, idx] = max(pyy); df = freq(idx); Depending on how sophisticated you want to get you can apply a bit of interpolation to pyy as well, but that is probably overkill. I hope that helps Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Mar 15 13:53:46 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 15 Mar 2007 13:53:46 +0100 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Hi Grant On 14 Mar 2007, at 22:12, Christian Hesse wrote: > Ahhh ... you're trying to do all of this without the signal > processing toolbox, aren't you. In that case I must apologize for > having given you slightly inaccurate info before: the DPSS and > WINDOW functions are from the signal processing toolbox. > > ... > Realistically speaking though, it seems to me that your best > options are basically a) to get the signal processing toolbox, or > b) to just write your own matlab functions to estimate your power > spectra (about 3 lines of code) and then calculate your SEF and MF > measures (another few lines at most). with respect to option "b": I think the easiest is to replicate the WINDOW function from the signal preocessing toolbox. The dpss is difficult, but hanning, triangle, rectwin and some others are trivial. The WINDOW function is just a convenient wrapper function for various tapers. See at the bottom of this mail for the full help. The window replacement function to be written should behave as >> tap = window('hanning', 10) tap = 0.0794 0.2923 0.5712 0.8274 0.9797 0.9797 0.8274 0.5712 0.2923 0.0794 >> tap = window('rectwin', 10) tap = 1 1 1 1 1 1 1 1 1 1 >> tap = window('triang', 10) tap = 0.1000 0.3000 0.5000 0.7000 0.9000 0.9000 0.7000 0.5000 0.3000 0.1000 I hope that this suggestion helps, Robert --------------- >> help window WINDOW Window function gateway. WINDOW(@WNAME,N) returns an N-point window of type specified by the function handle @WNAME in a column vector. @WNAME can be any valid window function name, for example: @bartlett - Bartlett window. @barthannwin - Modified Bartlett-Hanning window. @blackman - Blackman window. @blackmanharris - Minimum 4-term Blackman-Harris window. @bohmanwin - Bohman window. @chebwin - Chebyshev window. @flattopwin - Flat Top window. @gausswin - Gaussian window. @hamming - Hamming window. @hann - Hann window. @kaiser - Kaiser window. @nuttallwin - Nuttall defined minimum 4-term Blackman-Harris window. @parzenwin - Parzen (de la Valle-Poussin) window. @rectwin - Rectangular window. @tukeywin - Tukey window. @triang - Triangular window. WINDOW(@WNAME,N,OPT) designs the window with the optional input argument specified in OPT. To see what the optional input arguments are, see the help for the individual windows, for example, KAISER or CHEBWIN. WINDOW launches the Window Design & Analysis Tool (WinTool). EXAMPLE: N = 65; w = window(@blackmanharris,N); w1 = window(@hamming,N); w2 = window(@gausswin,N,2.5); plot(1:N,[w,w1,w2]); axis([1 N 0 1]); legend('Blackman-Harris','Hamming','Gaussian'); See also bartlett, barthannwin, blackman, blackmanharris, bohmanwin, chebwin, gausswin, hamming, hann, kaiser, nuttallwin, parzenwin, rectwin, triang, tukeywin, WINTOOL. From Brian.Roach at YALE.EDU Wed Mar 14 23:25:06 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Wed, 14 Mar 2007 18:25:06 -0400 Subject: results of prepare_bemmodel Message-ID: FT users, after running vol = prepare_bemmodel(cfg, mri) where cfg = tissue: [1 2 3] numvertices: [1000 2000 3000] conductivity: [1 0.0125 1] isolatedsource: 3 method: 'dipoli' dipoli: '/home/bjr39/FTsource/dipoli' and mri = dim: [181 217 181] xgrid: [1x181 double] ygrid: [1x217 double] zgrid: [1x181 double] anatomy: [181x217x181 double] transform: [4x4 double] hdr: [1x1 struct] seg: [181x217x181 double] I am trying to make figures of the surfaces with triplot.m: >> triplot(vol.bnd(1).pnt, vol.bnd(1).tri, 'faces_skin'); rotate3d ??? Subscript indices must either be real positive integers or logicals. Error in ==> triplot at 38 h = plot(x(d), y(d),c,varargin{start:end}); -------------------------------------------------------------------------- I must have done something wrong along the way, but I am not sure what. Any ideas? thanks, Brian From t.schneider at UKE.UNI-HAMBURG.DE Thu Mar 15 15:45:35 2007 From: t.schneider at UKE.UNI-HAMBURG.DE (Till Schneider) Date: Thu, 15 Mar 2007 15:45:35 +0100 Subject: results of prepare_bemmodel In-Reply-To: <6.1.2.0.2.20070314181408.02df3d70@email.med.yale.edu> Message-ID: Dear Brian, there are actually two triplot functions: one in the fieldtrip private directory and one 'official' matlab function. You should use the fieldtrip function, for the line of code below. It should work then. Regards, Till Brian Roach schrieb: > FT users, > > after running vol = prepare_bemmodel(cfg, mri) > > where cfg = > > tissue: [1 2 3] > numvertices: [1000 2000 3000] > conductivity: [1 0.0125 1] > isolatedsource: 3 > method: 'dipoli' > dipoli: '/home/bjr39/FTsource/dipoli' > > and mri = > > dim: [181 217 181] > xgrid: [1x181 double] > ygrid: [1x217 double] > zgrid: [1x181 double] > anatomy: [181x217x181 double] > transform: [4x4 double] > hdr: [1x1 struct] > seg: [181x217x181 double] > > > I am trying to make figures of the surfaces with triplot.m: > > >> triplot(vol.bnd(1).pnt, vol.bnd(1).tri, 'faces_skin'); rotate3d > ??? Subscript indices must either be real positive integers or logicals. > > Error in ==> triplot at 38 > h = plot(x(d), y(d),c,varargin{start:end}); > -------------------------------------------------------------------------- > > I must have done something wrong along the way, but I am not sure > what. Any ideas? > > thanks, > Brian > > -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf Körperschaft des öffentlichen Rechts Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Jörg F. Debatin (Vorsitzender) Dr. Alexander Kirstein Ricarda Klein Prof. Dr. Rolf A.K. Stahl From Brian.Roach at YALE.EDU Thu Mar 15 16:00:25 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 15 Mar 2007 11:00:25 -0400 Subject: results of prepare_bemmodel In-Reply-To: <45F95C0F.1020408@uke.uni-hamburg.de> Message-ID: That did it - thanks!!! At 10:45 AM 3/15/2007, you wrote: >Dear Brian, > >there are actually two triplot functions: one in the fieldtrip private >directory and one 'official' matlab function. >You should use the fieldtrip function, for the line of code below. It >should work then. > >Regards, >Till > > >Brian Roach schrieb: >>FT users, >> >>after running vol = prepare_bemmodel(cfg, mri) >> >>where cfg = >> >> tissue: [1 2 3] >> numvertices: [1000 2000 3000] >> conductivity: [1 0.0125 1] >> isolatedsource: 3 >> method: 'dipoli' >> dipoli: '/home/bjr39/FTsource/dipoli' >> >>and mri = >> >> dim: [181 217 181] >> xgrid: [1x181 double] >> ygrid: [1x217 double] >> zgrid: [1x181 double] >> anatomy: [181x217x181 double] >> transform: [4x4 double] >> hdr: [1x1 struct] >> seg: [181x217x181 double] >> >> >>I am trying to make figures of the surfaces with triplot.m: >> >> >> triplot(vol.bnd(1).pnt, vol.bnd(1).tri, 'faces_skin'); rotate3d >>??? Subscript indices must either be real positive integers or logicals. >> >>Error in ==> triplot at 38 >>h = plot(x(d), y(d),c,varargin{start:end}); >>-------------------------------------------------------------------------- >>I must have done something wrong along the way, but I am not sure what. >>Any ideas? >> >>thanks, >>Brian >> > > > >-- > >Pflichtangaben gemäß Gesetz über elektronische Handelsregister und >Genossenschaftsregister sowie das Unternehmensregister (EHUG): > >Universitätsklinikum Hamburg-Eppendorf >Körperschaft des öffentlichen Rechts >Gerichtsstand: Hamburg > >Vorstandsmitglieder: >Prof. Dr. Jörg F. Debatin (Vorsitzender) >Dr. Alexander Kirstein >Ricarda Klein >Prof. Dr. Rolf A.K. Stahl >ca From gmcauley at LLU.EDU Fri Mar 16 17:30:51 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Fri, 16 Mar 2007 09:30:51 -0700 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Thanks Christian, I will go with option b. ~ Grant On Wed, 2007-03-14 at 22:12 +0100, Christian Hesse wrote: > Hi Grant, > > > Ahhh ... you're trying to do all of this without the signal processing > toolbox, aren't you. In that case I must apologize for having given > you slightly inaccurate info before: the DPSS and WINDOW functions are > from the signal processing toolbox. > > > Having just had a play with FREQANALYSIS it turns out that in it's > current version a taper must be specified (e.g., cfg.taper = 'none') > gives an error. This means that you apparently cannot use FieldTrip > (in its current form) to do simple, "no-frills" spectral estimation. I > will have a closer look to see if we can change it so allow cfg.taper > = 'none', since this means that you could apply your own taper to your > data before using FREQANALYSIS or just leave it out. > > > Realistically speaking though, it seems to me that your best options > are basically a) to get the signal processing toolbox, or b) to just > write your own matlab functions to estimate your power spectra (about > 3 lines of code) and then calculate your SEF and MF measures (another > few lines at most). > > > Cheers, > Christian > > > > > > > > I am seeing an error in FREQANALYSIS (see output below). It seems > > centered around the 'cfg.tapper' field. I have tried 'dpss', > > 'hanning' (output below), and 'sine' (which gives an Out of Memory > > Error). (Not sure where to find info on WINDOW). > > > > > > > > > > My data is in a structure as described here: > > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:frequently_asked_questions > > (How can I import my own dataformat?) > > > > > > > > > > Relevant MATLAB output is below. > > > > > > > > > > Pardon me if I am missing something obvious - this is new territory > > for me. Any ideas on what might be the problem? > > > > > > > > > > > > > > > > > > % my data structure with example values > > > > hv1_69 > > > > > > hv1_69 = > > > > > > label: {2x1 cell} > > fsample: 200 > > trial: {[2x48528 double]} > > time: {[1x48529 double]} > > > > > > > > > > > > hv1_69.trial{1}(1,1:5) > > > > > > ans = > > > > > > 4.9460 4.2540 1.9510 0.0820 0.6380 > > > > > > > > hv1_69.time{1}(1,1:5) > > > > > > ans = > > > > > > 0 0.0050 0.0100 0.0150 0.0200 > > > > > > % here are cfg values > > > > cfg > > > > > > cfg = > > > > > > output: 'pow' > > method: 'mtmfft' > > tapsmofrq: 4 > > pad: 'maxperlen' > > taper: 'dpss' > > foilim: [0 100] > > > > > > > > > > > > [freq] = freqanalysis(cfg, hv1_69); > > ??? Undefined function or method 'dpss' for input arguments of type > > 'double'. > > > > > > Error in ==> freqanalysis_mtmfft>double_dpss at 560 > > tap = dpss(double(a), double(b), varargin{:}); > > > > > > Error in ==> freqanalysis_mtmfft at 387 > > tap = > > double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; > > > > > > Error in ==> freqanalysis at 193 > > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > > cfg, data); > > > > > > > > > > > > > > % try different 'cfg.taper' value > > > > cfg.taper = 'hanning'; > > > > [freq] = freqanalysis(cfg, hv1_69); > > ??? Undefined function or method 'window' for input arguments of > > type 'char'. > > > > > > Error in ==> freqanalysis_mtmfft at 393 > > tap = window(cfg.taper, numdatbns)'; > > > > > > Error in ==> freqanalysis at 193 > > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > > cfg, data); > > > > > > > > > > %MATLAB version > > > > version > > > > > > ans = > > > > > > 7.3.0.267 (R2006b) > > > > > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From gmcauley at LLU.EDU Fri Mar 16 17:46:09 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Fri, 16 Mar 2007 09:46:09 -0700 Subject: Spectral Medium, Edge and Dominant Frequency Functions In-Reply-To: Message-ID: Thanks Christian, This is very helpful. I did not know about the 'cumsum' function - it makes this almost trivial. ~ Grant On Wed, 2007-03-14 at 22:39 +0100, Christian Hesse wrote: > Hi Grant, > > > > Pardon me if I missed it, but are there functions in FT for > > computing Spectral Edge, Medium and Dominant Frequency for a data > > trial? > > > > > > If not, perhaps someone knows of an implementation of such > > algorithms somewhere else? > > > As far as I am aware, there are no direct functions in Fieldtrip for > extracting these measures from power spectra (since this sort of > approach to spectral analysis is a tad more reductionist that is > useful for most FT purposes). There is also nothing in the Signal > Processing Toolbox, since this has mainly to do with spectral > estimation as such, filter design, prediction, etc ... > > > However, computing these measures is quite straightforward in matlab > assuming you have the power spectum of the data (The matlab help for > FFT tells you how to compute the power spectrum in a few simple lines, > which you can turn into your own function). The following is only > pseudo/outline code for a little function to get median, spectral edge > and dominant frequencies: > > > > > function [mf, sef, df] = specstats(freq, pyy) > % your frequency axis is freq (a vector) > % your power spectrum is pyy (a vector) > > > % normalize spectrum to get a density > pyy_norm = pyy./sum(pyy); > > > % compute cumulative density > pyy_cum = cumsum(pyy_norm); > > > % median frequency corresponds to the frequency at (nearest to) > % the point on the freq axis where pyy_cum = 0.5 > [val, idx] = min(abs(pyy_cum-0.5)); > mf = freq(idx); > > > % spectral edge frequency corresponds to the frequency at (nearest to) > % the point on the freq axis where pyy_cum = 0.05 > [val, idx] = min(abs(pyy_cum-0.05)); > sef = freq(idx); > > > % you can extend this code for dominant frequency accordingly ... if > all you mean > % is the peak frequency then you have > [val, idx] = max(pyy); > df = freq(idx); > > > > > Depending on how sophisticated you want to get you can apply a bit of > interpolation to pyy as well, but that is probably overkill. > > > > > I hope that helps > Christian > > > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From gmcauley at LLU.EDU Fri Mar 16 17:50:52 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Fri, 16 Mar 2007 09:50:52 -0700 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Thanks Robert, I have decided to go with option b). The 'WINDOW' information is enlightening and very helpful. ~ Grant On Thu, 2007-03-15 at 13:53 +0100, Robert Oostenveld wrote: > Hi Grant > > On 14 Mar 2007, at 22:12, Christian Hesse wrote: > > Ahhh ... you're trying to do all of this without the signal > > processing toolbox, aren't you. In that case I must apologize for > > having given you slightly inaccurate info before: the DPSS and > > WINDOW functions are from the signal processing toolbox. > > > > ... > > Realistically speaking though, it seems to me that your best > > options are basically a) to get the signal processing toolbox, or > > b) to just write your own matlab functions to estimate your power > > spectra (about 3 lines of code) and then calculate your SEF and MF > > measures (another few lines at most). > > with respect to option "b": I think the easiest is to replicate the > WINDOW function from the signal preocessing toolbox. The dpss is > difficult, but hanning, triangle, rectwin and some others are > trivial. The WINDOW function is just a convenient wrapper function > for various tapers. See at the bottom of this mail for the full help. > The window replacement function to be written should behave as > > >> tap = window('hanning', 10) > tap = > 0.0794 > 0.2923 > 0.5712 > 0.8274 > 0.9797 > 0.9797 > 0.8274 > 0.5712 > 0.2923 > 0.0794 > > >> tap = window('rectwin', 10) > tap = > 1 > 1 > 1 > 1 > 1 > 1 > 1 > 1 > 1 > 1 > > >> tap = window('triang', 10) > tap = > 0.1000 > 0.3000 > 0.5000 > 0.7000 > 0.9000 > 0.9000 > 0.7000 > 0.5000 > 0.3000 > 0.1000 > > I hope that this suggestion helps, > Robert > > > --------------- > > >> help window > WINDOW Window function gateway. > WINDOW(@WNAME,N) returns an N-point window of type specified > by the function handle @WNAME in a column vector. @WNAME can > be any valid window function name, for example: > @bartlett - Bartlett window. > @barthannwin - Modified Bartlett-Hanning window. > @blackman - Blackman window. > @blackmanharris - Minimum 4-term Blackman-Harris window. > @bohmanwin - Bohman window. > @chebwin - Chebyshev window. > @flattopwin - Flat Top window. > @gausswin - Gaussian window. > @hamming - Hamming window. > @hann - Hann window. > @kaiser - Kaiser window. > @nuttallwin - Nuttall defined minimum 4-term Blackman-Harris > window. > @parzenwin - Parzen (de la Valle-Poussin) window. > @rectwin - Rectangular window. > @tukeywin - Tukey window. > @triang - Triangular window. > WINDOW(@WNAME,N,OPT) designs the window with the optional input > argument > specified in OPT. To see what the optional input arguments are, > see the help > for the individual windows, for example, KAISER or CHEBWIN. > WINDOW launches the Window Design & Analysis Tool (WinTool). > EXAMPLE: > N = 65; > w = window(@blackmanharris,N); > w1 = window(@hamming,N); > w2 = window(@gausswin,N,2.5); > plot(1:N,[w,w1,w2]); axis([1 N 0 1]); > legend('Blackman-Harris','Hamming','Gaussian'); > > See also bartlett, barthannwin, blackman, blackmanharris, > bohmanwin, > chebwin, gausswin, hamming, hann, kaiser, nuttallwin, > parzenwin, > rectwin, triang, tukeywin, WINTOOL. -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From c.hesse at FCDONDERS.RU.NL Fri Mar 16 17:56:21 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Fri, 16 Mar 2007 17:56:21 +0100 Subject: Spectral Medium, Edge and Dominant Frequency Functions In-Reply-To: <1174063569.11369.63.camel@localhost.localdomain> Message-ID: Hi Grant, glad I was (eventually) able to help you out; good luck and success with option b) ! On 16 Mar 2007, at 17:46, Grant McAuley wrote: > Thanks Christian, > > This is very helpful. I did not know about the 'cumsum' function - it > makes this almost trivial. > > ~ Grant b.t.w. you could have also done it in 2 lines of code without the cumsum function: pyy_cum = pyy_norm; for i=1:length(pyy_cum), if (i>1), pyy_cum(i) = pyy_cum(i) + pyy_cum (i-1); end; end; % or leave out the if statement if you are sure that length(pyy_cum) >=2 ;-) ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Mon Mar 19 00:14:35 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Sun, 18 Mar 2007 16:14:35 -0700 Subject: MultiplotER using Neuromag lay In-Reply-To: Message-ID: Hi, Christian, Sorry I didn't reply this for a long time. Thanks for these suggestions. They work well. And I found after using read_data, the other processing still can work for whole data. However, I met another problem. After I did timelockanalysis, I tried to plot average data using multiplotER. I downloaded the file "NM306mag.lay" and other two you offered. The layoutplot(cfg) shows that the files are correct. However, when I used multiplotER(cfg,avgdata), the figure showed up was blank. Nothing on it even the lables. Could you or other experts tell me the possible way to figure it out? Thanks so much. Best, Eve Christian Hesse wrote: Hi Eve, I can use meg-pd toolbox now. However, it seems all the functions in FieldTrip are for evoked data while my raw data is continuous data. FieldTrip handles a variety of data, and the low level reading functions can deal with continuous or epoch based raw data. When you analyze your data in FT, you usually start by defining your trials, i.e. epochs in your continuous data that are of interest, w.r.t. to some sort of trigger or event. The function PREPROCESSING then scans through your raw data file and returns a data structure which contains all of the specified epochs (for a particular trial definition) in a field data.trial. Please note that this has nothing to do with evoked vs induced responses just yet. You can use the output of PREPROCESSING as input to either TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced phenomena, respectively. Afterwards you can call various statistical functions such as FREQDESCRIPTIVES, etc ... So the reason why I have been giving you the examples using read_header and read_data is because I needed to determine the nature of the error you were getting without really knowning anything about what sort of data is in your file. In your use of FT you do not actually use these functions yourself, but basically use functions like DEFINE_TRIAL and PREPROCESSING to start with. --------------------------------- No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Mon Mar 19 08:52:40 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Mon, 19 Mar 2007 08:52:40 +0100 Subject: MultiplotER using Neuromag lay In-Reply-To: <448639.81069.qm@web56614.mail.re3.yahoo.com> Message-ID: Hi Eve, > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. Could you email (cut past from matlab) any of the warnings and errors that the call to MULTIPLOTER produced, thanks. It is also possible that this strange behaviour of MULTIPLOTER may have something to do with some minor changes that were recently made to the layout structure used by FT. There is now a function called PREPARE_LAYOUT (download the latest version of FT, and it lives in the fieldtrip directory) which will generate the correct layout structure for you, using the gradiometer information in your data structure. Try using the layout generated by this function for plotting, and please let me know if there are any errors. Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From jgross at UNI-DUESSELDORF.DE Mon Mar 19 10:38:12 2007 From: jgross at UNI-DUESSELDORF.DE (Joachim Gross) Date: Mon, 19 Mar 2007 09:38:12 +0000 Subject: MultiplotER using Neuromag lay In-Reply-To: <448639.81069.qm@web56614.mail.re3.yahoo.com> Message-ID: Hi Eve, I think I had a similar problem. In my case the channel labels in NM306mag.lay did not exactly match the labels in avgdata.label. After changing either set of labels it worked for me. Joachim alotof eve wrote: > Hi, Christian, > > Sorry I didn't reply this for a long time. Thanks for these > suggestions. They work well. And I found after using read_data, the > other processing still can work for whole data. > > However, I met another problem. > > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. > > Could you or other experts tell me the possible way to figure it > out? Thanks so much. > > Best, > Eve > > > */Christian Hesse /* wrote: > > Hi Eve, > >> I can use meg-pd toolbox now. However, it seems all the functions >> in FieldTrip are for evoked data while my raw data is continuous >> data. > > FieldTrip handles a variety of data, and the low level reading > functions can deal with continuous or epoch based raw data. > > When you analyze your data in FT, you usually start by defining > your trials, i.e. epochs in your continuous data that are of > interest, w.r.t. to some sort of trigger or event. The function > PREPROCESSING then scans through your raw data file and returns a > data structure which contains all of the specified epochs (for a > particular trial definition) in a field data.trial. Please note > that this has nothing to do with evoked vs induced responses just yet. > > You can use the output of PREPROCESSING as input to either > TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced > phenomena, respectively. Afterwards you can call various > statistical functions such as FREQDESCRIPTIVES, etc ... > > So the reason why I have been giving you the examples using > read_header and read_data is because I needed to determine the > nature of the error you were getting without really knowning > anything about what sort of data is in your file. In your use of > FT you do not actually use these functions yourself, but basically > use functions like DEFINE_TRIAL and PREPROCESSING to start with. > > ------------------------------------------------------------------------ > No need to miss a message. Get email on-the-go > > with Yahoo! Mail for Mobile. Get started. > From sameer at ANDREW.CMU.EDU Mon Mar 19 14:26:39 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 19 Mar 2007 09:26:39 -0400 Subject: cross spectral density issues Message-ID: Hi, When I do cfgCSD = []; cfgCSD.output = 'powandcsd'; cfgCSD.method = 'mtmfft'; cfgCSD.foilim = [5 100]; cfgCSD.tapsmofrq = 5; cfgCSD.keeptrials = 'yes'; cfgCSD.channel = {'MEG'} ; cfgCSD.channelcmb = {'MEG' 'MEG'}; freqCSD_RR_One = freqanalysis(cfgCSD,dataRR_One); I get the following error. ??? Error using ==> unknown Maximum variable size allowed by the program is exceeded. Error in ==> freqanalysis_mtmfft at 342 if csdflg, crsspctrm = complex(zeros(numper,numsgncmb,numboi)); end Error in ==> freqanalysis at 167 [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); But I remember using something very close to this some ten days ago. So I am not sure what I might be doing wrong. Any suggestions are very welcome. I tried using method 'mtmwelch' but that gave a host of other errors including looking for cfg.foi instead of cfg.foilim (non uniformity in application). best, sameer From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 19 15:27:39 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 19 Mar 2007 10:27:39 -0400 Subject: MultiplotER using Neuromag lay Message-ID: Hi, Can someone give me the link where I can download NM306mag.lay? Thanks, Matt -----Original Message----- From: FieldTrip discussion list on behalf of Joachim Gross Sent: Mon 3/19/2007 5:38 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay Hi Eve, I think I had a similar problem. In my case the channel labels in NM306mag.lay did not exactly match the labels in avgdata.label. After changing either set of labels it worked for me. Joachim alotof eve wrote: > Hi, Christian, > > Sorry I didn't reply this for a long time. Thanks for these > suggestions. They work well. And I found after using read_data, the > other processing still can work for whole data. > > However, I met another problem. > > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. > > Could you or other experts tell me the possible way to figure it > out? Thanks so much. > > Best, > Eve > > > */Christian Hesse /* wrote: > > Hi Eve, > >> I can use meg-pd toolbox now. However, it seems all the functions >> in FieldTrip are for evoked data while my raw data is continuous >> data. > > FieldTrip handles a variety of data, and the low level reading > functions can deal with continuous or epoch based raw data. > > When you analyze your data in FT, you usually start by defining > your trials, i.e. epochs in your continuous data that are of > interest, w.r.t. to some sort of trigger or event. The function > PREPROCESSING then scans through your raw data file and returns a > data structure which contains all of the specified epochs (for a > particular trial definition) in a field data.trial. Please note > that this has nothing to do with evoked vs induced responses just yet. > > You can use the output of PREPROCESSING as input to either > TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced > phenomena, respectively. Afterwards you can call various > statistical functions such as FREQDESCRIPTIVES, etc ... > > So the reason why I have been giving you the examples using > read_header and read_data is because I needed to determine the > nature of the error you were getting without really knowning > anything about what sort of data is in your file. In your use of > FT you do not actually use these functions yourself, but basically > use functions like DEFINE_TRIAL and PREPROCESSING to start with. > > ------------------------------------------------------------------------ > No need to miss a message. Get email on-the-go > > with Yahoo! Mail for Mobile. Get started. > From Daria.Osipova at FCDONDERS.RU.NL Mon Mar 19 15:47:57 2007 From: Daria.Osipova at FCDONDERS.RU.NL (Daria Osipova) Date: Mon, 19 Mar 2007 15:47:57 +0100 Subject: FW: [FIELDTRIP] .lay layout file for neuromag 306 channels Message-ID: Hi Matt Here they are. Best regards, Dasha PS Robert, wouldn't it be a good idea to include these layouts in fieldtrip? _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daria Osipova Sent: Monday, February 19, 2007 4:31 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Attached are 306-channel Neuromag layout files (also for magnetometers and gradiometers separately). Cheers, Dasha _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Christian Hesse Sent: Monday, February 19, 2007 9:19 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Sameer, please have a look at the FT (in fieldtrip/private) function "createlayout.m" (in the fieldtrip/private directory) which should be able to create a layout for your Neuromag306 data on the fly. The function takes a structure containing gradiometer information as input. If you read in your data using "preprocessing.m" then the gradiometer info will be contained in a field called data.grad. Hope this helps, Christian On 16 Feb 2007, at 21:46, Sameer Walawalkar wrote: Hi, As I had written some time ago, I could not find a .lay file which would be useful for neuromag 306 (there is a NM122.lay file there). Is there some way around this? sameer ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 19 16:30:42 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 19 Mar 2007 11:30:42 -0400 Subject: FW: [FIELDTRIP] .lay layout file for neuromag 306 channels Message-ID: Hi Dasha, Sorry,I don't see the attachment. Matt ________________________________ From: FieldTrip discussion list on behalf of Daria Osipova Sent: Mon 3/19/2007 10:47 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] FW: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Matt Here they are. Best regards, Dasha PS Robert, wouldn't it be a good idea to include these layouts in fieldtrip? _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daria Osipova Sent: Monday, February 19, 2007 4:31 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Attached are 306-channel Neuromag layout files (also for magnetometers and gradiometers separately). Cheers, Dasha _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Christian Hesse Sent: Monday, February 19, 2007 9:19 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Sameer, please have a look at the FT (in fieldtrip/private) function "createlayout.m" (in the fieldtrip/private directory) which should be able to create a layout for your Neuromag306 data on the fly. The function takes a structure containing gradiometer information as input. If you read in your data using "preprocessing.m" then the gradiometer info will be contained in a field called data.grad. Hope this helps, Christian On 16 Feb 2007, at 21:46, Sameer Walawalkar wrote: Hi, As I had written some time ago, I could not find a .lay file which would be useful for neuromag 306 (there is a NM122.lay file there). Is there some way around this? sameer ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- From Daria.Osipova at FCDONDERS.RU.NL Mon Mar 19 16:42:28 2007 From: Daria.Osipova at FCDONDERS.RU.NL (Daria Osipova) Date: Mon, 19 Mar 2007 16:42:28 +0100 Subject: MultiplotER using Neuromag lay In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB01103578@medstudent.medschool.nt.pitt.edu> Message-ID: Oops they didn't get attached Hopefully now it works -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Shtrahman, Matthew Sent: Monday, March 19, 2007 3:28 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay Hi, Can someone give me the link where I can download NM306mag.lay? Thanks, Matt -----Original Message----- From: FieldTrip discussion list on behalf of Joachim Gross Sent: Mon 3/19/2007 5:38 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay Hi Eve, I think I had a similar problem. In my case the channel labels in NM306mag.lay did not exactly match the labels in avgdata.label. After changing either set of labels it worked for me. Joachim alotof eve wrote: > Hi, Christian, > > Sorry I didn't reply this for a long time. Thanks for these > suggestions. They work well. And I found after using read_data, the > other processing still can work for whole data. > > However, I met another problem. > > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. > > Could you or other experts tell me the possible way to figure it > out? Thanks so much. > > Best, > Eve > > > */Christian Hesse /* wrote: > > Hi Eve, > >> I can use meg-pd toolbox now. However, it seems all the functions >> in FieldTrip are for evoked data while my raw data is continuous >> data. > > FieldTrip handles a variety of data, and the low level reading > functions can deal with continuous or epoch based raw data. > > When you analyze your data in FT, you usually start by defining > your trials, i.e. epochs in your continuous data that are of > interest, w.r.t. to some sort of trigger or event. The function > PREPROCESSING then scans through your raw data file and returns a > data structure which contains all of the specified epochs (for a > particular trial definition) in a field data.trial. Please note > that this has nothing to do with evoked vs induced responses just yet. > > You can use the output of PREPROCESSING as input to either > TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced > phenomena, respectively. Afterwards you can call various > statistical functions such as FREQDESCRIPTIVES, etc ... > > So the reason why I have been giving you the examples using > read_header and read_data is because I needed to determine the > nature of the error you were getting without really knowning > anything about what sort of data is in your file. In your use of > FT you do not actually use these functions yourself, but basically > use functions like DEFINE_TRIAL and PREPROCESSING to start with. > > ------------------------------------------------------------------------ > No need to miss a message. Get email on-the-go > > with Yahoo! Mail for Mobile. Get started. > -------------- next part -------------- A non-text attachment was scrubbed... Name: NM306planar.lay Type: application/octet-stream Size: 9638 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NM306mag.lay Type: application/octet-stream Size: 5027 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NM306all.lay Type: application/octet-stream Size: 14476 bytes Desc: not available URL: From c.hesse at FCDONDERS.RU.NL Mon Mar 19 17:02:38 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Mon, 19 Mar 2007 17:02:38 +0100 Subject: MultiplotER using Neuromag lay In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB01103578@medstudent.medschool.nt.pitt.edu> Message-ID: Hi Matt, you can use the function PREPARE_LAYOUT to generate a layout using the gradiometer information in your data. Regards, Christian On 19 Mar 2007, at 15:27, Shtrahman, Matthew wrote: > Hi, > > Can someone give me the link where I can download NM306mag.lay? > > Thanks, > > Matt > > > -----Original Message----- > From: FieldTrip discussion list on behalf of Joachim Gross > Sent: Mon 3/19/2007 5:38 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay > > Hi Eve, > > I think I had a similar problem. > In my case the channel labels in NM306mag.lay did not exactly match > the > labels in avgdata.label. > After changing either set of labels it worked for me. > > Joachim > > alotof eve wrote: >> Hi, Christian, >> >> Sorry I didn't reply this for a long time. Thanks for these >> suggestions. They work well. And I found after using read_data, the >> other processing still can work for whole data. >> >> However, I met another problem. >> >> After I did timelockanalysis, I tried to plot average data using >> multiplotER. I downloaded the file "NM306mag.lay" and other two you >> offered. The layoutplot(cfg) shows that the files are correct. >> However, when I used multiplotER(cfg,avgdata), the figure showed up >> was blank. Nothing on it even the lables. >> >> Could you or other experts tell me the possible way to figure it >> out? Thanks so much. >> >> Best, >> Eve >> >> >> */Christian Hesse /* wrote: >> >> Hi Eve, >> >>> I can use meg-pd toolbox now. However, it seems all the >>> functions >>> in FieldTrip are for evoked data while my raw data is continuous >>> data. >> >> FieldTrip handles a variety of data, and the low level reading >> functions can deal with continuous or epoch based raw data. >> >> When you analyze your data in FT, you usually start by defining >> your trials, i.e. epochs in your continuous data that are of >> interest, w.r.t. to some sort of trigger or event. The function >> PREPROCESSING then scans through your raw data file and returns a >> data structure which contains all of the specified epochs (for a >> particular trial definition) in a field data.trial. Please note >> that this has nothing to do with evoked vs induced responses >> just yet. >> >> You can use the output of PREPROCESSING as input to either >> TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and >> induced >> phenomena, respectively. Afterwards you can call various >> statistical functions such as FREQDESCRIPTIVES, etc ... >> >> So the reason why I have been giving you the examples using >> read_header and read_data is because I needed to determine the >> nature of the error you were getting without really knowning >> anything about what sort of data is in your file. In your use of >> FT you do not actually use these functions yourself, but >> basically >> use functions like DEFINE_TRIAL and PREPROCESSING to start with. >> >> --------------------------------------------------------------------- >> --- >> No need to miss a message. Get email on-the-go >> >> with Yahoo! Mail for Mobile. Get started. >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicola.ray at DPAG.OX.AC.UK Mon Mar 19 18:03:26 2007 From: nicola.ray at DPAG.OX.AC.UK (Niki Ray) Date: Mon, 19 Mar 2007 18:03:26 +0100 Subject: Exporting back to CTF tools Message-ID: Hi, Thank you for your previous answers re: ICA. Things are mush clearer now. I want to use the CTF tools to do a SAM analysis, but want to first run the ICA in fieldtrip. Is it possible to export data back into the format required by the CTF SAMsuite after preprocessing in fieldtrip? Thank you in advance! Niki From sameer at ANDREW.CMU.EDU Mon Mar 19 19:22:19 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 19 Mar 2007 14:22:19 -0400 Subject: frequencies of interest not assigned properly in freqanalysis Message-ID: I am trying to understand why the frequencies of interest do not seem to get assigned properly as shown below. cfgPre = ouput: 'powandcsd' method: 'mtmfft' keeptrials: 'no' tapsmofrq: 4 foilim: [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100] channel: 'MEG' channelcmb: {'MEG' 'MEG'} freqPreRR = freqanalysis(cfgPre,dataRRpre_One); freqPreRR = label: {306x1 cell} dimord: 'chan_freq' freq: [5.9880 7.9840 9.9800] powspctrm: [306x3 double] labelcmb: {46665x2 cell} crsspctrm: [46665x3 double] grad: [1x1 struct] cfg: [1x1 struct] thanks, sameer From ingrid.nieuwenhuis at FCDONDERS.RU.NL Mon Mar 19 19:49:30 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Mon, 19 Mar 2007 19:49:30 +0100 Subject: frequencies of interest not assigned properly in freqanalysis In-Reply-To: Message-ID: Hi Sameer, The frequency resolution with mtmfft depends on the length of your trials. Cfg.foilim should be only two numbers, the lower and upper boundary of the frequency. It seems as if you are confusing mtmconvol and mtmfft. In mtmconvol you can specify the cfg.foi as a vector with more than 2 frequencies. See the help information of these both functions. Hopes this helps you along, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Monday, March 19, 2007 7:22 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] frequencies of interest not assigned properly in freqanalysis I am trying to understand why the frequencies of interest do not seem to get assigned properly as shown below. cfgPre = ouput: 'powandcsd' method: 'mtmfft' keeptrials: 'no' tapsmofrq: 4 foilim: [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100] channel: 'MEG' channelcmb: {'MEG' 'MEG'} freqPreRR = freqanalysis(cfgPre,dataRRpre_One); freqPreRR = label: {306x1 cell} dimord: 'chan_freq' freq: [5.9880 7.9840 9.9800] powspctrm: [306x3 double] labelcmb: {46665x2 cell} crsspctrm: [46665x3 double] grad: [1x1 struct] cfg: [1x1 struct] thanks, sameer From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:22:55 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:22:55 +0100 Subject: write_tri.m file and results from volplot In-Reply-To: <6.1.2.0.2.20070312180158.05005420@email.med.yale.edu> Message-ID: On 12 Mar 2007, at 23:12, Brian Roach wrote: > To construct a headmodel for EEG source analysis. I have attached > the result from a call to: > > volplot(skin+skull+brain); I am new to this, and wonder how to > judge the success of this script in creating a new model. What > kinds of things do I want to see in this plot, or the volplot of > the skin, skull, or brain, individually? The example script says > that it requires a lot of trial and error, so I am assuming that > just running that script is not all that is necessary, but I do not > know. Hi Brian The segmentation in your figure looks fine to me. There are three tissue types visible at the locatins where you expect them, and the boundaries between the tissue types are also well defined and smooth. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:28:41 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:28:41 +0100 Subject: first steps using lcmv In-Reply-To: <8A3F5CCB-C26C-46E7-BE2C-22CF761817E0@lyon.inserm.fr> Message-ID: Hi Nathan On 7 Mar 2007, at 18:08, Nathan Weisz wrote: > i found a standard bem in the dipfit plugin folder of eeglab > (standard_vol.mat). > > >> vol > > vol = > > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > mat: [3000x3000 double] > type: 'dipoli' > > i guess that i can simply exchange my standard spherical model > (same as in eeglab) and use this bem volume for calculating the > leadfield. Yes, that volume conduction model is fine. > one aspect are the electrode locations: the positions are given on > a sphere ... so probably there'll has to be some transformation of > the positions. There should be EEG electrode locations for the 10-20, the 10-10 and the 10-5 system with the EEGLAB-dipfit release as well. If not, please use attached electrode file. It should match the BEM model. You can check the match with HEADMODELPLOT. you can do elec = read_fcdc_elec('standard_1005.elc'); and then cfg.elec = elec; or alternatively cfg.elecfile = 'standard_1005.elc'; in sourceanalysis. best Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: standard_1005.elc Type: application/octet-stream Size: 11176 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:40:58 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:40:58 +0100 Subject: Exporting back to CTF tools In-Reply-To: Message-ID: Hi Niki On 19 Mar 2007, at 18:03, Niki Ray wrote: > I want to use the CTF tools to do a SAM analysis, but want to > first run > the ICA in fieldtrip. Is it possible to export data back into the > format > required by the CTF SAMsuite after preprocessing in fieldtrip? We do not have tools to write CTF data. However, the CTF meg4 format is very simple. As long as you apply the same (inverse) amplitude calibration and convert the double data back to int32, it should be possible to insert the processed values back into a CTF meg4 file. You can have a look at fieldtrip/private/read_ctf_meg4.m and try to reverse-engineer the reading function. The code looks more complex than it is, that is due to the multi-file handling (files cannot be larger than 2GB). If I recall correctly, the meg4 file consists of a 8 byte header, followed by blocks of data. Each block is hdr.nSamples*hdr.nChans*4 butes large. Within a block the data is not multiplexed, but instead one channel after the other. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:58:57 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:58:57 +0100 Subject: cross spectral density issues In-Reply-To: Message-ID: Hi Sameer, On 19 Mar 2007, at 14:26, Sameer Walawalkar wrote: > When I do > > cfgCSD = []; > cfgCSD.output = 'powandcsd'; > cfgCSD.method = 'mtmfft'; > cfgCSD.foilim = [5 100]; > cfgCSD.tapsmofrq = 5; > cfgCSD.keeptrials = 'yes'; > cfgCSD.channel = {'MEG'} ; > cfgCSD.channelcmb = {'MEG' 'MEG'}; > freqCSD_RR_One = freqanalysis(cfgCSD,dataRR_One); > > I get the following error. > > ??? Error using ==> unknown > Maximum variable size allowed by the program is exceeded. > > Error in ==> freqanalysis_mtmfft at 342 > if csdflg, crsspctrm = complex(zeros > (numper,numsgncmb,numboi)); end How large is the matrix that you are trying to allocate? I.e. how large is Ntrials times (Nchans^2)/2 times the number of frequency bins? The number of frequency bins depends on the data, specifically on the length of your trials. For 1-sec trials, you have one frequency bin per Herz, for 2-sec trials you have two, etc. The total amount of memory is the number of elements in the matrix times 16 bytes (since each matrix element has a double precision real and imaginary number). > Error in ==> freqanalysis at 167 > [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, > data); > > > But I remember using something very close to this some ten days > ago. So I am not sure what I might be doing wrong. Any suggestions > are very welcome. You may have used fewer frequency bins (cfg.foilim) or the data may have had fewer trials. > I tried using method 'mtmwelch' but that gave a host of other > errors including looking for cfg.foi instead of cfg.foilim (non > uniformity in application). Please look at the documentation in FREQANALYSIS_MTMWELCH. I suspect that the mtmwelch method will require even more memory. Are you sure with the amount of data that you have that you want to keep trials? Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 22:12:29 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 22:12:29 +0100 Subject: MNI aligned grids, mris and segmentation In-Reply-To: Message-ID: Hi Sameer On 13 Mar 2007, at 15:27, Sameer Walawalkar wrote: > I want to start DICS analysis of my MEG data. For this I need to > have MRI and MEG data coregistered. I also need multisphere forward > models for which segmentation is necessary. > > Am I correct in understanding that the following webpage contains > info about segmentation? (in addition to MNI aligning all grids) > > From (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:create_single- > subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_spa > ce) I suggest that you also look at http://www2.ru.nl/fcdonders/fieldtrip/ doku.php? id=fieldtrip:documentation:make_leadfields_using_different_headmodels > Here, in the very beginning, > ... > I understand that in the commands above, first we are creating a > template mri to which all other grids will later be aligned. What > exactly is t1_icbm_normal_1mm_pn0_rf0.mnc ? Is it a slice from an > mri image. The idea here is to use an existing template MRI to construct a headmodel, and define a dipole grid in it. Then, each individual MRI is warped to the template MRI, and the inverse of that warp is applied to the dipole grid. Subsequently, an individual headmodel is made for each individual MRI and the warped dipole grid (in individual subjects' coordinates) is used together with the individual headmodel for the beaming. The source reconstructions are computed, and can immediately be averaged over subjects. The underlying motivation relates to group statistics without the neccessity to interpolate the source reconstructions to an artifical higher resolution. Since you are just starting with beamforming, I advice that you do not immediately try to follow the "MNI common grids" approach. Better is first to explore some single subject beamed data. > Can I give the path to my dicom mri images directory and the name > of a file ending in .dcm? > > Incidently >>> mri = > read_fcdc_mri('Z:\KarmaCond\BIRC_images_foolaround\070207134421\2 > \02-0001-000001.dcm'); > ??? Undefined function or variable "hdr". > > Error in ==> read_fcdc_mri at 179 > [z, indx] = sort(cell2mat({hdr.SliceLocation})); If you have the image processing toolbox, you should be able to read in a set of DICOM files. Note that the homogenous transformation matrix then is not yet correct, i.e. the slice resolution and spacing and the coordinate axes are not yet specified. Figuring the slice ordering from a set of loose dicom files is tricky. I think that the naming of your dicom files differs from ours, we have a directory containing files like this: ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.92.2003.7.31.11.19.16.578000.53834891.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.93.2003.7.31.11.19.16.578000.53834906.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.94.2003.7.31.11.19.16.578000.53834921.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.95.2003.7.31.11.19.16.578000.53834936.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.96.2003.7.31.11.19.16.578000.53834951.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.97.2003.7.31.11.19.16.578000.53834966.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.98.2003.7.31.11.19.16.15000.53831961.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.99.2003.7.31.11.19.16.15000.53831976.IMA The detection of the correct dcm files in your directory seems not to work. I suggest that you set a debugger breakpoint in read_fcdc_mri and that you step through it one line at a time. best regards, Robert From sghosh at HSS.IITD.AC.IN Tue Mar 20 09:37:42 2007 From: sghosh at HSS.IITD.AC.IN (Shantanu Ghosh) Date: Tue, 20 Mar 2007 09:37:42 +0100 Subject: Datastructure inclusion Message-ID: Hi Christian It took me sometime to figure out the dtaformat, so I prepared the format like this using a .MAT file and some synthetic data like this data = []; data.fsample = 115.3402; data.label = {'FP1'; 'FP2'; 'Fz'; %presently using only 3 channels %'F3'; 'F4'; 'F7'; 'F8'; ... %'T3'; 'T4'; 'T5'; 'T6';... %'P3'; 'P4'; 'Pz'; 'O1'; 'O2'; 'Oz';... %'C3'; 'C4'; 'Cz'; 'A1'; 'A2'; 'EKG'}; data.nTrial=3; trial1 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];% other channel data to be added here trial2 = [[2.9;2.2;2.3;2.4;2.2],[7.5;7.9;7.8;7.2;7.1],[1.5;1.9;1.8;1.2;1.1]];%sllrly, other channel data to be added here trial3 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];% sllrly,other channel data to be added here time1 = [1,2,3,4,5];%and here time2 = [.1,.2,.3,.4,.5];%and here time3 = [1,2,3,4,5];%and here %Is there another way to do this as the same time axis is there for all channels? data.trial = cell(data.nTrial,1); data.trial{1,1} = trial1 ; data.trial{2,1} = trial2 ; data.trial{3,1} = trial3 ; data.time = cell(data.nTrial,1) ; data.time{1,1} = time1; data.time{2,1} = time2; data.time{3,1} = time3; data Gives the output data = fsample: 115.3402 label: {23x1 cell} nTrial: 3 trial: {3x1 cell} time: {3x1 cell} If this is ok, then why am I getting error when I run it for FT? >> read_fcdc_data(data); ??? Function 'exist' is not defined for values of class 'struct'. Error in ==> exist at 41 [varargout{1:nargout}] = builtin('exist', varargin{:}); Error in ==> fieldtrip\private\read_data at 70 if ~exist(filename) Error in ==> read_fcdc_data at 49 [dat] = read_data(varargin{:}); -------------- next part -------------- data = []; data.fsample = 115.3402; data.label = {'FP1'; 'FP2'; 'Fz'; % 'F3'; 'F4'; 'F7'; 'F8'; ... % 'T3'; 'T4'; 'T5'; 'T6';... % 'P3'; 'P4'; 'Pz'; 'O1'; 'O2'; 'Oz';...\exp1\myDataStructure % 'C3'; 'C4'; 'Cz'; 'A1'; 'A2'; 'EKG'}; data.nTrial=3; trial1 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];%...other channels to be added here trial2 = [[2.9;2.2;2.3;2.4;2.2],[7.5;7.9;7.8;7.2;7.1],[1.5;1.9;1.8;1.2;1.1]];%...other channels to be added here trial3 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];%...other channels to be added here time1 = [1,2,3,4,5]; time2 = [.1,.2,.3,.4,.5]; time3 = [1,2,3,4,5]; data.trial = cell(data.nTrial,1); data.trial{1,1} = trial1 ; data.trial{2,1} = trial2 ; data.trial{3,1} = trial3 ; data.time = cell(data.nTrial,1) ; data.time{1,1} = time1; data.time{2,1} = time2; data.time{3,1} = time3; data From c.hesse at FCDONDERS.RU.NL Tue Mar 20 10:59:27 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 20 Mar 2007 10:59:27 +0100 Subject: Neuromag layouts Message-ID: Dear Neuromag Users, to facilitate (any kind of) topographical plotting of your 122 or 306 channel MEG data, fieldtrip now includes (or at least will from the next daily update this evening 22:00 CET) several *.lay files for Neuromag systems. If the labels in your data do not match the labels any of the layout files, then you can readily generate your own layout using the function PREPARE_LAYOUT which requires an input data structure containing a field with gradiometer information, e.g., your data header or the data output from PREPROCESSING. (Note that this function can handle channel labels with and without spaces between the "MEG" and "number" tokens of the label string.) You can check whether the layout is correct using the function LAYOUTPLOT Hope you find this helpful Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 20 12:12:42 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 20 Mar 2007 12:12:42 +0100 Subject: Data structur In-Reply-To: <1416.10.100.2.68.1174375806.squirrel@www.iitd.ac.in> Message-ID: Hi Shantanu, > It took me sometime to figure out the dtaformat, so I prepared the > format > like this using a .MAT file and some synthetic data like this > > data = []; > data.fsample = 115.3402; > data.label = {'FP1'; 'FP2'; 'Fz'; %presently using only 3 channels > %'F3'; 'F4'; 'F7'; 'F8'; ... > %'T3'; 'T4'; 'T5'; 'T6';... > %'P3'; 'P4'; 'Pz'; 'O1'; 'O2'; 'Oz';... > %'C3'; 'C4'; 'Cz'; 'A1'; 'A2'; 'EKG'}; > > data.nTrial=3; > > trial1 = > [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];% > other channel data to be added here > trial2 = > [[2.9;2.2;2.3;2.4;2.2],[7.5;7.9;7.8;7.2;7.1],[1.5;1.9;1.8;1.2;1.1]]; > %sllrly, > other channel data to be added here > trial3 = > [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]]; > %sllrly,other > channel data to be added here > > time1 = [1,2,3,4,5];%and here > time2 = [.1,.2,.3,.4,.5];%and here > time3 = [1,2,3,4,5];%and here > > %Is there another way to do this as the same time axis is there for > all > channels? The FT data structure assumes that there is one time axis for each trial which is the same for all channels. In your case it may even be the same time axis on all trials, however, this is a) not the general case and b) a trial time axis is required later on for averaging and spectral analysis to make sure the data epochs on different trials are correctly aligned over trials. > > data.trial = cell(data.nTrial,1); > > data.trial{1,1} = trial1 ; > data.trial{2,1} = trial2 ; > data.trial{3,1} = trial3 ; > > data.time = cell(data.nTrial,1) ; > > data.time{1,1} = time1; > data.time{2,1} = time2; > data.time{3,1} = time3; > > data > > > Gives the output > > data = > > fsample: 115.3402 > label: {23x1 cell} > nTrial: 3 > trial: {3x1 cell} > time: {3x1 cell} This is the correct format (except that in FT there is no "nTrial" field); > If this is ok, then why am I getting error when I run it for FT? > >>> read_fcdc_data(data); > ??? Function 'exist' is not defined for values of class 'struct'. > > Error in ==> exist at 41 > [varargout{1:nargout}] = builtin('exist', varargin{:}); > > Error in ==> fieldtrip\private\read_data at 70 > if ~exist(filename) > > Error in ==> read_fcdc_data at 49 > [dat] = read_data(varargin{:}); If you look at the function definition (interface) for READ_FCDC_DATA you will see that it expects a sting argument (i.e. a filename) as input since it is used to read data from data files with known format. The error is generated because Matlab is trying to determine whether your input "data" refers to an existing file in the system, which of course it does not. Since the data format you are using is not known to FT, you cannot use any of the READ_FCDC_XXXX (or lower level) functions. Instead, you have to read your data into an FT data structure yourself, as you now seem to have done successfully. Once you have the data structure, you just pass it to the different analysis functions like TIMELOCKANALYSIS or FREQANALYSIS. I hope this helps, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ychen at BME.UFL.EDU Tue Mar 20 15:32:19 2007 From: ychen at BME.UFL.EDU (Chen) Date: Tue, 20 Mar 2007 15:32:19 +0100 Subject: weird result for EEG visual N1 source localization using lcmv Message-ID: Hi, I am doing source localization on EEG biosemi 128 channels recordings and get weird result. I am giving the details in the following to seek any help: KrisS = eeglab2fieldtrip(EEG,'preprocessing'); cfg=[]; cfg.latency=[.08 .12]; %latency of N1 cfg.covariancewindow=[.08 .12]; cfg.covariance='yes'; cfg.keeptrials='no'; datTest=timelockanalysis(cfg,KrisS); clear KrisS cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 5; figure(1);topoplotER(cfg,datTest); datTest.elec.pnt = 1000 * datTest.elec.pnt*[0 -1 0; 1 0 0;0 0 1]; %convert electrode coordinates from m to mm and make the x go to nose load standard_vol.mat %use standard BEM vol from EEGLAB load standard_mri.mat %use standard mri from EEGLAB cfg=[]; cfg.vol=vol; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; [grid] = prepare_leadfield(cfg, datTest); cfg=[]; cfg.grid=source2sparse(grid); cfg.method='lcmv'; cfg.vol=vol; cfg.projectnoise='yes'; cfg.lambda=1; [sourceN1] = sourceanalysis(cfg, datTest); cfg=[]; cfg.powmethod='none'; %only option that works [sourcenai] = sourcedescriptives(cfg, sourceN1); cfg =[]; cfg.downsample = 2; cfg.funparameter = 'nai';%or neural activity indes (nai) sourceN1F=source2full(sourcenai); [interp]=sourceinterpolate(cfg,sourceN1F,mri); figure(3);sliceinterp(cfg,interp) I have the following specific questions: 1. Should the units all be mm? 2. Is my coordinate rotation right? 3. How to choose the value of lambda? I just randomly choose 1 now since without lamda I always get warnings of rank-deficient and divided by zeros. 4. Since I am using the standard BEM and mri, my electrodes are not on the skin( see the attached figure), when I try to realign based on fiducials, it is still the same. I check the function of electroderealign and find out that norm.m is always identy matrix which make the realign doing nothing. Why? Appreciate to point out what I am wrong. Chen -------------- next part -------------- A non-text attachment was scrubbed... Name: TopoN1.jpg Type: image/pjpeg Size: 43181 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1source.jpg Type: image/pjpeg Size: 32703 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ElecHead.jpg Type: image/pjpeg Size: 36116 bytes Desc: not available URL: From sameer at ANDREW.CMU.EDU Tue Mar 20 19:10:36 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 20 Mar 2007 14:10:36 -0400 Subject: MNI aligned grids, mris and segmentation In-Reply-To: Message-ID: Dear Robert, Thank you for your reply to my question about (MNI aligned grids, MRIs and segmentation). I am going to take your advise of exploring single subject beamed data. But, I want to clarify one or two points before going on. I am using Neuromag 306 data. Or the MRIs, I have already used MNE to generate bem head model meshes stored in files of kind _bem_sol.fif, but which fieldtrip program do I use to extract this (the info is for ctf and I could not find an intuitive or obvious extension to my case). Can I simply proceed as bem_head = appropriate-field-trip-function(_bem_sol.fif); hdr = read_fcdc_header(datafile.fif); cfg = []; cfg.grad = hdr.grad; cfg.vol = bem_head; cfg.resolution = 1; grid_bem = prepare_leadfield(cfg); Also am not sure how to extract head shape which is needed for plotting headmodel. Is it shimply the HPI coils information ? thanks for your time. sameer On Mon, 19 Mar 2007, Robert Oostenveld wrote: > Hi Sameer > > On 13 Mar 2007, at 15:27, Sameer Walawalkar wrote: >> I want to start DICS analysis of my MEG data. For this I need to have MRI >> and MEG data coregistered. I also need multisphere forward models for which >> segmentation is necessary. >> >> Am I correct in understanding that the following webpage contains info >> about segmentation? (in addition to MNI aligning all grids) >> >> From (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? >> id=fieldtrip:documentation:create_single- >> subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) > > I suggest that you also look at http://www2.ru.nl/fcdonders/fieldtrip/ > doku.php? > id=fieldtrip:documentation:make_leadfields_using_different_headmodels > >> Here, in the very beginning, >> ... >> I understand that in the commands above, first we are creating a template >> mri to which all other grids will later be aligned. What exactly is >> t1_icbm_normal_1mm_pn0_rf0.mnc ? Is it a slice from an mri image. > > The idea here is to use an existing template MRI to construct a headmodel, > and define a dipole grid in it. Then, each individual MRI is warped to the > template MRI, and the inverse of that warp is applied to the dipole grid. > Subsequently, an individual headmodel is made for each individual MRI and the > warped dipole grid (in individual subjects' coordinates) is used together > with the individual headmodel for the beaming. The source reconstructions are > computed, and can immediately be averaged over subjects. The underlying > motivation relates to group statistics without the neccessity to interpolate > the source reconstructions to an artifical higher resolution. > > Since you are just starting with beamforming, I advice that you do not > immediately try to follow the "MNI common grids" approach. Better is first to > explore some single subject beamed data. > >> Can I give the path to my dicom mri images directory and the name of a file >> ending in .dcm? >> >> Incidently >>>> mri = >> read_fcdc_mri('Z:\KarmaCond\BIRC_images_foolaround\070207134421\2 >> \02-0001-000001.dcm'); >> ??? Undefined function or variable "hdr". >> >> Error in ==> read_fcdc_mri at 179 >> [z, indx] = sort(cell2mat({hdr.SliceLocation})); > > If you have the image processing toolbox, you should be able to read in a set > of DICOM files. Note that the homogenous transformation matrix then is not > yet correct, i.e. the slice resolution and spacing and the coordinate axes > are not yet specified. Figuring the slice ordering from a set of loose dicom > files is tricky. I think that the naming of your dicom files differs from > ours, we have a directory containing files like this: > > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.92.2003.7.31.11.19.16.578000.53834891.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.93.2003.7.31.11.19.16.578000.53834906.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.94.2003.7.31.11.19.16.578000.53834921.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.95.2003.7.31.11.19.16.578000.53834936.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.96.2003.7.31.11.19.16.578000.53834951.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.97.2003.7.31.11.19.16.578000.53834966.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.98.2003.7.31.11.19.16.15000.53831961.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.99.2003.7.31.11.19.16.15000.53831976.IMA > > The detection of the correct dcm files in your directory seems not to work. I > suggest that you set a debugger breakpoint in read_fcdc_mri and that you step > through it one line at a time. > > best regards, > Robert > From h.stoegbauer at GMAIL.COM Wed Mar 21 00:02:59 2007 From: h.stoegbauer at GMAIL.COM (Harald Stoegbauer) Date: Tue, 20 Mar 2007 16:02:59 -0700 Subject: timelockstatistics Message-ID: Hi FieldTrippers, Exist there any example code for the 'timelockstatistics' function ? Thanks, Harald -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Wed Mar 21 07:03:23 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Wed, 21 Mar 2007 07:03:23 +0100 Subject: timelockstatistics In-Reply-To: Message-ID: Dear Harald, Exist there any example code for the 'timelockstatistics' function ? Not yet, but we are working on it. To get started, you could make use of the clusterrandanalysis-tutorial and combine this with the help-information from timelockstatistics. Clusterrandanalysis is the predecessor of timelock-, freq-, and sourcestatistics. Good luck, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulla.rantakokko at TKK.FI Wed Mar 21 09:41:45 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Wed, 21 Mar 2007 10:41:45 +0200 Subject: TFR:boundaries, resolution Message-ID: Hi everyone, 1. Is there a way to get rid of boundary effects for low frequencies. The boundary is moving but it is not disappearing. 2. The output is very grainy i.e. so called pixels are big and sharp edged even with as high tapsmofrq as is possible with available memory. Is there a way to make the output prettier ? 3. TopoplotTFR is not functioning. It only draws a blank figure. MultiplotTFR and singleplotTFR function perfectly. I use .grad generated layout for 306 channel Neuromag. Thanks Ulla From muthuraman10 at HOTMAIL.COM Wed Mar 21 11:02:55 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Wed, 21 Mar 2007 10:02:55 +0000 Subject: Sliceinterp-Sourceplot! Message-ID: Hello Fieldtrippers, I have attached two plots with this mail, one is sliceinterp and the other is the source plot of the same data with MRI taken from the fieldtrip 'subject01.mri' In the sourceplot i do not get the anatomical information, according to the fieldtrip documentation need to interpolate the functional data with the anatomical data by sourceinterpolate.m and then is the configuration for the source plot then i get the error cfg.method='ortho'; cfg.slicedim=3; cfg.anaparamter= 'anatomy'; cfg.funparameter='coh'; cfg.maskparameter='coh'; sourceplot(cfg,interp); I get the error ??? Error using ==> reshape To RESHAPE the number of elements must not change. Error in ==> sourceplot at 409 if hasana, ana = reshape(ana, dim); end; Any suggestions on this will be appreciated Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It�s cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in -------------- next part -------------- A non-text attachment was scrubbed... Name: sliceinterp.jpg Type: image/jpeg Size: 43669 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sourceplot.jpg Type: image/jpeg Size: 35027 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Wed Mar 21 12:44:12 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 21 Mar 2007 12:44:12 +0100 Subject: Sliceinterp-Sourceplot! In-Reply-To: Message-ID: On 21 Mar 2007, at 11:02, Muthuraman Muthuraman wrote: > I get the error > > ??? Error using ==> reshape > To RESHAPE the number of elements must not change. > > Error in ==> sourceplot at 409 > if hasana, ana = reshape(ana, dim); end; > > Any suggestions on this will be appreciated You seem to have constructed an interpolated source reconstruction in which the anatomy and the functional data are not on the same grid of voxels. What is the cfg and the output of sourceinterpolate? Robert From muthuraman10 at HOTMAIL.COM Wed Mar 21 13:04:40 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Wed, 21 Mar 2007 12:04:40 +0000 Subject: Sliceinterp-Sourceplot! In-Reply-To: <8F94F951-2872-456B-A9E3-CB5E07FB15C8@fcdonders.ru.nl> Message-ID: Hello Dr.Robert, Thankyou for the immediate reply, the cfg structure of the sourceinterpolate [mri] = read_fcdc_mri('Subject01.mri') dim: [256 256 256] anatomy: [256x256x256 uint16] hdr: [1x1 struct] transform: [4x4 double] cfg.downsample=4; [interp] = sourceinterpolate(cfg, source1, mri) and the output of sourceinterpolate avg: [1x1 struct] inside: [64x64x64 logical] dim: [64 64 64] transform: [4x4 double] anatomy: [64x64x64 uint16] cfg: [1x1 struct] Thanking you With regards M.Muthuraman. _________________________________________________________________ Sign in and get updated on all the action from Formula One http://content.msn.co.in/Sports/FormulaOne/Default From r.oostenveld at FCDONDERS.RU.NL Wed Mar 21 13:37:39 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 21 Mar 2007 13:37:39 +0100 Subject: MNI aligned grids, mris and segmentation In-Reply-To: Message-ID: On 20 Mar 2007, at 19:10, Sameer Walawalkar wrote: > I am using Neuromag 306 data. Or the MRIs, I have already used MNE > to generate bem head model meshes stored in files of kind > _bem_sol.fif, but which fieldtrip program do I use to > extract this (the info is for ctf and I could not find an intuitive > or obvious extension to my case). > > Can I simply proceed as You can use neuromag BEM models, but that requires a licensed copy of the meg-calc toolbox (which contans some mex files that are then called by fieldtrip). > bem_head = appropriate-field-trip-function(_bem_sol.fif); > hdr = read_fcdc_header(datafile.fif); > > cfg = []; > cfg.grad = hdr.grad; instead of cfg.grad please specify cfg.gradfile='datafile.fif', since has to be interpreted by the neuromag mex files. > cfg.vol = bem_head; instead of reading the model with appropriate-field-trip-function() you should specify the file that contains the model. That is done with cfg.hdmfile. The neuromag mex file will then "initialize" with the model in the fif file. > cfg.resolution = 1; > grid_bem = prepare_leadfield(cfg); Then the remainder should in principle work. I have not been able to test it exhaustivelym since I do not have a license for the neuromag meg-calc toolbox. > Also am not sure how to extract head shape which is needed for > plotting headmodel. Is it shimply the HPI coils information ? The head shape is the triangulated boundary. That boundary will be read from the fif file at the appropriate time (e.g. in headmodelplot). Actually, the initialization of the neuromag mex files and reading of the triangulation is done in private/ prepare_vol_sens. I suggest you look in that function and search for 'neuromag_fif'. hope this helps, Robert PS you can also use other head models, such as single and multiple spheres and a analytic realistic single-shell model. Those are all implemneted in plain Matlab. From r.oostenveld at FCDONDERS.RU.NL Wed Mar 21 13:40:27 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 21 Mar 2007 13:40:27 +0100 Subject: Sliceinterp-Sourceplot! In-Reply-To: Message-ID: On 21 Mar 2007, at 13:04, Muthuraman Muthuraman wrote: > cfg.downsample=4; > [interp] = sourceinterpolate(cfg, source1, mri) > > and the output of sourceinterpolate > > avg: [1x1 struct] > inside: [64x64x64 logical] > dim: [64 64 64] > transform: [4x4 double] > anatomy: [64x64x64 uint16] > cfg: [1x1 struct] What is in interp.avg? I would expect it to contain interp.avg.pow [64x64x64 double] interp.avg.nai [64x64x64 double] If that is the case, then sourceplot should just work and not complain about different dimensions. Robert From c.hesse at FCDONDERS.RU.NL Wed Mar 21 15:43:52 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 21 Mar 2007 15:43:52 +0100 Subject: TFR:boundaries, resolution In-Reply-To: <20070321104145.g0i8xwoj4sok0s8c@webmail1.tkk.fi> Message-ID: Hi Ulla, > 1. Is there a way to get rid of boundary effects for low > frequencies. The boundary is moving but it is not disappearing. You can't get rid of boundary effects as such. However, you could use a longer window in your time-frequency analysis and then only plot the part of the window without the edge effects. > 2. The output is very grainy i.e. so called pixels are big and > sharp edged even with as high tapsmofrq as is possible with > available memory. Is there a way to make the output prettier ? The "pixels" are partly determined by the size of the time-frequency tiles (whose and their size is determined by the width of your time- window and frequency band at each point in your TFR) and the degree of overlap between the tiles. If you want to make things look "smoother" then you could try increasing the time resolution (spacing between windows) and the temporal smoothing (size of each window), and do the same for the frequency axis. > 3. TopoplotTFR is not functioning. It only draws a blank figure. > MultiplotTFR and singleplotTFR function perfectly. I use .grad > generated layout for 306 channel Neuromag. I have made a small change to the function PREPARE_LAYOUT which should fix the problem in TOPOPLOTTFR. The new version will be available with the daily update this evening at approximately 22:00 CET (and is also attached). The layout stuff has been undergoing some changes recently, and at present there does not really seem to be an appropriate way of passing a "pre-prepared, grad-generated" layout structure to the plotting functions. Currently, provided the gradiometer information is either in cfg.grad or in dat.grad, the plotting functions will automatically generate a layout structure using lay = prepare_layout (cfg, dat) every time they are called. As a sort of compromise, you are (for the time being at least) allowed to put the pre-computed layout structure in cfg.layout, when you call TOPOPLOTTFR and it should work. In the future, I expect that an additional field for pre-computed layout structures might be added at some point. Regards, Christian  ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: prepare_layout.m.zip Type: application/zip Size: 3721 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Wed Mar 21 21:39:32 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 21 Mar 2007 21:39:32 +0100 Subject: importing BESA *.tfc files Message-ID: When using besa2fieldtrip on a *.tfc file I get the following errors in Matlab: ??? Error using ==> colon First and last colon operands must be char. Error in ==> fieldtrip-20070320\private\read_besa_tfc at 77 Time = [TimeStartInMS:TimeIntervalInMS:(NumberTimeSamples-1)*TimeIntervalInMS+TimeStartInMS]; Error in ==> besa2fieldtrip at 140 [ChannelLabels, Time, Frequency, Data, Info] = read_besa_tfc(filename); any suggestions? An example file is attached. Thanks andy -------------- next part -------------- A non-text attachment was scrubbed... Name: Coercion_01_ERA.tfc Type: application/octet-stream Size: 27561 bytes Desc: not available URL: From h.stoegbauer at GMAIL.COM Thu Mar 22 06:09:56 2007 From: h.stoegbauer at GMAIL.COM (Harald Stoegbauer) Date: Wed, 21 Mar 2007 22:09:56 -0700 Subject: timelockstatistics In-Reply-To: <007a01c76b7e$a24b6590$6501a8c0@fcdonders.nl> Message-ID: Dear Eric, Looking forward to get an example code, at the moment I tried to use "Clusterrandanalysis" as guideline. It was hard to guess all the necessary cfg settings, particular ' cfg.correctm' and 'cfg.design' are not listed in the index. In the end it was running but I don't know how to interpret/plot the output (looks quiet different to 'Clusterrandanalysis'). Would be thankful about any short example. A short additional question, it is also possible to make a 'normal' ttest on a particular time window of an ordinary VEP-ERP ? Thanks, Harald On 3/20/07, Eric Maris wrote: > > Dear Harald, > > > > > > Exist there any example code for the 'timelockstatistics' function ? > > Not yet, but we are working on it. To get started, you could make use of > the clusterrandanalysis-tutorial and combine this with the help-information > from timelockstatistics. Clusterrandanalysis is the predecessor of > timelock-, freq-, and sourcestatistics. > > > > Good luck, > > > > Eric > > > > > -- -------------------------------- Harald Stoegbauer, PhD 1200 E. California Blvd CALTECH - Mail code 114-96 Pasadena, CA 91125 Phone: +1-626-395-8959 -------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Mar 22 09:49:57 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Mar 2007 09:49:57 +0100 Subject: timelockstatistics In-Reply-To: <5bbfdea0703212209k1b4c9149wc19daa37767872c5@mail.gmail.com> Message-ID: On 22 Mar 2007, at 6:09, Harald Stoegbauer wrote: > A short additional question, it is also possible to make a 'normal' > ttest on a particular time window of an ordinary VEP-ERP ? TIMELOCKSTATISTICS (idem for freq/source) allows you to do conventional tests as well. Instead of cfg.method = 'montecarlo' % since the p-value is a monte- carlo estimate cfg.correctm = 'cluster' you would specify cfg.method = 'analytic' % since it is an analytic p- value that will be computed cfg.correctm = 'no' % or bonferoni, fdr, holms The cfg.statistic is the same, just as the cfg.design matrix. The choises that you have for multiple-comparison correction are different. See the help of STATISTICS_ANALYTIC for more details. best Robert From ulla.rantakokko at TKK.FI Thu Mar 22 10:10:02 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Thu, 22 Mar 2007 10:10:02 +0100 Subject: TFR:boundaries, resolution Message-ID: Thanks Christian, 1. & 2. Ok. I haven't succeeded well with multitapers because of memory problems. For some reason 'wltconvol' is also impossible for the same reason but this far 'tfr' works well (?) which is a little suprizing . I can get this far singleplot only. 3. I found the new layout files the minute I sent the mail... However, I get >> multiplotTFR(cfg, TFRmult_th_ad); ??? Undefined function or variable "Lbl". Error in ==> fieldtrip-20070226/private/createlayout at 244 if ~any(strcmp('COMNT', Lbl)) Error in ==> multiplotTFR at 234 lay = createlayout(cfg.layout); .................... even though the neuromag data is recognized well. 4. A new idea to reduce the length of trial and thus get better pictures is to separate baseline from the data-trials to one baseline set. How can I relate the baseline with the data as whole information and not just time limits. Am I making myself clear ? Best regs Ulla From c.hesse at FCDONDERS.RU.NL Thu Mar 22 10:40:38 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Thu, 22 Mar 2007 10:40:38 +0100 Subject: TFR:boundaries, resolution In-Reply-To: Message-ID: Hi Ulla, On 22 Mar 2007, at 10:10, Ulla Rantakokko wrote: > Thanks Christian, > > 1. & 2. Ok. I haven't succeeded well with multitapers because of > memory > problems. For some reason 'wltconvol' is also impossible for the > same reason > but this far 'tfr' works well (?) which is a little suprizing . I > can get > this far singleplot only. Using multitapers is not really equally appropriate at all frequencies, and especially not recommended at the "lower" frequencies (say below 20 Hz). I guess it would be fair to say that multitapers are most useful for "pulling out" activity in the high gamma bands (> 60Hz). At frequencies below 40 Hz, I would just use a hanning window and specify the time frequency tiles using cfg = []; cfg.method = 'mtmconvol'; cfg.output = 'pow'; cfg.taper = 'hanning'; cfg.foi = [fbeg:fshift:fend]; cfg.toi = [tbeg:tshift:tend]; cfg.f_timwin = ones(max(size(cfg.foi)),1).*twin; these cfg options essentially give you a "classic" spectrogram which (in my opinion) should be the first step in any time frequency analysis before using more "advanced" techniques such as wavelets or multitapers (both of which, by the way, are much greedier in terms of memory and computation time than the spectrogram). Depending on the goals of your analysis and the frequency range of interest, there may also simply not be sufficient motivation to use either wavelets or multitapers at all. In any event, in the above cfg options, twin is the width of your time window in seconds, and the rest is probably self explanatory. You can also adjust cfg.f_timwin to have different lengths for different frequencies if you wish. With the current settings you should have less problems with running out of memory. > I found the new layout files the minute I sent the mail... However, > I get > >>> multiplotTFR(cfg, TFRmult_th_ad); > ??? Undefined function or variable "Lbl". > > Error in ==> fieldtrip-20070226/private/createlayout at 244 > if ~any(strcmp('COMNT', Lbl)) > > Error in ==> multiplotTFR at 234 > lay = createlayout(cfg.layout); You may want to get the latest version of FT since there have been a lot of changes in the past 2 weeks to the layout stuff. The call to the function CREATELAYOUT (and the date stamp in your fieldtrip directory :-) suggest that you are using an FT version which predates the key changes made on 14.03.2007. It should be fine in the latest version. > 4. A new idea to reduce the length of trial and thus get better > pictures is > to separate baseline from the data-trials to one baseline set. How > can I > relate the baseline with the data as whole information and not just > time > limits. Am I making myself clear ? Not 100%, sorry. Can you say (write) that again? Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulla.rantakokko at TKK.FI Thu Mar 22 11:40:13 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Thu, 22 Mar 2007 11:40:13 +0100 Subject: TFR:boundaries, resolution Message-ID: Hi Christian, I enjoy your being so precise :) I actually downloaded the version 20070320, removed the older one from path but still matlab somehow finds the old version... maybe I must delete the old one from the computer for good. > You may want to get the latest version of FT since there have been a lot of changes in the past 2 weeks to the layout stuff. The call to the function CREATELAYOUT (and the date stamp in your fieldtrip directory :-) suggest that you are using an FT version which predates the key changes made on 14.03.2007. It should be fine in the latest version. > > Not 100%, sorry. Can you say (write) that again? > I was thinking that I save data separately for data trials with different trigger and another data set solemnly for baseline purpose with another trigger. Because my perfect baseline signal lies some 2000 ms before the data trial and because the data trial is long already the 2 secs for gap between trial and baseline is memory consuming and of no use. So I thought I could plot the data w.r.t. baseline activity from separate sets, when the data trial actually starts much later than the baseline. Now I have the impression that the baseline wants to refer to the same time limits as the data in trial. So can I select the baseline time and signal from another set and the data activity from another data set ie something like: select and preprocess data for baseline: cfg_baseline, data_baseline ...and for data: cfg, data (actually because this far the computation does not require too much memory, the trial could also be one long data set. I would like to compute the TFRs separately with only the time of interest differing into two sets: ) TFRmult_baseline = freqanalysis(cfg_baseline, data_baseline); TFRmult = freqanalysis(cfg, data); and then plot the latter w.r.t. the previous But here I get lost how to tell to FT that baseline could be the whole information (trial and time) and not only a time limit in cfg that is extracted from the data for baseline purpose. So is it possible or do I have to start to imagine ways around the problem ? I hope this lengthy description didn't make the idea even cloudier Best regs Ulla From k.kessler at PSY.GLA.AC.UK Thu Mar 22 11:35:21 2007 From: k.kessler at PSY.GLA.AC.UK (Klaus Kessler) Date: Thu, 22 Mar 2007 11:35:21 +0100 Subject: postdoc job available at Glasgow Message-ID: Dear all, if you are looking for a postdoc position and would like to work with MEG, EEG, TMS and eye tracking, then you might be interested in the position below. Cheers Klaus UNIVERSITY of GLASGOW DEPARTMENT OF PSYCHOLOGY CENTRE FOR COGNITIVE NEUROIMAGING (CCNi) RESEARCH ASSISTANT Salary: £23,002 - £25,889 / £25,889 - £31,840 (depending on experience and qualifications) REF 13147/DPO/A3 Applications are invited for a Postdoctoral Research Assistant to work with Dr Marie-Helene Grosbras and Dr Klaus Kessler on projects using magnetoencephalography (MEG) and transcranial magnetic stimulation (TMS). MEG experiments will aim at identifying cortical networks involved in cognitive processing and analyzing the underlying connectivity (coherence, synchronization). Functional hypotheses will then be tested by means of TMS and simultaneous eye tracking (ET). Future work may also include TMS during EEG recordings. Research projects focus on visual attention, vigilance, consciousness and action observation. You will have the opportunity to: contribute to the design of experiments; collect data with state of the art systems; develop, validate and apply cutting edge techniques to analyse brain signals in the time and frequency domain; search for solutions to the inverse problem in order to identify processing networks. Finally, this will also give you the opportunity to apply your skills in writing scientific articles for high impact journals. For at least two years you will be part of a successful team of researchers in Glasgow who work on related topics. The current creation of a Centre for Cognitive Neuroimaging (CCNi) within the Department of Psychology is a strategic priority of Glasgow University. Equipment will include a 3T fMRI scanner, a MEG system, two TMS systems with frameless stereotaxy, and several EEG systems – including fMRI compatible systems, providing a comprehensive platform of complementary, state-of-the-art brain imaging facilities dedicated to Cognitive Neuroscience research. The centre is scheduled to be opened in autumn. This post is initially available from 1 May 2007 for 2 years. You will be qualified, with a PhD, or equivalent, in Psychology, Neuroscience, Bioengineering, Physics or a related discipline. Experience with MEG/EEG, TMS and/or eye tracking is highly desirable. Programming skills (preferably with MATLAB) and experience with signal analysis in the time-frequency domain (including phase coherence/ synchronisation) is also highly desirable. Salary scale will depend on qualifications and experience. Finally you should have a strong interest in developing your own scientific programme and pursuing a research career. Informal enquiries may be made to Marie-Helene Grosbras (+44 (0)141 330 5264; m.grosbras at psy.gla.ac.uk) or Klaus Kessler (+44 (0)141 330 4774; k.kessler at psy.gla.ac.uk). For further details about the post and how to apply: see our web site at http://www.psy.gla.ac.uk/jobs.php or contact Clare Alexander, Department of Psychology, University of Glasgow, G12 8QQ (+44 (0) 141 330 5090, c.alexander at psy.gla.ac.uk Closing date: 16 April 2007. From sameer at ANDREW.CMU.EDU Thu Mar 22 17:09:08 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 22 Mar 2007 12:09:08 -0400 Subject: prepare_single_shell errors Message-ID: Hi, I am trying to use prepare_singleshell to try and get a single shell model using brain surface from segmented mri. I try to generate this segmented mri using (is this correct) >> [mri]= read_fcdc_mri('/mnt/condor2/sameer/Software/freesurfer/subjects/WS/mri/T1-neuromag/sets/COR.fif') mri = dim: [256 256 256] anatomy: [256x256x256 uint8] hdr: [1x1 struct] transform: [4x4 double] The file COR.fif is acquired by implementing mne_setup_mri of MNE-suite, and it in turn acts upon freeserfer treatment of dicom files of mri data. Then, >> cfg = []; cfg.gradfile = 'ws_011207_1_checkers.fif'; >> ft_singleshell = prepare_singleshell(cfg,mri); smoothing the segmentation with a 5-pixel FWHM kernel Warning: Divide by zero. > In mean at 29 In prepare_singleshell at 100 Warning: Divide by zero. > In mean at 29 In prepare_singleshell at 101 Warning: Divide by zero. > In mean at 29 In prepare_singleshell at 102 ??? Subscript indices must either be real positive integers or logicals. Error in ==> fieldtrip/private/triangulate_seg at 55 int = seg(sel); Error in ==> prepare_singleshell at 103 pnt = triangulate_seg(seg, cfg.spheremesh, ori); >> ft_segment = prepare_localspheres(cfg,mri); gives me similar errors. Any ideas how to troubleshoot these problems? If it will help, (fiff_read_mri is a MNE-suite utility) >> [stack] = fiff_read_mri(' Software/freesurfer/subjects/WS/mri/T1-neuromag/sets/COR.fif') Creating tag directory for /mnt/condor2/sameer/Software/freesurfer/subjects/WS/mri/T1-neuromag/sets/COR.fif...[done] Reading slices..50..100..150..200..250..256..[done] stack = id: [1x1 struct] trans: [1x1 struct] nslice: 256 slices: [1x256 struct] thanks for your time. best, sameer From r.oostenveld at FCDONDERS.RU.NL Thu Mar 22 17:47:00 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Mar 2007 17:47:00 +0100 Subject: prepare_single_shell errors In-Reply-To: Message-ID: Hi Sameer, The second input of prepare_singleshell should be a segmented MRI (i.e the output of VOLUMESEGMENT) and not an original gray-value MRI. On 22 Mar 2007, at 17:09, Sameer Walawalkar wrote: > I am trying to use prepare_singleshell to try and get a single > shell model using brain surface from segmented mri. > > I try to generate this segmented mri using (is this correct) > >>> [mri]= > read_fcdc_mri('/mnt/condor2/sameer/Software/freesurfer/subjects/WS/ > mri/T1-neuromag/sets/COR.fif') > > mri = > > dim: [256 256 256] > anatomy: [256x256x256 uint8] > hdr: [1x1 struct] > transform: [4x4 double] The anatomy here contains (that is what I suspect) all values between 0 and 255 that, when plotted, represent the anatomical MRI. > The file COR.fif is acquired by implementing mne_setup_mri of MNE- > suite, and it in turn acts upon freeserfer treatment of dicom files > of mri data. The output of volumesegment would contain mri.gray 256^3 mri.white 256^3 mri.csf 256^3 subsequently what prepare_singleshell does (see the first part in the code) is seg = zeros(mri.dim); if isfield(mri, 'gray') fprintf('including gray matter in segmentation for brain compartment\n') seg = seg | (mri.gray>(cfg.threshold*max(mri.gray(:)))); end if isfield(mri, 'white') fprintf('including white matter in segmentation for brain compartment\n') seg = seg | (mri.white>(cfg.threshold*max(mri.white(:)))); end if isfield(mri, 'csf') fprintf('including CSF in segmentation for brain compartment\n') seg = seg | (mri.csf>(cfg.threshold*max(mri.csf(:)))); end i.e. it fuses gray+white+csf into a single black-white 3-D volume that represents the skull content. Around that part of the 3-D volume the triangulation is constructed. Note that the mri.transform has to be correct and match with the headcoordinates of the gradiometers (you can use VOLUMEREALIGN if the coordinates are not properly aligned yet). Robert From levy at NMR.MGH.HARVARD.EDU Thu Mar 22 17:44:25 2007 From: levy at NMR.MGH.HARVARD.EDU (Robert Levy) Date: Thu, 22 Mar 2007 12:44:25 -0400 Subject: Field Trip and MNE Localization In-Reply-To: Message-ID: Hello, I just discovered Fieldtrip, and it seems like a very powerful tool for spectral analysis of MEG data. Our lab uses Matti Hamalainen's Neuromag MNE tools to localize ERMF generator sources. A spectral analysis feature is in development for these tools, but at present it can be done using Matlab either from scratch or potentially it seems with the help Fieldtrip. So as not to attempt reinventing the wheel I was wondering if anyone here has used Fieldtrip in conjunction with the Neuromag tools to both localize MEG data and analyze it spectrally. If anyone has done this already I would appreciate any suggestions, pointers or references to papers. Thanks, Rob From christoph.braun at UNI-TUEBINGEN.DE Thu Mar 22 18:21:43 2007 From: christoph.braun at UNI-TUEBINGEN.DE (Dr. Christoph Braun) Date: Thu, 22 Mar 2007 18:21:43 +0100 Subject: Postdoc position at the MEG-Center in T=?ISO-8859-15?Q?=FCbingen?= , Germany Message-ID: *Postdoctoral position in a "Bernstein Cooperation Project" related to voluntary control of brain activity* *for three years * The MEG-Center of the University of Tübingen offers a postdoc position in neuroscience. The candidate should have received a PhD in neuroscience, physics, mathematics, bio-informatics, medicine, psychology, or other disciplines related to studies in human neuroscience. The project investigates decoding of movement-related brain signals in close collaboration with the "Bernstein Center for Computational Neuroscience" of Freiburg. The project aims to improve neuronal decoding by voluntary modulation of brain signals using MEG and EEG recordings. Experience in psycho- and physiological experimentation and in the analysis of neurophysiological data is requested. Since the project requires intensive exchange with our cooperation partner, the candidate should be skilled in project organization and team-work. Salary is according to the German TV-L E13 (previously BAT IIa) which is about 43.000 € gross pay per year. The appointment is for a term of three years. Applicants should send an email including a statement of their research background and interests. Furthermore, a curriculum vitae, publication record and a list of scientific talks is requested. Finally three references should be provided. In case of questions and for your application please contact Dr. Christoph Braun, MEG-Center, Otfried-Müller-Str. 47, 72076 Tübingen, Germany. Email: christoph.braun at uni-tuebingen.de . Applications should be handed in before 15^th April 2007. -- Christoph Braun MEG-Zentrum Universität Tübingen Otfried-Müller-Str. 47 Telefon: +49(0)7071-2987705 Fax: +49(0)7071-295706 email: christoph.braun at uni-tuebingen.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From muthuraman10 at HOTMAIL.COM Thu Mar 22 18:38:17 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Thu, 22 Mar 2007 17:38:17 +0000 Subject: coherence in TFR! Message-ID: Hello Fieldtrippers, Is there way to plot the coherence in the TFR representation after using the 'mtmconvol' method with the output configuration 'powandcsd'. Thanking you With regards M.Muthuraman. _________________________________________________________________ Catch all the cricketing action right here. Live score, match reports, photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 22 19:44:05 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 22 Mar 2007 19:44:05 +0100 Subject: coherence in TFR!!! In-Reply-To: Message-ID: Yes, it is possible to plot coherence. Compute the coherence-spectrum using freqdescriptives, and plot it with topoplotTFR, setting cfg.zparam = 'cohspctrm', and specifying a cfg.cohrefchannel. It's documented in the help of topoplotTFR, which you can read, when you open the corresponding m-file, or type 'help topoplotTFR' on the commandline. JM -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Thursday, March 22, 2007 6:38 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] coherence in TFR! Hello Fieldtrippers, Is there way to plot the coherence in the TFR representation after using the 'mtmconvol' method with the output configuration 'powandcsd'. Thanking you With regards M.Muthuraman. _________________________________________________________________ Catch all the cricketing action right here. Live score, match reports, photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx From conrado.bosman at GMAIL.COM Fri Mar 23 13:47:04 2007 From: conrado.bosman at GMAIL.COM (Conrado Bosman) Date: Fri, 23 Mar 2007 13:47:04 +0100 Subject: Problem to configurate electrode positions for freqstatistic analysis Message-ID: Dear Fieldtrippers, I am currently analyzing some old EEG data., butI have some problems to define the electrode configuration to run clusterrandanalysis or freqstatistics. All data were register in a Neuroscan equipment with a strange configuration of 80 channels that is not easy to find in the internet or in the Neuroscan website. However, using the script prepare_layout, I could get a .lay file with the positions, that is very useful to make topographies, but I am not able to use this file to define electrode position for statistical analysis. My question is: Is there any way to obtain a cfg.elec configuration starting from the .lay file so i could use with freqstatistics? Thanks in advance, -- Conrado From maris at NICI.RU.NL Fri Mar 23 13:59:05 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Fri, 23 Mar 2007 13:59:05 +0100 Subject: Problem to configurate electrode positions for freqstatistic analysis In-Reply-To: Message-ID: Hi Conrado, > I am currently analyzing some old EEG data., butI have some problems > to define the electrode configuration to run clusterrandanalysis or > freqstatistics. All data were register in a Neuroscan equipment with a > strange configuration of 80 channels that is not easy to find in the > internet or in the Neuroscan website. However, using the script > prepare_layout, I could get a .lay file with the positions, that is > very useful to make topographies, but I am not able to use this file > to define electrode position for statistical analysis. My question is: > > Is there any way to obtain a cfg.elec configuration starting from the > .lay file so i could use with freqstatistics? I think not, because the .lay file contains coordinates in a plane, whereas the cfg.elec structure must contain coordinates in 3 dimensions. You can construct the neighborhood-structure manually. This is described in the help documentation of clusterrandanalysis (and in one of the subfunctions that is called by freqstatistics). This is a boring job and takes a couple of hours, but it may well be the most time-efficient approach. Good luck, Eric Maris From ulla.rantakokko at TKK.FI Fri Mar 23 15:04:46 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Fri, 23 Mar 2007 15:04:46 +0100 Subject: Layout lay Message-ID: Hello, Concerning the layout created with lay=prepare_layout(cfg, data), where data is from preprocessing and FT version is 20070320 (for sure, previous deleted), I still get: multiplotTFR(cfg, TFRspect); creating layout from data.grad creating layout for neuromag306 system ??? Reference to non-existent field 'lbl'. Error in ==> multiplotTFR at 275 k = cellstrmatch('COMNT',lay.lbl); >> ...from before..: suggest that you are using an FT version which predates the key changes made on 14.03.2007. It should be fine in the latest version. >>>>>>>>>> Regards Ulla From c.hesse at FCDONDERS.RU.NL Fri Mar 23 15:16:02 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Fri, 23 Mar 2007 15:16:02 +0100 Subject: Layout lay In-Reply-To: Message-ID: Hi Ulla, the changes in PREPARE_LAYOUT (which is the "key" function here) were made on 21.03.2007 (see recent changes at http://www2.ru.nl/fcdonders/ fieldtrip/doku.php?id=fieldtrip) the day after your newest FT version. If it does not work with the absolute newest version either, then please let me know. Regards, Christian On 23 Mar 2007, at 15:04, Ulla Rantakokko wrote: > Hello, > > Concerning the layout created with > lay=prepare_layout(cfg, data), > where data is from preprocessing and FT version is 20070320 (for sure, > previous deleted), > > I still get: > > multiplotTFR(cfg, TFRspect); > creating layout from data.grad > creating layout for neuromag306 system > ??? Reference to non-existent field 'lbl'. > > Error in ==> multiplotTFR at 275 > k = cellstrmatch('COMNT',lay.lbl); > > >>> ...from before..: > suggest that you are using an FT version which predates > the key changes made on 14.03.2007. It should be fine in the latest > version. >>>>>>>>>>> > > Regards > > Ulla > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From muthuraman10 at HOTMAIL.COM Fri Mar 23 16:43:44 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Fri, 23 Mar 2007 15:43:44 +0000 Subject: coherence in TFR!!! In-Reply-To: <000301c76cb2$113e42e0$902dae83@fcdonders.nl> Message-ID: Hello Filedtripers, Thanks for the reply, and when i use the fdTFRmult = freqdescriptives([], TFRmult); to calculate the coherence after the time frequency analysis i get all the values of coherence to be 1.0. Is there any other configuration steps need to be followed in fieldtrip before calculating the coherence from the 'mtmconvol' method. Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It�s cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in From Brian.Roach at YALE.EDU Fri Mar 23 16:47:22 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Fri, 23 Mar 2007 11:47:22 -0400 Subject: coherence in TFR!!! In-Reply-To: Message-ID: You're not running on the average, are you? That would give coherence of 1. At 11:43 AM 3/23/2007, you wrote: >Hello Filedtripers, > >Thanks for the reply, and when i use the >fdTFRmult = freqdescriptives([], TFRmult); to calculate the >coherence after the time frequency analysis i get all the values of >coherence to be 1.0. > >Is there any other configuration steps need to be followed in fieldtrip >before calculating the coherence >from the 'mtmconvol' method. > > >Thanking you > >With regards >M.Muthuraman. > >_________________________________________________________________ >Tried the new MSN Messenger? It's cool! Download now. >http://messenger.msn.com/Download/Default.aspx?mkt=en-in > From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 23 16:54:33 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 23 Mar 2007 16:54:33 +0100 Subject: coherence in TFR!!!!! In-Reply-To: Message-ID: Hi Muthumaran, I agree with Brian. In fact, there are two other ways to achieve a coherence of 1: 1) the two signals you are computing the coherence for, are identical 2) you data-structure only specifies one trial (which you achieve when running the analysis on the average) I guess that the second way applies to your data. In this context, it does not make sense to compute coherence, because by definition it will be 1. In either case, there is nothing fieldtrip can do for you. Your data should be defined such, that it makes sense to compute coherence. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Friday, March 23, 2007 4:44 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] coherence in TFR!!! Hello Filedtripers, Thanks for the reply, and when i use the fdTFRmult = freqdescriptives([], TFRmult); to calculate the coherence after the time frequency analysis i get all the values of coherence to be 1.0. Is there any other configuration steps need to be followed in fieldtrip before calculating the coherence from the 'mtmconvol' method. Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It's cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in From sameer at ANDREW.CMU.EDU Fri Mar 23 17:18:54 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Fri, 23 Mar 2007 12:18:54 -0400 Subject: volumesegment has spm2 related memory issues Message-ID: Hi, When I run >> [segment] = volumesegment(cfg,mri) I get memory problems at a particular line in a spm2 matlab file. The error message is : performing the segmentation on the specified volume ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> spm_smoothto8bit>smoothto8bit at 41 buff = zeros([V.dim(1:2) r{3}.s*2+1]); On printing out these numbers, I find that spm2 is attempting to create a file Of size (256 x 256 x 23783). Has anyone else has had these kind of problems with spm2? Or is there (this is more likely) my problem with implementation. The information about mri is: >> mri mri = dim: [256 256 256] anatomy: [256x256x256 uint8] hdr: [1x1 struct] transform: [4x4 double] Thanks a lot. best, sameer From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 23 20:57:39 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 23 Mar 2007 20:57:39 +0100 Subject: volumesegment has spm2 related memory issues In-Reply-To: Message-ID: Dear Sameer, To give a short answer to your question: I never noticed a problem like this. I indeed think, that there is something not completely correct with the input. Let have a look at the code together to get a clue what might go wrong. You were on the good track working out the numbers, but let's pursue it a bit further: >Error in ==> spm_smoothto8bit>smoothto8bit at 41 >buff = zeros([V.dim(1:2) r{3}.s*2+1]); > >On printing out these numbers, I find that spm2 is attempting to create a >file >Of size (256 x 256 x 23783). The number 23783 likely causes the problem, because it's rather big. Apparently, r{3}.s*2+1 = 23783. So what is r{3}.s? Clearly this amounts to 11891. When we have a look into the for-loop, preceding the line which causes the crash, we see that r{3}.s = ceil(3.5*sqrt(s(i))). So, the variable s(i) (as an element of the 1x3-vector) is about 1.15e7. A few lines up, it says that s = (fwhm./vx./sqrt(8*log(2)) + eps).^2 Let's forget about eps (which is the numerical round-off error), some juggling with the numbers leads to fwhm./vx being [8000 8000 8000]. Typically fwhm = [8 8 8] (in mm), so vx in your case was something like 0.001. And this vx is derived from a variable V.mat, which is the affine-matrix which came along with the volume the function tries to smooth. This affine-matrix is needed to interpret the voxels in terms of a physical coordinate system. Importantly, since the smoothing kernel is defined in mm, the mapping which this matrix brings about, should also be defined in mm. Because there's a factor 1000 difference here, I suspect that your matrix has metres as a unit, instead of mm. The V.mat variable is taken from the input-mri, and is equal to mri.transform. Apparently, implicitly it assumes it to be defined in mm. So for now, I'd suggest to massage this mri.transform a bit such that starts to behave nicely. I guess it should be something like mri.transform(1:3,:) = 1000.*mri.transform(1:3,:); Then you should have a look at mri.transform(1:3,1:3). If you have a 1mm resolution mri, then sqrt(sum(mri.transform(1:3,1:3).^2)) should be one-ish. Good luck, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Friday, March 23, 2007 5:19 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] volumesegment has spm2 related memory issues Hi, When I run >> [segment] = volumesegment(cfg,mri) I get memory problems at a particular line in a spm2 matlab file. The error message is : performing the segmentation on the specified volume ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> spm_smoothto8bit>smoothto8bit at 41 buff = zeros([V.dim(1:2) r{3}.s*2+1]); On printing out these numbers, I find that spm2 is attempting to create a file Of size (256 x 256 x 23783). Has anyone else has had these kind of problems with spm2? Or is there (this is more likely) my problem with implementation. The information about mri is: >> mri mri = dim: [256 256 256] anatomy: [256x256x256 uint8] hdr: [1x1 struct] transform: [4x4 double] Thanks a lot. best, sameer From ulla.rantakokko at TKK.FI Tue Mar 27 12:03:46 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Tue, 27 Mar 2007 12:03:46 +0200 Subject: Layout lay Message-ID: Hi Christian I reloaded the version: File: fieldtrip-20070320.zip 1665 KB 03/20/2007 08:06:00 PM which is the most resent version accessible at the moment. However, >> multiplotTFR(cfg, TFRwave); reverting to 151 channel CTF default when using lay as cfg.layout. Regards, Ulla Hi Ulla, the changes in PREPARE_LAYOUT (which is the "key" function here) were made on 21.03.2007 (see recent changes at http://www2.ru.nl/fcdonders/ fieldtrip/doku.php?id=fieldtrip) the day after your newest FT version. If it does not work with the absolute newest version either, then please let me know. Regards, Christian From c.hesse at FCDONDERS.RU.NL Wed Mar 28 11:58:06 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 28 Mar 2007 11:58:06 +0200 Subject: Layout lay In-Reply-To: Message-ID: Hi Ulla, there was a temporary (accidental) suspension of FT daily updates since 20.03.2007, which has just been spotted and stopped. The latest version of FT is available on the FTP-server NOW, so please download and let me know if the layout bugs persist. Regards, Christian On 23 Mar 2007, at 15:04, Ulla Rantakokko wrote: > Hello, > > Concerning the layout created with > lay=prepare_layout(cfg, data), > where data is from preprocessing and FT version is 20070320 (for sure, > previous deleted), > > I still get: > > multiplotTFR(cfg, TFRspect); > creating layout from data.grad > creating layout for neuromag306 system > ??? Reference to non-existent field 'lbl'. > > Error in ==> multiplotTFR at 275 > k = cellstrmatch('COMNT',lay.lbl); > > >>> ...from before..: > suggest that you are using an FT version which predates > the key changes made on 14.03.2007. It should be fine in the latest > version. >>>>>>>>>>> > > Regards > > Ulla > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brian.Roach at YALE.EDU Thu Mar 29 01:07:37 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Wed, 28 Mar 2007 19:07:37 -0400 Subject: source analysis attempt using DICS method Message-ID: Attached is the output from a call to sourceinterp on source analysis output data. I am trying to use the DICS method, but my output looks nothing like the tutorial pictures. I am including what I believe to be the relevant code, and advice on the source of my mistake(s) would be appreciated: [EEG com] = pop_loadbv('/home/bjr39/FTsource', 'B22001hal.vhdr') EEG1 = pop_select(EEG) help eeglab2fieldtrip data = eeglab2fieldtrip(EEG1, 'preprocessing') %%% there is some code which I have not included that string matches my electrodes and uses coordinate that put the sites in MNI space according to the coordinates listed here:http://oase.uci.ru.nl/~roberto/electrode/realistic_1005.txt %%% cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [5 100]; cfg.tapsmofrq = 2; cfg.foilim = [35 45]; freq = freqanalysis(cfg, data) cfg = []; cfg.method = 'dics'; cfg.frequency = 40; cfg.hdmfile = '/home/bjr39/FTsource/vol.mat'; cfg.resolution = 2 pack;source = sourceanalysis(cfg, freq) sourcePost = sourcedescriptives([], source) cfg =[]; cfg.downsample = 2; cfg.funparameter = 'nai'; cfg.colmin = 'auto'; cfg.colmax = 'auto'; sourcePostF = source2full(sourcePost); sliceinterp(cfg,sourceInterp); I can share more info if it will help, related to the size of different data structures, or whatever anyone would need to know. I followed the guide for head model creation and plotted it at various points (one plot previously posted to the list). Could a poor head model create this problem? thanks, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TestSourceAnalysis.png Type: application/octet-stream Size: 278081 bytes Desc: not available URL: From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 29 08:29:06 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 29 Mar 2007 08:29:06 +0200 Subject: source analysis attempt using DICS method In-Reply-To: <6.1.2.0.2.20070328185248.01c377a0@email.med.yale.edu> Message-ID: Dear Brian, Allow me to point you to a quite related problem which has been posted by Nathan about a month ago. I think it was the beginning of March. You can browse through the discussion list's history when you go to the fieldtrip-website and click around a bit at the appropriate links. Even though the question here was related to LCMV-beamformer, the problems might have the same cause. Following Nathan's thread, a very likely cause is the incorrect specification of cfg.mriunits, and cfg.sourceunits prior to calling sourceinterpolate (I did not find back in the code you sent in your mail that you actually called it, but I assume you did). If not specified, fieldtrip puts cfg.mriunits to 'mm', and cfg.sourceunits to 'cm'. There might be a discrepancy in your data there. Perhaps you even explicitly have to check, whether your headmodel (in hdmfile) is defined in cm. At least the dipole-grid on which sourceanalysis performs the beamformer-scanning is defined in cm, and I guess the units should be identical here as well. Good luck, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Brian Roach Sent: Thursday, March 29, 2007 1:08 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] source analysis attempt using DICS method Attached is the output from a call to sourceinterp on source analysis output data. I am trying to use the DICS method, but my output looks nothing like the tutorial pictures. I am including what I believe to be the relevant code, and advice on the source of my mistake(s) would be appreciated: [EEG com] = pop_loadbv('/home/bjr39/FTsource', 'B22001hal.vhdr') EEG1 = pop_select(EEG) help eeglab2fieldtrip data = eeglab2fieldtrip(EEG1, 'preprocessing') %%% there is some code which I have not included that string matches my electrodes and uses coordinate that put the sites in MNI space according to the coordinates listed here:http://oase.uci.ru.nl/~roberto/electrode/realistic_1005.txt %%% cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [5 100]; cfg.tapsmofrq = 2; cfg.foilim = [35 45]; freq = freqanalysis(cfg, data) cfg = []; cfg.method = 'dics'; cfg.frequency = 40; cfg.hdmfile = '/home/bjr39/FTsource/vol.mat'; cfg.resolution = 2 pack;source = sourceanalysis(cfg, freq) sourcePost = sourcedescriptives([], source) cfg =[]; cfg.downsample = 2; cfg.funparameter = 'nai'; cfg.colmin = 'auto'; cfg.colmax = 'auto'; sourcePostF = source2full(sourcePost); sliceinterp(cfg,sourceInterp); I can share more info if it will help, related to the size of different data structures, or whatever anyone would need to know. I followed the guide for head model creation and plotted it at various points (one plot previously posted to the list). Could a poor head model create this problem? thanks, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Thu Mar 29 13:59:42 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Thu, 29 Mar 2007 04:59:42 -0700 Subject: problem on wavelet analysis In-Reply-To: <005c01c771cb$8d631850$902dae83@fcdonders.nl> Message-ID: Dear experts, Could you give me ome suggestion for wavelet analysis? These parameters are OK in EEG data I count using ohter software. I don't think it's different for MEG data but the error happened... >> cfg=[]; >> cfg.sgn='MEG'; >> cfg.method='wltconvol'; >> cfg.width=3; >> cfg.foi=4:1:30; >> cfg.toi=-0.4:0.05:1.4; >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis_wltconvol.m On line 234 ==> if csdflg, crsspctrm = complex(zeros(numsgncmb,numfoi,numtoi)); end Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); Any suggestions are appreciated. Best, Eve --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Mar 29 15:24:57 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Mar 2007 15:24:57 +0200 Subject: source analysis attempt using DICS method In-Reply-To: <005c01c771cb$8d631850$902dae83@fcdonders.nl> Message-ID: On 29 Mar 2007, at 8:29, Jan Mathijs Schoffelen wrote: > a very likely cause is the incorrect specification of cfg.mriunits, > and cfg.sourceunits prior to calling sourceinterpolate (I did not > find back in the code you sent in your mail that you actually > called it, but I assume you did). If not specified, fieldtrip puts > cfg.mriunits to ‘mm’, and cfg.sourceunits to ‘cm’. There might be a > discrepancy in your data there. Perhaps you even explicitly have to > check, whether your headmodel (in hdmfile) is defined in cm. At > least the dipole-grid on which sourceanalysis performs the > beamformer-scanning is defined in cm, and I guess the units should > be identical here as well. The standard BEM EEG volume conduction model that you might have copied from EEGLAB is one that is based on the MNI template brain. It is in MNI coordinates (linked to the AC and PC) and the units are in mm (corresponding with SPM standards). Robert From sameer at ANDREW.CMU.EDU Thu Mar 29 16:20:56 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 29 Mar 2007 10:20:56 -0400 Subject: NANs in Time frequency analysis. Message-ID: Hi, I am using the following settng to run time frequency analysis. cfgTFR = []; cfgTFR.output = 'pow'; cfgTFR.channel = 'MEG'; cfgTFR.method = 'mtmconvol'; cfgTFR.foi = 05 : 2 : 35; cfgTFR.t_ftimwin = 5./cfgTFR.foi; cfgTFR.tapsmofrq = 0.4 *cfgTFR.foi; cfgTFR.toi = 1:0.05:2.5; cfgTFR.pad = 'maxperlen'; TFRmult = freqanalysis(cfgTFR, data); and find that the TFRplots for all channels (plottd using multiplot) are always deep blue in the high time end, especially at low frequencies. Inspection of TFR mult shows many NANs in the corresponding time regions. Does anyone has any ideas about this? thanks for your reply. best, sameer From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 29 16:34:31 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 29 Mar 2007 16:34:31 +0200 Subject: NANs in Time frequency analysis. In-Reply-To: Message-ID: Dear Sameer, A nan is given back at those time-frequency points at which no value can be estimated. This means that at the toi-foi pairs you specified in your configuration, the corresponding timewindow as specified in t_ftimwin cannot be completely filled with data. In your case, I therefore expect this 'problem' to be worse for the lower frequencies. It might seem a sorry answer, but this is just a thing you have to live with. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Thursday, March 29, 2007 4:21 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] NANs in Time frequency analysis. Hi, I am using the following settng to run time frequency analysis. cfgTFR = []; cfgTFR.output = 'pow'; cfgTFR.channel = 'MEG'; cfgTFR.method = 'mtmconvol'; cfgTFR.foi = 05 : 2 : 35; cfgTFR.t_ftimwin = 5./cfgTFR.foi; cfgTFR.tapsmofrq = 0.4 *cfgTFR.foi; cfgTFR.toi = 1:0.05:2.5; cfgTFR.pad = 'maxperlen'; TFRmult = freqanalysis(cfgTFR, data); and find that the TFRplots for all channels (plottd using multiplot) are always deep blue in the high time end, especially at low frequencies. Inspection of TFR mult shows many NANs in the corresponding time regions. Does anyone has any ideas about this? thanks for your reply. best, sameer From sameer at ANDREW.CMU.EDU Thu Mar 29 16:39:22 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 29 Mar 2007 10:39:22 -0400 Subject: NANs in Time frequency analysis. In-Reply-To: <007f01c7720f$5d4d4750$902dae83@fcdonders.nl> Message-ID: Thanks Jan-Mathijs, That was my expectation given how TFRs are calculated. sameer On Thu, 29 Mar 2007, Jan Mathijs Schoffelen wrote: > Dear Sameer, > > A nan is given back at those time-frequency points at which no value can be > estimated. This means that at the toi-foi pairs you specified in your > configuration, the corresponding timewindow as specified in t_ftimwin cannot > be completely filled with data. In your case, I therefore expect this > 'problem' to be worse for the lower frequencies. It might seem a sorry > answer, but this is just a thing you have to live with. > > Yours, > > Jan-Mathijs > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Sameer Walawalkar > Sent: Thursday, March 29, 2007 4:21 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] NANs in Time frequency analysis. > > Hi, > > I am using the following settng to run time frequency analysis. > > cfgTFR = []; > cfgTFR.output = 'pow'; > cfgTFR.channel = 'MEG'; > cfgTFR.method = 'mtmconvol'; > cfgTFR.foi = 05 : 2 : 35; > cfgTFR.t_ftimwin = 5./cfgTFR.foi; > cfgTFR.tapsmofrq = 0.4 *cfgTFR.foi; > cfgTFR.toi = 1:0.05:2.5; > cfgTFR.pad = 'maxperlen'; > > TFRmult = freqanalysis(cfgTFR, data); > > and find that the TFRplots for all channels (plottd using multiplot) are > always deep blue in the high time end, especially at low frequencies. > > Inspection of TFR mult shows many NANs in the corresponding time regions. > > Does anyone has any ideas about this? > > thanks for your reply. > > best, > sameer > > From alotof_xd at YAHOO.COM Fri Mar 30 05:48:06 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Thu, 29 Mar 2007 20:48:06 -0700 Subject: problem on wavelet analysis, combine channel Message-ID: Dear experts, I checked the script of freqanalysis_wltconvol and founf the default for output was 'powandcsd'. This output needs combine channels. My meuromag data seems has problem on something related "combine channels". It works when I change output as 'pow'. However, I wonder what might happen when using combining channels? I suppose it relates layout? Thanks for suggestion. Best, Eve alotof eve wrote: Date: Thu, 29 Mar 2007 04:59:42 -0700 From: alotof eve Subject: [FIELDTRIP] problem on wavelet analysis To: FIELDTRIP at NIC.SURFNET.NL Dear experts, Could you give me ome suggestion for wavelet analysis? These parameters are OK in EEG data I count using ohter software. I don't think it's different for MEG data but the error happened... >> cfg=[]; >> cfg.sgn='MEG'; >> cfg.method='wltconvol'; >> cfg.width=3; >> cfg.foi=4:1:30; >> cfg.toi=-0.4:0.05:1.4; >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis_wltconvol.m On line 234 ==> if csdflg, crsspctrm = complex(zeros(numsgncmb,numfoi,numtoi)); end Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); Any suggestions are appreciated. Best, Eve --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. --------------------------------- 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Fri Mar 30 09:21:18 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Fri, 30 Mar 2007 00:21:18 -0700 Subject: sensortype Message-ID: Sorry for sending so many emails. The error for combine channel is due to sensortype.m cannot get my neuromag data type. I checked the length(grad.label). It's 612, double of 306 which is supposed. How can I settle it? Thanks in advance. Best, Eve alotof eve wrote: Date: Thu, 29 Mar 2007 20:48:06 -0700 From: alotof eve Subject: [FIELDTRIP] problem on wavelet analysis, combine channel To: FIELDTRIP at NIC.SURFNET.NL Dear experts, I checked the script of freqanalysis_wltconvol and founf the default for output was 'powandcsd'. This output needs combine channels. My meuromag data seems has problem on something related "combine channels". It works when I change output as 'pow'. However, I wonder what might happen when using combining channels? I suppose it relates layout? Thanks for suggestion. Best, Eve alotof eve wrote: Date: Thu, 29 Mar 2007 04:59:42 -0700 From: alotof eve Subject: [FIELDTRIP] problem on wavelet analysis To: FIELDTRIP at NIC.SURFNET.NL Dear experts, Could you give me ome suggestion for wavelet analysis? These parameters are OK in EEG data I count using ohter software. I don't think it's different for MEG data but the error happened... >> cfg=[]; >> cfg.sgn='MEG'; >> cfg.method='wltconvol'; >> cfg.width=3; >> cfg.foi=4:1:30; >> cfg.toi=-0.4:0.05:1.4; >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis_wltconvol.m On line 234 ==> if csdflg, crsspctrm = complex(zeros(numsgncmb,numfoi,numtoi)); end Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); Any suggestions are appreciated. Best, Eve --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. --------------------------------- 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut. --------------------------------- Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From weisz at LYON.INSERM.FR Fri Mar 30 09:31:17 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Fri, 30 Mar 2007 09:31:17 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <50358.94104.qm@web56614.mail.re3.yahoo.com> Message-ID: hi eve, i'm not too familiar with the fieldtrip specifications, but: > Out of memory. Type HELP MEMORY for your options. do you have enough RAM? this would then not be a real fieldtrip problem, but a rather common problem generally when using matlab. good luck! nathan From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 30 09:38:15 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 30 Mar 2007 09:38:15 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <8B34AB95-3A47-4E90-9F37-33DFB292296B@lyon.inserm.fr> Message-ID: Dear Eve, I totally agree with Nathan. Specifying (unintended, but still... ;o) ) 'powandcsd', in particular in combination with a spectro-temporal reconstruction really blows up your memory requirements. Especially when (again probably unintended) you are computing csd's for all channelcombination. I'll leave it up to you to calculate how many bytes are needed only to represent your output csd-matrix in memory. Some hints: -each double precision number requires 8 bytes of memory in matlab -each complex number consists of two double precision numbers -(numberoftrials)x(numberofchannelcombinations)x(numberoffrequencypoints)x (numberoftimepoints) can become really big. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Friday, March 30, 2007 9:31 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem on wavelet analysis, combine channel hi eve, i'm not too familiar with the fieldtrip specifications, but: > Out of memory. Type HELP MEMORY for your options. do you have enough RAM? this would then not be a real fieldtrip problem, but a rather common problem generally when using matlab. good luck! nathan From alotof_xd at YAHOO.COM Fri Mar 30 15:49:35 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Fri, 30 Mar 2007 06:49:35 -0700 Subject: problem on wavelet analysis, combine channel In-Reply-To: <001201c7729e$60b2ac70$902dae83@fcdonders.nl> Message-ID: Dear Jan and Nathan, Thank you so much. But I am 80 percent sure it's not a common memory problem. My computer is 1GB of RAM. And if I don't use combination, I can select very fine parameters for wavelet analysis. My data is neuromag .fif data. I suppose something wrong with the channel counting. Thanks. Best, eve Jan Mathijs Schoffelen wrote: Dear Eve, I totally agree with Nathan. Specifying (unintended, but still... ;o) ) 'powandcsd', in particular in combination with a spectro-temporal reconstruction really blows up your memory requirements. Especially when (again probably unintended) you are computing csd's for all channelcombination. I'll leave it up to you to calculate how many bytes are needed only to represent your output csd-matrix in memory. Some hints: -each double precision number requires 8 bytes of memory in matlab -each complex number consists of two double precision numbers -(numberoftrials)x(numberofchannelcombinations)x(numberoffrequencypoints)x (numberoftimepoints) can become really big. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Friday, March 30, 2007 9:31 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem on wavelet analysis, combine channel hi eve, i'm not too familiar with the fieldtrip specifications, but: > Out of memory. Type HELP MEMORY for your options. do you have enough RAM? this would then not be a real fieldtrip problem, but a rather common problem generally when using matlab. good luck! nathan --------------------------------- Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. -------------- next part -------------- An HTML attachment was scrubbed... URL: From weisz at LYON.INSERM.FR Fri Mar 30 16:23:47 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Fri, 30 Mar 2007 16:23:47 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <419502.11257.qm@web56614.mail.re3.yahoo.com> Message-ID: hi eve, > Thank you so much. But I am 80 percent sure it's not a common > memory problem. this leaves 20% uncertainty :-) taking jans' formula: > -(numberoftrials)x(numberofchannelcombinations)x > (numberoffrequencypoints)x > (numberoftimepoints) and assuming for simlicity you have 100 trials (... 302 channels, right). > ((100*90600*27*21)*16)/c(10^9) #90600 equals to number of all pairwise channel combinations [1] 82.19232 1GB RAM is not much help here for such a beast (and probably the lower limit when doing MEG-analysis), if i have no fundamental misunderstanding here. do you really need 'powandcsd'? why don't you first do the 'pow'- thing, look what's interesting (perhaps some stats) and then redo the freqanalysis with 'powandcsd' on time-frequency points of interest, taking account of your RAM. all the best, nathan From c.hesse at FCDONDERS.RU.NL Fri Mar 30 17:22:54 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Fri, 30 Mar 2007 17:22:54 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <419502.11257.qm@web56614.mail.re3.yahoo.com> Message-ID: Hi Eve, just to chip in here: what (in simple terms) do you want to achieve using wavelet analysis of your data? What do you ultimately want to plot? Christian On 30 Mar 2007, at 15:49, alotof eve wrote: > Dear Jan and Nathan, > > Thank you so much. But I am 80 percent sure it's not a common > memory problem. My computer is 1GB of RAM. And if I don't use > combination, I can select very fine parameters for wavelet > analysis. My data is neuromag .fif data. I suppose something wrong > with the channel counting. > Thanks. > > Best, > eve > > Jan Mathijs Schoffelen wrote: > Dear Eve, > > I totally agree with Nathan. Specifying (unintended, but > still... ;o) ) > 'powandcsd', in particular in combination with a spectro-temporal > reconstruction really blows up your memory requirements. Especially > when > (again probably unintended) you are computing csd's for all > channelcombination. I'll leave it up to you to calculate how many > bytes are > needed only to represent your output csd-matrix in memory. > Some hints: > -each double precision number requires 8 bytes of memory in matlab > -each complex number consists of two double precision numbers > -(numberoftrials)x(numberofchannelcombinations)x > (numberoffrequencypoints)x > (numberoftimepoints) can become really big. > > Yours, > > Jan-Mathijs > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Nathan Weisz > Sent: Friday, March 30, 2007 9:31 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] problem on wavelet analysis, combine channel > > hi eve, > > i'm not too familiar with the fieldtrip specifications, but: > > > Out of memory. Type HELP MEMORY for your options. > > do you have enough RAM? > > this would then not be a real fieldtrip problem, but a rather common > problem generally when using matlab. > > good luck! > > nathan > > > Expecting? Get great news right away with email Auto-Check. > Try the Yahoo! Mail Beta. ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brian.Roach at YALE.EDU Fri Mar 30 18:44:38 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Fri, 30 Mar 2007 12:44:38 -0400 Subject: source analysis attempt using DICS method In-Reply-To: <19AD5C31-FFE9-47C6-AE75-0C7B444EA154@fcdonders.ru.nl> Message-ID: Thanks for these replies. I have now specified cfg.mriunits = 'mm' cfg.sourceunits = 'mm' Then, I should re-run sourceinterpolate.m? That seems to produce the new results, but the same new results whether I specify both units as 'cm' or 'mm'. If my MRI is in 'mm' and sourceanalysis.m uses cm, which are you supposed to use? thanks, Brian At 09:24 AM 3/29/2007, Robert Oostenveld wrote: >On 29 Mar 2007, at 8:29, Jan Mathijs Schoffelen wrote: >>a very likely cause is the incorrect specification of cfg.mriunits, >>and cfg.sourceunits prior to calling sourceinterpolate (I did not >>find back in the code you sent in your mail that you actually >>called it, but I assume you did). If not specified, fieldtrip puts >>cfg.mriunits to 'mm', and cfg.sourceunits to 'cm'. There might be a >>discrepancy in your data there. Perhaps you even explicitly have to >>check, whether your headmodel (in hdmfile) is defined in cm. At >>least the dipole-grid on which sourceanalysis performs the >>beamformer-scanning is defined in cm, and I guess the units should >>be identical here as well. > >The standard BEM EEG volume conduction model that you might have >copied from EEGLAB is one that is based on the MNI template brain. It >is in MNI coordinates (linked to the AC and PC) and the units are in >mm (corresponding with SPM standards). > >Robert From litvak at TX.TECHNION.AC.IL Thu Mar 1 13:00:22 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 12:00:22 -0000 Subject: TopoplotTFR Message-ID: Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 1 13:06:50 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 1 Mar 2007 13:06:50 +0100 Subject: TopoplotTFR In-Reply-To: <000001c75bf9$38f23450$f0463ec1@sobell.ion.ucl.ac.uk> Message-ID: Dear Vladimir, Your xlim and ylim should be defined as two-element vectors, specifying the upper and lower boundaries. So you can only plot subsets of contiguous time-frequency points. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 1 13:12:57 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 1 Mar 2007 13:12:57 +0100 Subject: TopoplotTFR In-Reply-To: <000001c75bf9$38f23450$f0463ec1@sobell.ion.ucl.ac.uk> Message-ID: Oops. I'm sorry, I misread your mail; I thought you were talking about multiplotTFR. Forget what I said before. To my knowledge, a subplotted topoplotTFR only works in the time dimension, but I'm not sure. Did you check the code? So if it is true, that it only works in the time dimension, there are two ways of doing what you want: Repeatedly call topoplotTFR for different frequencies, or adjust the function such that it also works the other way. Maybe you could look into if and why the assignment of the yparam and xparam should always be 'time', and 'freq' respectively. I guess the original reason stems from the fact that we are used to depict TFRs like that. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TX.TECHNION.AC.IL Thu Mar 1 13:19:18 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 12:19:18 -0000 Subject: TopoplotTFR In-Reply-To: <000901c75bfa$18299b40$902dae83@fcdonders.nl> Message-ID: So how do I do a multiple plot? It did work before and works even now for time. Thanks, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jan Mathijs Schoffelen Sent: Thursday, March 01, 2007 12:07 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR Dear Vladimir, Your xlim and ylim should be defined as two-element vectors, specifying the upper and lower boundaries. So you can only plot subsets of contiguous time-frequency points. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TX.TECHNION.AC.IL Thu Mar 1 15:46:28 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 14:46:28 -0000 Subject: TopoplotTFR In-Reply-To: <000e01c75bfa$f2dd27c0$902dae83@fcdonders.nl> Message-ID: I looked at the code and the problem is in line 264 of topoplotER where you assume that the yparam is always the second dimension in the data and the xparam is always the third. When this assumption is false, the code fails. Best, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jan Mathijs Schoffelen Sent: Thursday, March 01, 2007 12:13 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR Oops. I'm sorry, I misread your mail; I thought you were talking about multiplotTFR. Forget what I said before. To my knowledge, a subplotted topoplotTFR only works in the time dimension, but I'm not sure. Did you check the code? So if it is true, that it only works in the time dimension, there are two ways of doing what you want: Repeatedly call topoplotTFR for different frequencies, or adjust the function such that it also works the other way. Maybe you could look into if and why the assignment of the yparam and xparam should always be 'time', and 'freq' respectively. I guess the original reason stems from the fact that we are used to depict TFRs like that. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TX.TECHNION.AC.IL Thu Mar 1 16:22:24 2007 From: litvak at TX.TECHNION.AC.IL (Vladimir Litvak) Date: Thu, 1 Mar 2007 15:22:24 -0000 Subject: TopoplotTFR In-Reply-To: <002101c75c10$650113b0$f0463ec1@sobell.ion.ucl.ac.uk> Message-ID: Here is my suggestion for a fix. It should handle any number of dimensions, which is perhaps slightly overkill for this case, but hope it works. I tested it for time and frequency. Best, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 2:46 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR I looked at the code and the problem is in line 264 of topoplotER where you assume that the yparam is always the second dimension in the data and the xparam is always the third. When this assumption is false, the code fails. Best, Vladimir _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jan Mathijs Schoffelen Sent: Thursday, March 01, 2007 12:13 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] TopoplotTFR Oops. I'm sorry, I misread your mail; I thought you were talking about multiplotTFR. Forget what I said before. To my knowledge, a subplotted topoplotTFR only works in the time dimension, but I'm not sure. Did you check the code? So if it is true, that it only works in the time dimension, there are two ways of doing what you want: Repeatedly call topoplotTFR for different frequencies, or adjust the function such that it also works the other way. Maybe you could look into if and why the assignment of the yparam and xparam should always be 'time', and 'freq' respectively. I guess the original reason stems from the fact that we are used to depict TFRs like that. Yours, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Vladimir Litvak Sent: Thursday, March 01, 2007 1:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] TopoplotTFR Dear all, I'm trying to use topoplotTFR for multichannel data that has both time and frequency dimension. When I configure: cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-2:0.1:0]; cfg.ylim=[8 12]; I get multiple plots corresponding to different time windows. However when I try: cfg.xparam='freq'; cfg.yparam='time'; cfg.xlim=[0:2:40]; cfg.ylim=[-1 0]; or cfg.xparam='time'; cfg.yparam='freq'; cfg.xlim=[-1 0]; cfg.ylim=[0:2:40]; it doesn't work. I either get an error or a single plot. How do I get a series of plots for different frequencies with the same time window? Thanks, Vladimir -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: topoplotER.m URL: From Brian.Roach at YALE.EDU Fri Mar 2 00:02:50 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 1 Mar 2007 18:02:50 -0500 Subject: sourceanalysis.m on EEG data In-Reply-To: <45D1E6AA.3080708@uke.uni-hamburg.de> Message-ID: Till, Thanks so much for the tutorial document. After a recent grant submission, we have some time to really dig into this, and I have a question for you: from the doc... 1) Create BEM model using the following example script (link to 'BEM example script'): - create brain, skull and skin compartments using volumesegment.m and image processing functions - use these compartments as input for the prepare_bemmodel.m function (which uses the C-Program 'Dipoli', available upon request ) ... Do you have a BEM example script, or should I try to use what is listed on the field trip website (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:create_bem_headmodel_for_eeg)? I wasn't sure which you intended to have someone use. thanks, Brian At 11:26 AM 2/13/2007, you wrote: >Dear Brian, > >I`ve worked with the prepare_bemmodel script for constructing a forward >model for source localization of EEG data. Find attached a little tutorial >with the steps I took for creating the BEM from an individual MRI. The >plan is to put it also on the fieldtrip wiki (sooner or later). Please let >me know if you have questions on this tutorial. > >Hope this helps, >Till > > >Robert Oostenveld schrieb: >>The prepare_bemmodel function is in the zip file on the ftp server. The >>dipoli executable is attached to this mail. There exists only a linux >>i386 and an apple PPC version. You are not permitted to distribute the >>dipoli executable, it is not covered under the GPL license but made >>available courtesy of Thom Oostendorp. >> >>best regards, >>Robert >> >>On 12 Feb 2007, at 22:32, Brian Roach wrote: >> >>>Where can I find these functions listed below? >>> >>>% the prepare_bemmodel function is available upon request % the dipoli >>>stand-alone executable is available upon request >> > > From weisz at LYON.INSERM.FR Fri Mar 2 18:40:12 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Fri, 2 Mar 2007 18:40:12 +0100 Subject: first steps using lcmv Message-ID: Hi everyone, in order to explore the usage of the lcmv option of sourceanalysis i'm using eeg data (35 electrodes) with an auditory N1. topography is attached. within fieldtrip i did a dipolefit, and the output looks relatively sensible (perhaps a little deep and posterior, but overall not bad for EEG :-)). however when i run lcmv sourceanalysis, plotting the "neural activation index" gives me something really terrible (also attached). since the "solution" appears relatively clear in this case, i guess i have done something stupid at some point. the steps: dat=eeglab2fieldtrip(EEG,'preprocessing'); cfg=[]; cfg.latency=[.09 .12]; %latency of my N1 cfg.covariance='yes'; cfg.keeptrials='yes'; datTest=timelockanalysis(cfg,dat); vol = []; vol.r = [0.88 0.92 1.00]*85; vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; cfg=[]; cfg.vol=vol; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; [grid] = prepare_leadfield(cfg, datTest); %the same LF-matrix used for 'good' dipole fit cfg=[]; cfg.grid=source2sparse(grid); cfg.method='lcmv'; cfg.vol=vol; cfg.projectnoise='yes'; [sourceN1] = sourceanalysis(cfg, datTest); cfg=[]; cfg.powmethod='none'; %only option that works [sourcenai] = sourcedescriptives(cfg, sourceN1); cfg =[]; cfg.funparameter = 'nai'; sourceN1F=source2full(sourcenai); [interp]=sourceinterpolate(cfg,sourceN1F,mri); sliceinterp(cfg,interp) I'd really appreciate pointers of what I may be doing wrong. thanks a lot, nathan ps: as for the mri, i'm using the mri in MRI4Fieldtrip with coordinates transformed to conform my headmodel coordinates. -------------- next part -------------- A non-text attachment was scrubbed... Name: N1Topo.png Type: application/applefile Size: 70 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1Topo.png Type: image/png Size: 23336 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1DipoleFit.png Type: application/applefile Size: 75 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1DipoleFit.png Type: image/png Size: 64060 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1LCMV.png Type: application/applefile Size: 70 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1LCMV.png Type: image/png Size: 197863 bytes Desc: not available URL: -------------- next part -------------- From t.schneider at UKE.UNI-HAMBURG.DE Fri Mar 2 18:17:04 2007 From: t.schneider at UKE.UNI-HAMBURG.DE (Till Schneider) Date: Fri, 2 Mar 2007 18:17:04 +0100 Subject: sourceanalysis.m on EEG data In-Reply-To: <6.1.2.0.2.20070301175929.027d6eb0@email.med.yale.edu> Message-ID: Dear Brian, basically you can use the example script from the field trip website. Additionally, I attach the script we used for most of our subjects. We made some slight changes, in order to adapt it to our individual MRIs. We had for example a very large Field of View containing the whole neck, so we dropped these voxels. You have to adapt the script to your images and make some plots in between to check the results of the intermediate steps (e.g. with sourceplot.m). To align the indiviual electrode positions to the headmodel you can use the fieldtrip function electroderealign.m. See the example script: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:align_eeg_electrode_positions_to_bem_headmodel for usage. Best regards, Till Brian Roach schrieb: > Till, > > Thanks so much for the tutorial document. After a recent grant > submission, we have some time to really dig into this, and I have a > question for you: > > from the doc... > 1) Create BEM model using the following example script (link to > 'BEM example script'): > - create brain, skull and skin compartments using volumesegment.m and > image processing functions > - use these compartments as input for the prepare_bemmodel.m function > (which uses the C-Program 'Dipoli', available upon request ) > > ... > Do you have a BEM example script, or should I try to use what is > listed on the field trip website > (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:create_bem_headmodel_for_eeg)? > > I wasn't sure which you intended to have someone use. > > thanks, > Brian > At 11:26 AM 2/13/2007, you wrote: >> Dear Brian, >> >> I`ve worked with the prepare_bemmodel script for constructing a >> forward model for source localization of EEG data. Find attached a >> little tutorial with the steps I took for creating the BEM from an >> individual MRI. The plan is to put it also on the fieldtrip wiki >> (sooner or later). Please let me know if you have questions on this >> tutorial. >> >> Hope this helps, >> Till >> >> >> Robert Oostenveld schrieb: >>> The prepare_bemmodel function is in the zip file on the ftp server. >>> The dipoli executable is attached to this mail. There exists only a >>> linux i386 and an apple PPC version. You are not permitted to >>> distribute the dipoli executable, it is not covered under the GPL >>> license but made available courtesy of Thom Oostendorp. >>> >>> best regards, >>> Robert >>> >>> On 12 Feb 2007, at 22:32, Brian Roach wrote: >>> >>>> Where can I find these functions listed below? >>>> >>>> % the prepare_bemmodel function is available upon request % the >>>> dipoli stand-alone executable is available upon request >>> >> >> > > -- Till Schneider, Dipl.Psych. Universitaetsklinikum Hamburg-Eppendorf Institut fuer Neurophysiologie und Pathophysiologie Martinistr. 52 20246 Hamburg Germany tel +49-40-42803-3188 fax +49-40-42803-7752 mobil +49-178-2834030 -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf Körperschaft des öffentlichen Rechts Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Jörg F. Debatin (Vorsitzender) Dr. Alexander Kirstein Ricarda Klein Prof. Dr. Rolf A.K. Stahl -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: createbem_example.m URL: From muthuraman10 at HOTMAIL.COM Mon Mar 5 10:42:17 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Mon, 5 Mar 2007 09:42:17 +0000 Subject: Plotting using Slice! In-Reply-To: <010201c75a63$4710e460$642dae83@fcdonders.nl> Message-ID: Hello, Thanks for the reply, i am little confused at this stage okay, to make things clear in the fieldtrip documentation page it is given that i need to specify the anatomy of the data for the source plot in which case i do not have a anatomical MRI, next if i can follow the steps as you have mentioned to plot using 'slice' with the functional data in my case 'coh' coherence Because i cannot use sourceinterpolate.m or volumenormalize.m without any anatomical data these are my configuration steps on the way to 'DICS' in which the eleclead1 contains the locations for the 64 electrodes from the sphere2 standard locations from the fieldtrip page %SOURCE ANALYSIS DICS elec = []; elec.pnt = randn(64,3); load('C:\muthu\work\fieldtrip-20070222\eleclead1.mat') dum = sqrt(sum(elec.pnt.^2,2)); elec.pnt = 12 * elec.pnt ./ [dum dum dum]; vol = []; vol.r = 12 * [0.88 0.92 1.00]; vol.c = [1 1/80 1]; vol.o = [0 0 0]; cfg1 = []; cfg1.elec = elec; cfg1.vol = vol; cfg1.resolution = 2; grid = prepare_leadfield(cfg1); cfg.frequency=9; cfg.method='dics'; cfg.grid=grid; cfg.elec=elec; cfg.vol=vol; [source]=sourceanalysis(cfg,freqmtmfft); What is the configuration for the source plot can be use to plot? So in this case my functional data for the source plot to be coherence 'coh' cfg1.method='slice'; cfg1.funparameter='coh'; cfg1.maskparameter='coh'; cfg1.volume=vol; cfg1.nslices = 20; cfg1.slicedim = 3; sourceplot(cfg1,'..'); Thanking you With regards M.Muthuraman. >From: Ingrid Nieuwenhuis >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] Plotting using Slice! >Date: Tue, 27 Feb 2007 12:34:44 +0100 > >Hi Muthuraman, > >What are you trying to plot? Could you send which fields are in your >freqmtmfft? > >Bests Ingrid > >-----Original Message----- >From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf >Of Muthuraman Muthuraman >Sent: Tuesday, February 27, 2007 12:20 PM >To: FIELDTRIP at NIC.SURFNET.NL >Subject: [FIELDTRIP] Plotting using Slice! > >Hello Fieldtrippers, > >I am not sure whether this mail has reached the group ! I am sending it >again ! >Thanks for the answer, i tried to plot using the source plot with this >configuration >and i get the error, in this case should i need to transform the data >before > >plotting using slice >any comments on this > >cfg.method='slice'; >cfg.funparameter='coh'; >cfg.nslices = 20; >cfg.slicedim = 3; >sourceplot(cfg,freqmtmfft); >??? Reference to non-existent field 'dim'. > >Error in ==> fieldtrip-20070222\private\grid2transform at 9 >if ~isfield(volume, 'xgrid'), volume.xgrid=1:volume.dim(1); end > >Error in ==> sourceplot at 189 >data = grid2transform(data); > >Thanking you > >With regards >M.Muthuraman. > >_________________________________________________________________ >News and updates from Indian diaspora http://content.msn.co.in/NRI/Default _________________________________________________________________ Gossips, movie reviews, photogallery and more http://content.msn.co.in/Entertainment/Default From r.oostenveld at FCDONDERS.RU.NL Mon Mar 5 17:56:33 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 5 Mar 2007 17:56:33 +0100 Subject: first steps using lcmv In-Reply-To: Message-ID: Hi Nathan, On 2 Mar 2007, at 18:40, Nathan Weisz wrote: > in order to explore the usage of the lcmv option of sourceanalysis > i'm using eeg data (35 electrodes) with an auditory N1. topography > is attached. within fieldtrip i did a dipolefit, and the output > looks relatively sensible (perhaps a little deep and posterior, but > overall not bad for EEG :-)). however when i run lcmv > sourceanalysis, plotting the "neural activation index" gives me > something really terrible (also attached). since the "solution" > appears relatively clear in this case, i guess i have done > something stupid at some point. Given that you do not report explicit errors, I suspect problems with different coordinates The topography looks ok, and the source from DIPOLEFITTING seems to match. I don't know whether the small number of electrodes would be a problem for beaming the data. > cfg=[]; > cfg.latency=[.09 .12]; %latency of my N1 > cfg.covariance='yes'; > cfg.keeptrials='yes'; > datTest=timelockanalysis(cfg,dat); You may want to specify cfg.covariancewindow as well. Please read the emails on the list from last week between Marie and me for an explanation on te hcomputation of the covariance. Marie has some meaningfull ideas here (I visited her last Friday and we were able to discuss this directly), but they have not yet been implemented in FT. > cfg=[]; > cfg.vol=vol; > cfg.grid.xgrid='auto'; > cfg.grid.ygrid='auto'; > cfg.grid.zgrid='auto'; > [grid] = prepare_leadfield(cfg, datTest); %the same LF-matrix used > for 'good' dipole fit Are the dipoles (grid.pos) in mm? It should be in mm, just as your head model. Note that beamforming is much more sensitive to head model misspecification than plain dipolefitting, so you may want to use a (standard) BEM model instead of a spherical model. > cfg=[]; > cfg.grid=source2sparse(grid); > cfg.method='lcmv'; > cfg.vol=vol; > cfg.projectnoise='yes'; > [sourceN1] = sourceanalysis(cfg, datTest); I would expect a problem here for you, since the default noise estimate in case of EEG should be zero. The noise (for the projection) is estimated by taking the smallest singular value of the covariance matrix, and given that the ata is supposed to be avg- referenced, the smallest singular value should be zero. I.e. it should give a warning about the matrix being rank-deficient. The solution to that is to explicitely noise regularize using cfg.lambda. > cfg=[]; > cfg.powmethod='none'; %only option that works > [sourcenai] = sourcedescriptives(cfg, sourceN1); Since you have not specified anything fancy in the lcmv beamformer, you indeed do not have to post-process your power here (that requires cfg.powmethod=something). > cfg =[]; > cfg.funparameter = 'nai'; > sourceN1F=source2full(sourcenai); > [interp]=sourceinterpolate(cfg,sourceN1F,mri); I suspect the problem here: please explicitely specyfy cfg.sourceunits and cfg.mriunits. > sliceinterp(cfg,interp) please use sourceplot with cfg.method='slice' instead (sliceinterp is deprecated). > I'd really appreciate pointers of what I may be doing wrong. Not related to the reported problem, but very important in general is the referencing: please ensure that your data is averaged referenced before computing the covariance. The options cfg.preproc.refef='yes' and cfg.preproc.refchan='all' in timelockanalysis should do that for you. You can easily check by summing the potential over all channels: the sum should be zero at every sample. I hope this helps, Robert From gmcauley at LLU.EDU Tue Mar 6 03:32:41 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Mon, 5 Mar 2007 18:32:41 -0800 Subject: Investigating Fieldtrip Message-ID: Hello, I have been asked to help with the analysis of some fetal sheep EEG data. I have a pretty good programing background, and some MATLAB experience, but am lacking in EEG and related background. What we want to do seems rather simple compared to what it looks like Fieldtrip can do. So, before really diving in, it would be helpful to know if this is the right tool for our problem and not overkill. Basically, we need to: 1) Open time series data that is in ASCII format. The data is just one or two channels of potentials from one or two electrodes sampled at 200Hz. 2) Identify regions in the data that have 'high voltage/low frequency' or 'low voltage/high frequency'. (Perhaps this could be determined based on average in data region vs average potential of whole data set). 3) Calculate power spectra for the data regions. 4) Calculate spectral edge frequencies for the data regions 5) Do some simple statistics comparing data regions (eg, spectral edge frequency of controls vs experimental group). 6) Creating m files to automate as much as possible. So my questions are: 1) Is this straight forward to do in Fieldtrip? 2) Do we need anything more than the MATLAB program itself (ie, do we need any other MATLAB toolboxes)? 3) Is there another (free) library that might be better for this kind of a problem? Answers to these questions would be very help and much appreciated. ~ Grant -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From c.hesse at FCDONDERS.RU.NL Tue Mar 6 08:59:57 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 6 Mar 2007 08:59:57 +0100 Subject: Investigating Fieldtrip In-Reply-To: <1173148361.31521.117.camel@localhost.localdomain> Message-ID: Hi Grant, > Basically, we need to: > 1) Open time series data that is in ASCII format. The data is just > one > or two channels of potentials from one or two electrodes sampled at > 200Hz. Assuming that the data format can be read using standard Matlab file I/O functions (fread or dlmread) all that is required is then to convert the data into an appropriate FieldTrip (FT) data structure. This will work best if your data naturally divides into "trials" or epochs, but in principle you can also define intervals of arbitrary length with arbitrary overlap (which may be useful for subsequent spectral / time-frequency analysis). > 2) Identify regions in the data that have 'high voltage/low frequency' > or 'low voltage/high frequency'. (Perhaps this could be determined > based on average in data region vs average potential of whole data > set). There are several ways in which this could be accomplished in FT. > 3) Calculate power spectra for the data regions. > > 4) Calculate spectral edge frequencies for the data regions > > 5) Do some simple statistics comparing data regions (eg, spectral edge > frequency of controls vs experimental group). All easy. > 6) Creating m files to automate as much as possible. That's the essence of FT philosophy :-) > So my questions are: > > 1) Is this straight forward to do in Fieldtrip? Mostly, yes. However, you may need to write the odd small function yourself, which is then passed to and called by FT: at the end of the day, FT is merely a "box of tools" :-) > 2) Do we need anything more than the MATLAB program itself (ie, do we > need any other MATLAB toolboxes)? FT has been written to be as "stand alone" as possible, so you should be OK. I could imagine that the only other Matlab Toolboxes you might need are the Statistics Toolbox (to do paramteric tests, FT can do non-parametric permutation tests using any statistic/measure derived from your data) based on permutation) and perhaps the Signal Processing Toolbox (although I am pretty sure that FT is now self- sufficient there). > 3) Is there another (free) library that might be better for this > kind of > a problem? Not sure about free ones ... you could always write your own stuff in Matlab, I guess. Hope this helps, Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Mar 6 10:29:15 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 Mar 2007 10:29:15 +0100 Subject: No subject In-Reply-To: Message-ID: Hi Sameer, One small comment to start with: please use a subject in your emails to the list. That makes it easier to keep track of discussions and threads. On 28 Feb 2007, at 21:59, Sameer Walawalkar wrote: > I am currently experimenting with beamformers and was playing with > http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:use_your_own_forward_leadfield_model_in_an_ > inverse_beamformer_computation > to generate the grid. You have 306ch Neuromag data, and I don't recall exactly whether that has been fully tested for forward computations. Some background: at each of the 102 locations of each "chip" you have 3 channels: two of those have 2 coils, and one is a magnetometer with only one coil. Please have a look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_are_electrodes _magnetometers_or_gradiometers_described for the description of "grad". I would expect in your case that grad.pnt and ori 102*2+102*2+102= 510 rows long, each with 3 columns grad.tra 306 x 510 The gradiometer coils are shifted w.r.t. the center of the "chip" by a small amount. I think that currently the baseline (i.e. the distance between the coils) is hardcoded. Joachim Gross once gave me code for that, it is included in feldtrip/private/fif2grad. Please look at it and see whether it applies to your 306ch gradiometer design as well. > > I did the following > > > vol = []; > vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius > is 12 cm > vol.c = [1 1/80 1]; % conductivity > vol.o = [0 0 0]; % center of sphere this indicates a 4-shell concentric-sphere EEG model. It does not make sense for MEG, since in MEG teh conductivity of the different layers in the spherical model does not affect the field distribution. > % compute the leadfields that can be used for the beamforming > cfg = []; > cfg.vol = vol; > cfg.resolution = 2; % same unit as above, i.e. in cm > grid = prepare_leadfield(cfg, dataPre); > > (I expect prepare_leadfield to pick up grad definitions from the data) > > ??? Error using ==> fieldtrip/private/compute_leadfield > different number of spheres for the radius and origin FT works with MEG either with a single sphere or multisphere models, i.e. vol.r = 12 vol.o = [0 0 5] This origin is a better guess for the center of the sphere, remember that in the MEG case you do not move the sensors towards the head, but the position of the sensors (coils) is expressed with respect to the head coordinate system. In case of EEG, it is more common to use standard electrodes that are moved towards the head. You can use HEADMODELPLOT to look at the geometry of the sensors and head model. A multisphere model contains a sinsgle sphere for each sensor. Actually, for the forward computation it should contain a single sphere for each coil. Multisphere models currently are not implemented for Neuromag data. The reason for the error is that FT is confused about it being not a single-sphere, but also not a multi-sphere model. Also your later errors are explained by that. Please use a single sphere model. Or alternatively you can use a realistic single-shell (Nolte) model, which is more accurate than the multi-sphere models, but I suggest first to try around with a single sphere. The most important thing for you to check is whether the grad structure is geometrically correct. Lauri Parkonen will probably be able to help you with checking that. best regards, Robert > Error in ==> prepare_leadfield at 209 > grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), > sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); > > Error in ==> SomeMaster at 15 > grid = prepare_leadfield(cfg, dataPre); > > > > To get around this error, I change vol to > > vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ]; > > ??? Error using ==> fieldtrip/private/compute_leadfield > number of spheres is not equal to the number of coils > > Error in ==> prepare_leadfield at 209 > grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), > sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); > > Error in ==> SomeMaster at 15 > grid = prepare_leadfield(cfg, dataPre); > > > I thought this might be due to the 4 HPI coils, so I changed vol to > vol.r = 12 * [0.88 0.92 0.96 1.00]; > vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ; 0 0 0 ]; > > but it was of no use. > > Any suggestions? > > Thanks, > sameer > From P.vandenHurk at CS.RU.NL Tue Mar 6 15:55:53 2007 From: P.vandenHurk at CS.RU.NL (P.vandenHurk) Date: Tue, 6 Mar 2007 15:55:53 +0100 Subject: No subject In-Reply-To: <692D7E98-7D1F-4398-8C9C-AB7D829A273B@fcdonders.ru.nl> Message-ID: Hello, Each time I use the 'read_fcdc_event' function, I get the following error: ??? Error using ==> read_event type field not defined for each event Error in ==> read_fcdc_event at 51 [event] = read_event(varargin{:}); Can you tell me how I can fix this error? Thanks, Best regards, Paul Robert Oostenveld schreef: > Hi Sameer, > > One small comment to start with: please use a subject in your emails > to the list. That makes it easier to keep track of discussions and > threads. > > On 28 Feb 2007, at 21:59, Sameer Walawalkar wrote: >> I am currently experimenting with beamformers and was playing with >> http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:use_your_own_forward_leadfield_model_in_an_inverse_beamformer_computation >> >> to generate the grid. > > You have 306ch Neuromag data, and I don't recall exactly whether that > has been fully tested for forward computations. Some background: at > each of the 102 locations of each "chip" you have 3 channels: two of > those have 2 coils, and one is a magnetometer with only one coil. > > Please have a look at > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:frequently_asked_questions#how_are_electrodes_magnetometers_or_gradiometers_described > > for the description of "grad". I would expect in your case that > grad.pnt and ori 102*2+102*2+102= 510 rows long, each with 3 columns > grad.tra 306 x 510 > > The gradiometer coils are shifted w.r.t. the center of the "chip" by a > small amount. I think that currently the baseline (i.e. the distance > between the coils) is hardcoded. Joachim Gross once gave me code for > that, it is included in feldtrip/private/fif2grad. Please look at it > and see whether it applies to your 306ch gradiometer design as well. > >> >> I did the following >> >> >> vol = []; >> vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is >> 12 cm >> vol.c = [1 1/80 1]; % conductivity >> vol.o = [0 0 0]; % center of sphere > > this indicates a 4-shell concentric-sphere EEG model. It does not make > sense for MEG, since in MEG teh conductivity of the different layers > in the spherical model does not affect the field distribution. > >> % compute the leadfields that can be used for the beamforming >> cfg = []; >> cfg.vol = vol; >> cfg.resolution = 2; % same unit as above, i.e. in cm >> grid = prepare_leadfield(cfg, dataPre); >> >> (I expect prepare_leadfield to pick up grad definitions from the data) >> >> ??? Error using ==> fieldtrip/private/compute_leadfield >> different number of spheres for the radius and origin > > FT works with MEG either with a single sphere or multisphere models, i.e. > vol.r = 12 > vol.o = [0 0 5] > This origin is a better guess for the center of the sphere, remember > that in the MEG case you do not move the sensors towards the head, but > the position of the sensors (coils) is expressed with respect to the > head coordinate system. In case of EEG, it is more common to use > standard electrodes that are moved towards the head. You can use > HEADMODELPLOT to look at the geometry of the sensors and head model. > > A multisphere model contains a sinsgle sphere for each sensor. > Actually, for the forward computation it should contain a single > sphere for each coil. Multisphere models currently are not implemented > for Neuromag data. > > The reason for the error is that FT is confused about it being not a > single-sphere, but also not a multi-sphere model. Also your later > errors are explained by that. Please use a single sphere model. Or > alternatively you can use a realistic single-shell (Nolte) model, > which is more accurate than the multi-sphere models, but I suggest > first to try around with a single sphere. The most important thing for > you to check is whether the grad structure is geometrically correct. > Lauri Parkonen will probably be able to help you with checking that. > > best regards, > Robert > > >> Error in ==> prepare_leadfield at 209 >> grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), >> sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); >> >> Error in ==> SomeMaster at 15 >> grid = prepare_leadfield(cfg, dataPre); >> >> >> >> To get around this error, I change vol to >> >> vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ]; >> >> ??? Error using ==> fieldtrip/private/compute_leadfield >> number of spheres is not equal to the number of coils >> >> Error in ==> prepare_leadfield at 209 >> grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), >> sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize); >> >> Error in ==> SomeMaster at 15 >> grid = prepare_leadfield(cfg, dataPre); >> >> >> I thought this might be due to the 4 HPI coils, so I changed vol to >> vol.r = 12 * [0.88 0.92 0.96 1.00]; >> vol.o = [0 0 0 ; 0 0 0 ; 0 0 0 ; 0 0 0 ]; >> >> but it was of no use. >> >> Any suggestions? >> >> Thanks, >> sameer >> -- ----------------------------------------------------------- Paul van den Hurk Joint Principal Investigator Mindfulness Project Inserm U280, Lyon, France, Radboud University Nijmegen: Department of computer sciences and Department of Medical Physics and Biophysics/126 Geert Grooteplein 21 6525 EZ Nijmegen Email: P.vandenHurk at cs.ru.nl Tel: 024-3613326 From gmcauley at LLU.EDU Tue Mar 6 18:41:38 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Tue, 6 Mar 2007 09:41:38 -0800 Subject: Investigating Fieldtrip In-Reply-To: Message-ID: Thanks Christian for your helpful reply. FT is sounding very good! > > > 2) Do we need anything more than the MATLAB program itself (ie, do > > we > > need any other MATLAB toolboxes)? > > > FT has been written to be as "stand alone" as possible, so you should > be OK. I could imagine that the only other Matlab Toolboxes you might > need are the Statistics Toolbox (to do paramteric tests, FT can do > non-parametric permutation tests using any statistic/measure derived > from your data) based on permutation) and perhaps the Signal > Processing Toolbox (although I am pretty sure that FT is now > self-sufficient there). > My only immediate remaining question is about if FT is dependent on the MATLAB Signal Processing Toolbox (Statistic Toolbox does not matter). Definite confirmation here would be very helpful. ~ Grant > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From c.hesse at FCDONDERS.RU.NL Wed Mar 7 09:10:48 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 7 Mar 2007 09:10:48 +0100 Subject: Investigating Fieldtrip In-Reply-To: <1173202898.31521.133.camel@localhost.localdomain> Message-ID: Hi Grant, > Thanks Christian for your helpful reply. > > FT is sounding very good! > My only immediate remaining question is about if FT is dependent on > the > MATLAB Signal Processing Toolbox (Statistic Toolbox does not matter). > > Definite confirmation here would be very helpful. For spectral estimation / analysis FT depends only on the FFT function which is part of the basic Matlab package. For signal filtering, you need the signal processing toolbox in order to design your filters, e.g., a 4th order Butterworth band pass filter, but if you generate the filter coefficients (or the polynomial coefficients of the transfer function) yourself, then you can use the FILTER function with those coefficients which is again part of the basic Matlab. I guess you're mainly interested in spectral analysis of your signal rather than filtering, so you should be able get away without the Signal Processing Toolbo (however, I would recommend getting a copy in order to take full advantage of all FT functionality). Hope that helps, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 6 16:53:58 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 6 Mar 2007 16:53:58 +0100 Subject: No subject In-Reply-To: <45ED80F9.6060007@cs.ru.nl> Message-ID: Hi Paul, in order to be able to help you, can you please specify which type of data format you are trying to read events from? > Hello, > > Each time I use the 'read_fcdc_event' function, I get the following > error: > > ??? Error using ==> read_event > type field not defined for each event > > Error in ==> read_fcdc_event at 51 > [event] = read_event(varargin{:}); > > Can you tell me how I can fix this error? We'll fix the error if there is one, we give you advice on how to avoid them :-) Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From P.vandenHurk at CS.RU.NL Wed Mar 7 13:48:37 2007 From: P.vandenHurk at CS.RU.NL (P.vandenHurk) Date: Wed, 7 Mar 2007 13:48:37 +0100 Subject: No subject In-Reply-To: Message-ID: Hello Christian, I am sorry, but of course. It is a .bdf file. The read_fcdc_header function does work by the way. Regards, Paul Christian Hesse schreef: > Hi Paul, > > in order to be able to help you, can you please specify which type of > data format you are trying to read events from? > >> Hello, >> >> Each time I use the 'read_fcdc_event' function, I get the following >> error: >> >> ??? Error using ==> read_event >> type field not defined for each event >> >> Error in ==> read_fcdc_event at 51 >> [event] = read_event(varargin{:}); >> >> Can you tell me how I can fix this error? > > We'll fix the error if there is one, we give you advice on how to > avoid them :-) > > Regards, > Christian > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > -- ----------------------------------------------------------- Paul van den Hurk Joint Principal Investigator Mindfulness Project Inserm U280, Lyon, France, Radboud University Nijmegen: Department of computer sciences and Department of Medical Physics and Biophysics/126 Geert Grooteplein 21 6525 EZ Nijmegen Email: P.vandenHurk at cs.ru.nl Tel: 024-3613326 From gmcauley at LLU.EDU Wed Mar 7 17:01:09 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Wed, 7 Mar 2007 08:01:09 -0800 Subject: Investigating Fieldtrip In-Reply-To: Message-ID: Thank you for your reply. On Wed, 2007-03-07 at 09:10 +0100, Christian Hesse wrote: > Hi Grant, > > > Thanks Christian for your helpful reply. > > > > > > FT is sounding very good! > > > My only immediate remaining question is about if FT is dependent on > > the > > MATLAB Signal Processing Toolbox (Statistic Toolbox does not > > matter). > > > > > > Definite confirmation here would be very helpful. > > > For spectral estimation / analysis FT depends only on the FFT function > which is part of the basic Matlab package. For signal filtering, you > need the signal processing toolbox in order to design your filters, > e.g., a 4th order Butterworth band pass filter, but if you generate > the filter coefficients (or the polynomial coefficients of the > transfer function) yourself, then you can use the FILTER function with > those coefficients which is again part of the basic Matlab. > > > I guess you're mainly interested in spectral analysis of your signal > rather than filtering, so you should be able get away without the > Signal Processing Toolbo (however, I would recommend getting a copy in > order to take full advantage of all FT functionality). Great, at this stage it looks like we can get by without the Signal Processing Toolbox, and can expand if necessary in the future. I will plan to 'dive in' to FT! Thanks again, ~ Grant > > Hope that helps, > Christian > > > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From muthuraman10 at HOTMAIL.COM Wed Mar 7 17:14:56 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Wed, 7 Mar 2007 16:14:56 +0000 Subject: Reference Channel for DICS! Message-ID: Hello, These are the configuration steps of the data for DICS hdr = read_fcdc_header('pd_mof_tr0_c_0306.cnt'); emgindx = strmatch('M', hdr.label); rstindx = setdiff(1:length(hdr.label),emgindx); hdr Fs: 1000 nChans: 64 nSamples: 74520 nSamplesPre: 0 nTrials: 1 label: {1x64 cell} orig: [1x1 struct] %Defining trials trl = []; trl(:,1) = [21:1000:74520-1000]'; trl(:,2) = [1020:1000:74520]'; trl(:,3) = 0; %Data_EEG cfg = []; cfg.dataset = 'pd_mof_tr0_c_0306.cnt'; cfg.trl = trl; cfg.blc = 'yes'; cfg.channel = hdr.label(rstindx); cfg.implicitref='CZ'; cfg.reref='all'; data_eeg = preprocessing(cfg); %Data_EMG cfg.hpfilter = 'yes'; cfg.hpfreq = 10; cfg.channel = hdr.label(emgindx); cfg.refchan='M1'; cfg.blc='yes'; cfg.rectify = 'yes'; data_emg = preprocessing(cfg); data = appenddata([],data_eeg,data_emg); I get the error ??? Error using ==> appenddata cannot determine how the data should be concatenated This is because after including the reference channels with EEG channels are 61 and EMG channels are 5, inorder to execute the DICS method with reference channel these steps are necessary for the CSD to be complete Is there a way to add the data with these two extra reference channels? any comments on this would be appreciated Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It�s cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in From Brian.Roach at YALE.EDU Wed Mar 7 17:35:33 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Wed, 7 Mar 2007 11:35:33 -0500 Subject: units for uncorrected freqanalysis_wltconvol.m Message-ID: FieldTrip Users, I am wondering what the unit scale is for output from the freqanalysis_wltconvol.m function before any type of baseline correction if the input units are microvolts. Is the output magnitude, or magnitude squared (power or power spectra)? Based on this equation from the code: powdum = (2.* abs(autspctrmacttap) ./ data.fsample) .^ 2; I believe abs(autspctrmacttap) = magnitude, and that means powdum = power. If that is the case, I believe I am getting some really huge values compared to the voltage of the pre-processed EEG. Is it possible that I have done something wrong, or is it typically the case for EEG power to be much greater than EEG amplitude? thanks, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From weisz at LYON.INSERM.FR Wed Mar 7 18:08:11 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Wed, 7 Mar 2007 18:08:11 +0100 Subject: first steps using lcmv In-Reply-To: <13CF5947-E369-4D4C-849B-F6444167FA61@fcdonders.ru.nl> Message-ID: hi robert, thanks for your quick help. > Given that you do not report explicit errors, I suspect problems > with different coordinates indeed i overlooked to explicitely state the source and mri-units in sourceinterpolate. the nai-image looks better now, although perhaps a little deep (also sme yellow in the middle; perhaps as a result of correlated bilateral activity?). but it's not the mri of the individual and i still have find out more about the usage and the options of sourceanalysis. > I don't know whether the small number of electrodes would be a > problem for beaming the data. don't know too ... but van Veen et al. used even less in their 1997 paper. > Are the dipoles (grid.pos) in mm? It should be in mm, just as your > head model. Note that beamforming is much more sensitive to head > model misspecification than plain dipolefitting, so you may want to > use a (standard) BEM model instead of a spherical model. i found a standard bem in the dipfit plugin folder of eeglab (standard_vol.mat). >> vol vol = bnd: [1x3 struct] cond: [0.3300 0.0041 0.3300] mat: [3000x3000 double] type: 'dipoli' i guess that i can simply exchange my standard spherical model (same as in eeglab) and use this bem volume for calculating the leadfield. one aspect are the electrode locations: the positions are given on a sphere ... so probably there'll has to be some transformation of the positions. > please use sourceplot with cfg.method='slice' instead (sliceinterp > is deprecated). still used sliceinterp this time ... found it a little more easy to use. all the best, nathan -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 1.png Type: application/applefile Size: 73 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 1.png Type: image/png Size: 150703 bytes Desc: not available URL: -------------- next part -------------- From P.vandenHurk at CS.RU.NL Thu Mar 8 09:51:36 2007 From: P.vandenHurk at CS.RU.NL (P.vandenHurk) Date: Thu, 8 Mar 2007 09:51:36 +0100 Subject: problem using read_fcdc_event function In-Reply-To: <8A3F5CCB-C26C-46E7-BE2C-22CF761817E0@lyon.inserm.fr> Message-ID: Hello, Is it possible to work with .bdf files in the fieldtrip environment? I am asking because I have this problem with the read_fcdc_event function (by the way I don't have any problems when I use the read_fcdc_header function)? Thanks for your comment, Kind regards, Paul Nathan Weisz schreef: > hi robert, > > thanks for your quick help. > >> Given that you do not report explicit errors, I suspect problems with >> different coordinates > > indeed i overlooked to explicitely state the source and mri-units in > sourceinterpolate. > > the nai-image looks better now, although perhaps a little deep (also > sme yellow in the middle; perhaps as a result of correlated bilateral > activity?). but it's not the mri of the individual and i still have > find out more about the usage and the options of sourceanalysis. > >> I don't know whether the small number of electrodes would be a >> problem for beaming the data. > > don't know too ... but van Veen et al. used even less in their 1997 > paper. > >> Are the dipoles (grid.pos) in mm? It should be in mm, just as your >> head model. Note that beamforming is much more sensitive to head >> model misspecification than plain dipolefitting, so you may want to >> use a (standard) BEM model instead of a spherical model. > > i found a standard bem in the dipfit plugin folder of eeglab > (standard_vol.mat). > > >> vol > > vol = > > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > mat: [3000x3000 double] > type: 'dipoli' > > i guess that i can simply exchange my standard spherical model (same > as in eeglab) and use this bem volume for calculating the leadfield. > one aspect are the electrode locations: the positions are given on a > sphere ... so probably there'll has to be some transformation of the > positions. > >> please use sourceplot with cfg.method='slice' instead (sliceinterp is >> deprecated). > > still used sliceinterp this time ... found it a little more easy to use. > > all the best, > nathan > > > > ------------------------------------------------------------------------ > -- ----------------------------------------------------------- Paul van den Hurk Joint Principal Investigator Mindfulness Project Inserm U280, Lyon, France, Radboud University Nijmegen: Department of computer sciences and Department of Medical Physics and Biophysics/126 Geert Grooteplein 21 6525 EZ Nijmegen Email: P.vandenHurk at cs.ru.nl Tel: 024-3613326 From nicola.ray at DPAG.OX.AC.UK Fri Mar 9 12:01:09 2007 From: nicola.ray at DPAG.OX.AC.UK (Niki Ray) Date: Fri, 9 Mar 2007 12:01:09 +0100 Subject: ICA with averaged data Message-ID: Hi, I'm very new to fieldtrip. I have three questions. I have collected MEG data from patients with a deep brain stimulator implanted. I'd like to do an ICA to reject the stimulator related artifacts. Sometimes the stimulator is on and sometimes off. So my first question is, do i combine all the data together and then perform the ICA, or do i do different ICA analyses for each condition(on and off stimulation), and hence reject different components for each condition? One possibility for deciding wich of the artifacts were related to the stimulator was to use the example matlab script you provide for rejecting ECG components. Some of the channels (about 13, i'm using a ctf 275 system) have a lot of very distinct artifact that is obviously from the stimulator, so i wanted to use one of these channels as the "ECG" channel. Is this sensible, or not?? Finally, I've been getting conflicting advice about whether it is okay to first average data, and then perform an ICA. What do you suggest is the right thing to do? Many thanks! Niki From s.debener at UKE.UNI-HAMBURG.DE Fri Mar 9 13:11:30 2007 From: s.debener at UKE.UNI-HAMBURG.DE (Stefan Debener) Date: Fri, 9 Mar 2007 12:11:30 +0000 Subject: ICA with averaged data In-Reply-To: Message-ID: Hi Niki, It does, in my opinion, not make much sense to average first and then run ICA, you unlikely obtain a robust decomposition this way and may not be able to remove the stimulator artefact. ICA needs quite a few training data to find a decent decomposition, and this is not provided by ERPs, even though some commercial software packages may allow you to apply ICA to ERPs/ERFs. Only if (!) all your data are recorded such that there was no substantial head movement (that is, the position between sensors and sources did not change), you may get a decent artefact IC (or several ICs) from combined data (there is a few more ifs involved, please see previous ICA discussions here and in the EEGLAB mailing list). YI'd suggest using the pca option and decomposse, say, about 50 components, to start with, and then try to optimize the result by playing with the pca option and by running ICAs for separate recording blocks. Best, Stefan Niki Ray wrote: > Hi, > I'm very new to fieldtrip. I have three questions. I have collected MEG > data from patients with a deep brain stimulator implanted. I'd like to do an > ICA to reject the stimulator related artifacts. Sometimes the stimulator is > on and sometimes off. So my first question is, do i combine all the data > together and then perform the ICA, or do i do different ICA analyses for > each condition(on and off stimulation), and hence reject different > components for each condition? > > One possibility for deciding wich of the artifacts were related to the > stimulator was to use the example matlab script you provide for rejecting > ECG components. Some of the channels (about 13, i'm using a ctf 275 system) > have a lot of very distinct artifact that is obviously from the stimulator, > so i wanted to use one of these channels as the "ECG" channel. Is this > sensible, or not?? > > Finally, I've been getting conflicting advice about whether it is okay to > first average data, and then perform an ICA. What do you suggest is the > right thing to do? > > Many thanks! > Niki > > > From ychen at BME.UFL.EDU Fri Mar 9 15:11:30 2007 From: ychen at BME.UFL.EDU (Y Chen) Date: Fri, 9 Mar 2007 15:11:30 +0100 Subject: Problem with BESA coordinate system Message-ID: Hi, I used "besa2fieldtrip.m" and "read_fcdc_elec.m" to load BESA .avr file and .sfp electrode file, then used "topoplotEP.m" and got the attached plot. Looks like the coordinate is wrong (90 degree shift). Form your website introduction, the BESA coordinate is right. However in the software implementation, would you please double check it? I could send in my files if you want. Thanks. Chen -------------- next part -------------- A non-text attachment was scrubbed... Name: BESALayout.jpg Type: image/pjpeg Size: 49488 bytes Desc: not available URL: From Brian.Roach at YALE.EDU Sat Mar 10 01:00:59 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Fri, 9 Mar 2007 19:00:59 -0500 Subject: strel_bol function for creating a head model Message-ID: FT users, This tutorial (http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:create_bem_headmodel_for_eeg) calls a function "strel_bol", which I do not have in my matlab library. Does anyone have this function? Is it from one of the toolboxes, FieldTrip, or some other location? I have just downloaded the latest F.T. version and cannot find this function. thanks, Brian From r.oostenveld at FCDONDERS.RU.NL Sun Mar 11 14:48:54 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Sun, 11 Mar 2007 14:48:54 +0100 Subject: strel_bol function for creating a head model In-Reply-To: <6.1.2.0.2.20070309185908.01c4a550@email.med.yale.edu> Message-ID: Dear Brian please find it attached. It is a simple function that I wrote, but it is not used in FieldTrip proper and therefore not included in the zip file. Note that it constructs a spherical smoothing kernel ("structural element"=strel in image processing terminology). Sphere is "bol" in Dutch. best regards, Robert On 10 Mar 2007, at 1:00, Brian Roach wrote: > FT users, > > This tutorial (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:create_bem_headmodel_for_eeg) calls a > function "strel_bol", which I do not have in my matlab library. > Does anyone have this function? Is it from one of the toolboxes, > FieldTrip, or some other location? I have just downloaded the > latest F.T. version and cannot find this function. > > thanks, > Brian -------------- next part -------------- A non-text attachment was scrubbed... Name: strel_bol.m Type: application/octet-stream Size: 442 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Sun Mar 11 15:05:42 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Sun, 11 Mar 2007 15:05:42 +0100 Subject: ICA with averaged data In-Reply-To: Message-ID: Dear Niki On 9 Mar 2007, at 12:01, Niki Ray wrote: > Some of the channels (about 13, i'm using a ctf 275 system) > have a lot of very distinct artifact that is obviously from the > stimulator, > so i wanted to use one of these channels as the "ECG" channel. Is this > sensible, or not?? The demo script on http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:use_independent_component_analysis_ica_to_rem ove_ecg_artifacts uses the measured real ECG channel to facilitate finding the ICA components that represent the heart artifact. It does that by computing the QRS–pek triggererd average of the ICA components, and by computing the coherence between all ICA components and the ECG channel. In your case, you do not seem to have an external channel that can act as the ECG channel in the demo script. However, important is that the ECG channel is _only_ used to facilitate finding the heart components and it does not have a fundamental role in the ICA unmixing or rejection. Apparently you can detect the artifact components in your data in some other way, so you should be fine without a fake ECG channel. best regards Robert From r.oostenveld at FCDONDERS.RU.NL Sun Mar 11 15:12:13 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Sun, 11 Mar 2007 15:12:13 +0100 Subject: Problem with BESA coordinate system In-Reply-To: Message-ID: Dear Chen On 9 Mar 2007, at 15:11, Y Chen wrote: > I used "besa2fieldtrip.m" and "read_fcdc_elec.m" to load BESA .avr > file > and .sfp electrode file, then used "topoplotEP.m" and got the attached > plot. Looks like the coordinate is wrong (90 degree shift). Form your > website introduction, the BESA coordinate is right. However in the > software implementation, would you please double check it? I could > send in > my files if you want. Thanks. The read_fcdc_elec does not know about the coordinate system, and just reads the electrode locations in the way they are represented in the file. In FieldTrip we do not have a fixed coordinate system. However, the topoplotting functions do have a fixed layout of the head, i.e. the schematical drawing of the head (the circle, with the triangle as nose and with the ears) always has the nose at the top. The nose position is at the moment not an option that you can specify in topoplot (it might make sense to implement a cfg.noseposition='positiveY' or 'positiveY'). That means that for topoplottting at the moment you have to rotate your electrode positions (elec.pnt) by 90 degrees. best regards, Robert From muthuraman10 at HOTMAIL.COM Mon Mar 12 10:59:19 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Mon, 12 Mar 2007 09:59:19 +0000 Subject: Reference channel! Message-ID: Hello, I am not sure whether it has reached the group so sending it again! sorry for the inconvience incase it has reached the group These are the configuration steps of the data for DICS hdr = read_fcdc_header('pd_mof_tr0_c_0306.cnt'); emgindx = strmatch('M', hdr.label); rstindx = setdiff(1:length(hdr.label),emgindx); hdr Fs: 1000 nChans: 64 nSamples: 74520 nSamplesPre: 0 nTrials: 1 label: {1x64 cell} orig: [1x1 struct] %Defining trials trl = []; trl(:,1) = [21:1000:74520-1000]'; trl(:,2) = [1020:1000:74520]'; trl(:,3) = 0; %Data_EEG cfg = []; cfg.dataset = 'pd_mof_tr0_c_0306.cnt'; cfg.trl = trl; cfg.blc = 'yes'; cfg.channel = hdr.label(rstindx); cfg.implicitref='CZ'; cfg.reref='all'; data_eeg = preprocessing(cfg); %Data_EMG cfg.hpfilter = 'yes'; cfg.hpfreq = 10; cfg.channel = hdr.label(emgindx); cfg.refchan='M1'; cfg.blc='yes'; cfg.rectify = 'yes'; data_emg = preprocessing(cfg); data = appenddata([],data_eeg,data_emg); I get the error ??? Error using ==> appenddata cannot determine how the data should be concatenated This is because after including the reference channels with EEG channels are 61 and EMG channels are 5, inorder to execute the DICS method with reference channel these steps are necessary for the CSD to be complete Is there a way to add the data with these two extra reference channels? any comments on this would be appreciated Thanking you With regards M.Muthuraman _________________________________________________________________ Palate teasers: Straight from Master Chef Sanjeev Kapoor http://content.msn.co.in/Lifestyle/Moreonlifestyle/LifestylePT_101106_1530.htm From Brian.Roach at YALE.EDU Mon Mar 12 18:56:07 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Mon, 12 Mar 2007 13:56:07 -0400 Subject: sourceanalysis.m on EEG data In-Reply-To: <60A04A24-9EC0-462D-893A-32B5E3F1563A@fcdonders.ru.nl> Message-ID: The prepare_bemmodel calls a function "write_tri" when using the dipoli option. I cannot find this function on the server or in any of my downloaded files. Does anyone have it to share? thanks, Brian At 10:09 AM 2/13/2007, Robert Oostenveld wrote: >The prepare_bemmodel function is in the zip file on the ftp server. >The dipoli executable is attached to this mail. There exists only a >linux i386 and an apple PPC version. You are not permitted to >distribute the dipoli executable, it is not covered under the GPL >license but made available courtesy of Thom Oostendorp. > >best regards, >Robert > >On 12 Feb 2007, at 22:32, Brian Roach wrote: > >>Where can I find these functions listed below? >> >>% the prepare_bemmodel function is available upon request % the >>dipoli stand-alone executable is available upon request > > >********************************************************************** > >This warning has been inserted into this email by the mail system >because this email has an attachment named dipoli.zip > >Specific details: > >Be careful when opening Zip files if you're not sure where they >came from. They can be, and have been, used to transfer viruses >and other destructive programs. > >Attachment of this type have been known to carry viruses or >other programs which could be harmful to your computer. > >We would urge you to be certain that you know who this email >comes from and to save it to disk and check it with an >anti-virus program before using the attachment. If there is any >doubt, DO NOT RUN THE ATTACHMENT. > >If you need help, you can contact your local support provider by following >this link: > http://www.yale.edu/its/supportgroups.html >or contact the ITS Help Desk at 785-3200 or 432-9000. > >Please note that the CONTENTS of the attachment have NOT been >examined in any way, the action taken was entirely based on the >name of the attachment. > >********************************************************************** > > From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 12 19:35:20 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 12 Mar 2007 14:35:20 -0400 Subject: help with reading .fif files in Fieldtrip Message-ID: Hello, I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: Warning: Error reading fif-file! terminate called after throwing an instance of 'MathWorks::System::_utException' I simply adapted the settings for reading a continuous data set from the tutorial: cfg = []; cfg.dataset = 'file.fif'; cfg.hearderfile = 'file.fif'; cfg.datatype = 'continuous'; cfg = definetrial(cfg); I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). Does any one have any idea why Fieldtrip cannot read my .fif files? Many thanks, Matt cfg.channel = {'0111'}; cfg.trialdef.eventtype = 'backpanel trigger'; cfg.trialdef.eventvalue = 3; % trigger for the FIC condition cfg.trialdef.prestim = 1; % time in seconds before trigger cfg.trialdef.poststim = 2; % time in seconds after trigger From sameer at ANDREW.CMU.EDU Mon Mar 12 19:56:08 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 12 Mar 2007 14:56:08 -0400 Subject: help with reading .fif files in Fieldtrip In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB0110353D@medstudent.medschool.nt.pitt.edu> Message-ID: hi Matt, I dont know. Try the fieldtrip discussion list. they are very good at helpinig. you will see I (and others) write them dozens of emails and they reply. sameer On Mon, 12 Mar 2007, Shtrahman, Matthew wrote: > Hello, > > I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: > > Warning: Error reading fif-file! > terminate called after throwing an instance of 'MathWorks::System::_utException' > > I simply adapted the settings for reading a continuous data set from the tutorial: > > cfg = []; > cfg.dataset = 'file.fif'; > cfg.hearderfile = 'file.fif'; > cfg.datatype = 'continuous'; > > cfg = definetrial(cfg); > > > I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). > > Does any one have any idea why Fieldtrip cannot read my .fif files? > > Many thanks, > > Matt > > > cfg.channel = {'0111'}; > cfg.trialdef.eventtype = 'backpanel trigger'; > cfg.trialdef.eventvalue = 3; % trigger for the FIC condition > cfg.trialdef.prestim = 1; % time in seconds before trigger > cfg.trialdef.poststim = 2; % time in seconds after trigger > > From sameer at ANDREW.CMU.EDU Mon Mar 12 20:03:51 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 12 Mar 2007 15:03:51 -0400 Subject: help with reading .fif files in Fieldtrip In-Reply-To: Message-ID: Sorry everybody for this and the earlier email which was sent to the list becasue I failed to notice that the email was to the discussion list. however, I'll use this mix up on my part to reiterte my statement about "very good at helping". I do appreciate it. sameer On Mon, 12 Mar 2007, Sameer Walawalkar wrote: > hi Matt, I dont know. Try the fieldtrip discussion list. they are very good > at helpinig. you will see I (and others) write them dozens of emails and they > reply. > > sameer > > On Mon, 12 Mar 2007, Shtrahman, Matthew wrote: > >> Hello, >> >> I am new to Fieldtrip and I am having difficulty getting the fieldtrip >> function DEFINETRIAL to read continuous .fif (Neuromag) files. I have >> installed the MEG-PD toolbox in my matlab path and regularly use it in my >> own code to read the same .fif files with no errors. I also have tried >> copying the toolbox files to the fieldtrip/private directory. Regardless of >> what I do when I use DEFINETRIAL Matlab crashes and I get the following >> error: >> >> Warning: Error reading fif-file! >> terminate called after throwing an instance of >> 'MathWorks::System::_utException' >> >> I simply adapted the settings for reading a continuous data set from the >> tutorial: >> >> cfg = []; >> cfg.dataset = 'file.fif'; >> cfg.hearderfile = 'file.fif'; >> cfg.datatype = 'continuous'; >> >> cfg = definetrial(cfg); >> >> >> I don't know if it makes a difference, but I have also tried specifying the >> entire path for the file, working as root, and including various >> configurations for definetrial included in the tutorial (see end of email). >> >> Does any one have any idea why Fieldtrip cannot read my .fif files? >> >> Many thanks, >> >> Matt >> >> >> cfg.channel = {'0111'}; >> cfg.trialdef.eventtype = 'backpanel trigger'; >> cfg.trialdef.eventvalue = 3; % trigger for the FIC condition >> cfg.trialdef.prestim = 1; % time in seconds before trigger >> cfg.trialdef.poststim = 2; % time in seconds after trigger >> >> > > From lauri at NEURO.HUT.FI Mon Mar 12 21:23:18 2007 From: lauri at NEURO.HUT.FI (Lauri Parkkonen) Date: Mon, 12 Mar 2007 22:23:18 +0200 Subject: help with reading .fif files in Fieldtrip In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB0110353D@medstudent.medschool.nt.pitt.edu> Message-ID: Hi Matthew, Which Matlab version you're using? With a 7.x Matlab and the newest meg-pd (a.k.a FiffAccess) toolbox you should be able to read fif-files without extra configurations, however, the older 6.x Matlabs with the older meg-pd toolbox require setting the LD_ASSUME_KERNEL environment variable before starting Matlab. Using a 7.x Matlab with the older meg-pd package is likely to give the error messages you're quoting in your email. Best regards, Lauri Shtrahman, Matthew wrote: > Hello, > > I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: > > Warning: Error reading fif-file! > terminate called after throwing an instance of 'MathWorks::System::_utException' > > I simply adapted the settings for reading a continuous data set from the tutorial: > > cfg = []; > cfg.dataset = 'file.fif'; > cfg.hearderfile = 'file.fif'; > cfg.datatype = 'continuous'; > > cfg = definetrial(cfg); > > > I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). > > Does any one have any idea why Fieldtrip cannot read my .fif files? > > Many thanks, > > Matt > > > cfg.channel = {'0111'}; > cfg.trialdef.eventtype = 'backpanel trigger'; > cfg.trialdef.eventvalue = 3; % trigger for the FIC condition > cfg.trialdef.prestim = 1; % time in seconds before trigger > cfg.trialdef.poststim = 2; % time in seconds after trigger > From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 12 21:53:25 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 12 Mar 2007 16:53:25 -0400 Subject: help with reading .fif files in Fieldtrip Message-ID: Hi Lauri, Thanks for the email. I am using Matlab 7.3 and FiffAcess 1.2 (release 4), which I believe is the latest version. Any other ideas perhaps? Thanks again, Matt ________________________________ From: FieldTrip discussion list on behalf of Lauri Parkkonen Sent: Mon 3/12/2007 4:23 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] help with reading .fif files in Fieldtrip Hi Matthew, Which Matlab version you're using? With a 7.x Matlab and the newest meg-pd (a.k.a FiffAccess) toolbox you should be able to read fif-files without extra configurations, however, the older 6.x Matlabs with the older meg-pd toolbox require setting the LD_ASSUME_KERNEL environment variable before starting Matlab. Using a 7.x Matlab with the older meg-pd package is likely to give the error messages you're quoting in your email. Best regards, Lauri Shtrahman, Matthew wrote: > Hello, > > I am new to Fieldtrip and I am having difficulty getting the fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) files. I have installed the MEG-PD toolbox in my matlab path and regularly use it in my own code to read the same .fif files with no errors. I also have tried copying the toolbox files to the fieldtrip/private directory. Regardless of what I do when I use DEFINETRIAL Matlab crashes and I get the following error: > > Warning: Error reading fif-file! > terminate called after throwing an instance of 'MathWorks::System::_utException' > > I simply adapted the settings for reading a continuous data set from the tutorial: > > cfg = []; > cfg.dataset = 'file.fif'; > cfg.hearderfile = 'file.fif'; > cfg.datatype = 'continuous'; > > cfg = definetrial(cfg); > > > I don't know if it makes a difference, but I have also tried specifying the entire path for the file, working as root, and including various configurations for definetrial included in the tutorial (see end of email). > > Does any one have any idea why Fieldtrip cannot read my .fif files? > > Many thanks, > > Matt > > > cfg.channel = {'0111'}; > cfg.trialdef.eventtype = 'backpanel trigger'; > cfg.trialdef.eventvalue = 3; % trigger for the FIC condition > cfg.trialdef.prestim = 1; % time in seconds before trigger > cfg.trialdef.poststim = 2; % time in seconds after trigger > From Brian.Roach at YALE.EDU Mon Mar 12 23:12:08 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Mon, 12 Mar 2007 18:12:08 -0400 Subject: write_tri.m file and results from volplot Message-ID: Hi all, I am using this example script: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:create_bem_headmodel_for_eeg To construct a headmodel for EEG source analysis. I have attached the result from a call to: volplot(skin+skull+brain); I am new to this, and wonder how to judge the success of this script in creating a new model. What kinds of things do I want to see in this plot, or the volplot of the skin, skull, or brain, individually? The example script says that it requires a lot of trial and error, so I am assuming that just running that script is not all that is necessary, but I do not know. Related to this, the prepare_bemmodel.m script calls a function "write_tri.m" when using the dipoli option. I need this script and hope someone can send it to me. thanks! Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testSkinSkullBrain.png Type: application/octet-stream Size: 15516 bytes Desc: not available URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 13 09:04:22 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 09:04:22 +0100 Subject: help with reading .fif files in Fieldtrip In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB01103542@medstudent.medschool.nt.pitt.edu> Message-ID: Hi Matthew, In addition to Lauri's remarks about making sure that the MEG-PD and MATLAB you're using are indeed compatible and fully aware of each other, it would be helpful if you could try the following lines of code in Matlab (which uses FieldTrip reading functions) and send us the screen output: % specify filename filename = 'fullpath/name.fif'; % read the header hdr = read_fcdc_header(filename); hdr % get the indices of the STI channels idx = strmatch('STI',hdr.label); % display them and the channel labels on screen as sanity check idx hdr.label(idx) % NOTE: if you know you use only one STI channel and you know which one it is, % e.g., 'STI 001' then you can also do this: % idx = strmatch('STI 001',hdr.label); % extract only the STI channels from the file dat = read_fcdc_data(filename,'chanindx',idx); % although Neuromag data is "continuous" it is actually written in the file in blocks % and reading only part of the data will return a 3-D array rather than a 2-D array % hence the reshape operation in the following [nchans, nsamps, nblocks] = size(dat); if (nblocks>1), dat = reshape(dat, [nchans, nsamps*nblocks]); end; size(dat) % this should be an nchans x ntotalsamples matirx If all of these commands produce sensible output using your fif file, then the problem has to do with the options being passed to DEFINETRIAL (which uses the above lower level functions). But we first need to establish that you have correctly set up MEG-PD, MATLAB and FieldTrip, and that there is not a problem with the data file itself. Regards, Christian On 12 Mar 2007, at 21:53, Shtrahman, Matthew wrote: > Hi Lauri, > > Thanks for the email. I am using Matlab 7.3 and FiffAcess 1.2 > (release 4), which I believe is the latest version. Any other ideas > perhaps? > > Thanks again, > > Matt > > ________________________________ > > From: FieldTrip discussion list on behalf of Lauri Parkkonen > Sent: Mon 3/12/2007 4:23 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] help with reading .fif files in Fieldtrip > > > > Hi Matthew, > > Which Matlab version you're using? With a 7.x Matlab and the newest > meg-pd (a.k.a FiffAccess) toolbox you should be able to read fif-files > without extra configurations, however, the older 6.x Matlabs with the > older meg-pd toolbox require setting the LD_ASSUME_KERNEL environment > variable before starting Matlab. Using a 7.x Matlab with the older > meg-pd package is likely to give the error messages you're quoting in > your email. > > Best regards, > Lauri > > > Shtrahman, Matthew wrote: >> Hello, >> >> I am new to Fieldtrip and I am having difficulty getting the >> fieldtrip function DEFINETRIAL to read continuous .fif (Neuromag) >> files. I have installed the MEG-PD toolbox in my matlab path and >> regularly use it in my own code to read the same .fif files with >> no errors. I also have tried copying the toolbox files to the >> fieldtrip/private directory. Regardless of what I do when I use >> DEFINETRIAL Matlab crashes and I get the following error: >> >> Warning: Error reading fif-file! >> terminate called after throwing an instance of >> 'MathWorks::System::_utException' >> >> I simply adapted the settings for reading a continuous data set >> from the tutorial: >> >> cfg = []; >> cfg.dataset = 'file.fif'; >> cfg.hearderfile = 'file.fif'; >> cfg.datatype = 'continuous'; >> >> cfg = definetrial(cfg); >> >> >> I don't know if it makes a difference, but I have also tried >> specifying the entire path for the file, working as root, and >> including various configurations for definetrial included in the >> tutorial (see end of email). >> >> Does any one have any idea why Fieldtrip cannot read my .fif files? >> >> Many thanks, >> >> Matt >> >> >> cfg.channel = {'0111'}; >> cfg.trialdef.eventtype = 'backpanel trigger'; >> cfg.trialdef.eventvalue = 3; % trigger for the FIC condition >> cfg.trialdef.prestim = 1; % time in seconds before trigger >> cfg.trialdef.poststim = 2; % time in seconds after trigger >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 13 09:45:19 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 09:45:19 +0100 Subject: ICA with averaged data In-Reply-To: <45F14EF2.10808@uke.uni-hamburg.de> Message-ID: Hi Niki, I fully concur with Stefan's advice and add a brief (technical) explanation for why doing ICA on time-locked averaged data is unlikely to give you a good separation. One of the most common application of ICA to EEG/MEG data in cognitive neuroscience seems to be to remove (what the users assume/ judge to be) artifact (i.e. non-brain or non-task related brain) activity from the data, and then to proceed with conventional sensor level analysis on the "clean" data. ICA assumes that the underlying source signals (component waveforms) in the data are statistically independent and have non-gaussian marginal distributions. If either of these assumptions are violated, then the sources are not uniquely identifiable w.r.t. the ICA search criteria, meaning that ICA will tend to give "funny" decompositions. Now consider that (time-locked) averaging essentially involves summing your data over trials at each time point, and that the distribution of the sum of several random variables with any distribution (including non-gaussian) approaches a gaussian distribution in the limit. From this it is clear that time-locked averaging tends to make all non-time locked activity in your data (i.e. the stuff you want to remove, and need ICA to identify) appear MORE gaussian and therefore LESS identifiable from an ICA perspective. As a consequence, ICA cannot model the artifact activity sufficiently well to be able to separate it from your brain activity of interest. Thus, if the aim of using ICA is to remove non-time locked artifacts (i.e. asynchronous oscillatory activity or intermittent transients) from your data, then following the reasoning above it is advisable to decompose the raw data (making sure to include examples of the artifact you wish to remove). Then either remove the artifacts and project back to the sensor space to do your averaging, or just do the averaging on the components themselves. Hope this helps, Christian On 9 Mar 2007, at 13:11, Stefan Debener wrote: > Hi Niki, > > It does, in my opinion, not make much sense to average first and > then run ICA, you unlikely obtain a robust decomposition this way > and may not be able to remove the stimulator artefact. ICA needs > quite a few training data to find a decent decomposition, and this > is not provided by ERPs, even though some commercial software > packages may allow you to apply ICA to ERPs/ERFs. Only if (!) all > your data are recorded such that there was no substantial head > movement (that is, the position between sensors and sources did not > change), you may get a decent artefact IC (or several ICs) from > combined data (there is a few more ifs involved, please see > previous ICA discussions here and in the EEGLAB mailing list). YI'd > suggest using the pca option and decomposse, say, about 50 > components, to start with, and then try to optimize the result by > playing with the pca option and by running ICAs for separate > recording blocks. > Best, > Stefan > > Niki Ray wrote: >> Hi, >> I'm very new to fieldtrip. I have three questions. I have >> collected MEG >> data from patients with a deep brain stimulator implanted. I'd >> like to do an >> ICA to reject the stimulator related artifacts. Sometimes the >> stimulator is >> on and sometimes off. So my first question is, do i combine all >> the data >> together and then perform the ICA, or do i do different ICA >> analyses for >> each condition(on and off stimulation), and hence reject different >> components for each condition? >> One possibility for deciding wich of the artifacts were related >> to the >> stimulator was to use the example matlab script you provide for >> rejecting >> ECG components. Some of the channels (about 13, i'm using a ctf >> 275 system) >> have a lot of very distinct artifact that is obviously from the >> stimulator, >> so i wanted to use one of these channels as the "ECG" channel. Is >> this >> sensible, or not?? >> Finally, I've been getting conflicting advice about whether it >> is okay to >> first average data, and then perform an ICA. What do you suggest >> is the >> right thing to do? >> >> Many thanks! >> Niki >> >> >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 13 12:59:43 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 12:59:43 +0100 Subject: No subject In-Reply-To: <45EEB4A5.9090406@cs.ru.nl> Message-ID: Hi Paul, I have just tested the following FieldTrip functions READ_FCDC_HEADER READ_FCDC_DATA READ_FCDC_EVENT using a test BDF file and I got no errors. This leads me to suspect that there is either something different about your BDF file, or that you are calling these functions in a "non-recommended" way. In order to help you figure out what is going in, can you please give me more detailed information about what is in your file (especially w.r.t. triggers and events), and also send me the segment of code (cut & paste into email is fine) where you call the functions, i.e. what are the cfg fields you are using, or rather what it the content of varargin, exactly. Thanks, Christian On 7 Mar 2007, at 13:48, P.vandenHurk wrote: > Hello Christian, > > I am sorry, but of course. It is a .bdf file. > > The read_fcdc_header function does work by the way. > > Regards, > Paul > > Christian Hesse schreef: >> Hi Paul, >> >> in order to be able to help you, can you please specify which type >> of data format you are trying to read events from? >> >>> Hello, >>> >>> Each time I use the 'read_fcdc_event' function, I get the >>> following error: >>> >>> ??? Error using ==> read_event >>> type field not defined for each event >>> >>> Error in ==> read_fcdc_event at 51 >>> [event] = read_event(varargin{:}); >>> >>> Can you tell me how I can fix this error? >> >> We'll fix the error if there is one, we give you advice on how to >> avoid them :-) >> >> Regards, >> Christian >> >> --------------------------------------------------------------------- >> - >> Christian Hesse, PhD, MIEEE >> >> F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 >> NL-6500 HB Nijmegen The Netherlands >> >> Tel.: +31 (0)24 36 68293 >> Fax: +31 (0)24 36 10989 >> >> Email: c.hesse at fcdonders.ru.nl >> Web: www.fcdonders.ru.nl >> --------------------------------------------------------------------- >> - >> >> >> >> > > -- > > ----------------------------------------------------------- > Paul van den Hurk > > Joint Principal Investigator > Mindfulness Project > Inserm U280, Lyon, France, > > Radboud University Nijmegen: > Department of computer sciences and > Department of Medical Physics and Biophysics/126 > Geert Grooteplein 21 6525 EZ Nijmegen > > Email: P.vandenHurk at cs.ru.nl > > Tel: 024-3613326 > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From juan.vidal at FCDONDERS.RU.NL Tue Mar 13 15:15:39 2007 From: juan.vidal at FCDONDERS.RU.NL (Juan R. Vidal) Date: Tue, 13 Mar 2007 15:15:39 +0100 Subject: heart artifacts with planar transformed data Message-ID: Hi everybody, i have a general question. Is it possible to find heart artifacts in planar transformed MEG data? I had a discussion with a collegue about it but we did not get at any conclusion. I did some ICA on these MEG data and found 2-3 components that had a veery broad scalp distribution, heart like. Thanks for sharing any experience or knowledge about it. Best, Juan -- Juan R. Vidal, PhD Neuronal Coherence Group F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen Kapittelweg 29 6525 EN Nijmegen The Netherlands Phone: (+31) (0)24 36 10880 Fax: (+31) (0)24 36 10989 e-mail: juan.vidal at fcdonders.ru.nl website: www.ru.nl/fcdonders/ From sameer at ANDREW.CMU.EDU Tue Mar 13 15:27:56 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 13 Mar 2007 10:27:56 -0400 Subject: MNI aligned grids, mris and segmentation Message-ID: Hi, I want to start DICS analysis of my MEG data. For this I need to have MRI and MEG data coregistered. I also need multisphere forward models for which segmentation is necessary. Am I correct in understanding that the following webpage contains info about segmentation? (in addition to MNI aligning all grids) From (http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) Here, in the very beginning, SUBJ = {'subj1','subj2','subj3'}; PREINMRI = '~/mri/'; PREOUT = '~/grids/'; TEMPL = 'mni_standards/t1_icbm_normal_1mm_pn0_rf0.mnc'; RES = 1; % grid resolution [cm] OUTWARDSHIFT = 1.5; % outwardshift for inside/outside detection [cm] % segment the template brain and construct volume templmri = read_fcdc_mri(sprintf('%s%s',PREINMRI,TEMPL)); clear cfg; cfg.coordinates = 'spm'; seg = volumesegment(cfg,templmri); vol = prepare_singleshell([],seg); I understand that in the commands above, first we are creating a template mri to which all other grids will later be aligned. What exactly is t1_icbm_normal_1mm_pn0_rf0.mnc ? Is it a slice from an mri image. Can I give the path to my dicom mri images directory and the name of a file ending in .dcm? Incidently >> mri = read_fcdc_mri('Z:\KarmaCond\BIRC_images_foolaround\070207134421\2\02-0001-000001.dcm'); ??? Undefined function or variable "hdr". Error in ==> read_fcdc_mri at 179 [z, indx] = sort(cell2mat({hdr.SliceLocation})); Thanks you very much. sameer From c.hesse at FCDONDERS.RU.NL Tue Mar 13 15:54:31 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 13 Mar 2007 15:54:31 +0100 Subject: heart artifacts with planar transformed data In-Reply-To: <45F6B20B.4090809@fcdonders.ru.nl> Message-ID: Hi Juan, are you doing this ICA on concatenated single trials of MEG data that has been put back together with COMBINEPLANAR? And is this time- domain or frequency domain data (output 'pow')? Cheers, Christian On 13 Mar 2007, at 15:15, Juan R. Vidal wrote: > Hi everybody, > > i have a general question. Is it possible to find heart > artifacts in planar transformed MEG data? I had a discussion with a > collegue about it but we did not get at any conclusion. I did some > ICA on these MEG data and found 2-3 components that had a veery > broad scalp distribution, heart like. Thanks for sharing any > experience or knowledge about it. > > Best, > > Juan > > -- > Juan R. Vidal, PhD > Neuronal Coherence Group > F.C. Donders Centre for Cognitive Neuroimaging > Radboud University Nijmegen > > Kapittelweg 29 > 6525 EN Nijmegen > The Netherlands > > Phone: (+31) (0)24 36 10880 > Fax: (+31) (0)24 36 10989 > e-mail: juan.vidal at fcdonders.ru.nl > website: www.ru.nl/fcdonders/ > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ychen at BME.UFL.EDU Tue Mar 13 20:49:24 2007 From: ychen at BME.UFL.EDU (Y Chen) Date: Tue, 13 Mar 2007 20:49:24 +0100 Subject: Problem with BESA coordinate system Message-ID: Hi Robert, Thanks for your kind reply. However when I check the createlayout.m function, it turns out that in line 229, the coordinate has been rotated 90 degree (multiply [0 1; -1 0]). For my electrode file, when I remove this coordinate transformation, I get the right layout. Chen From r.oostenveld at FCDONDERS.RU.NL Wed Mar 14 10:18:18 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 14 Mar 2007 10:18:18 +0100 Subject: sourceanalysis.m on EEG data In-Reply-To: <6.1.2.0.2.20070312135517.01cdada0@email.med.yale.edu> Message-ID: On 12 Mar 2007, at 18:56, Brian Roach wrote: > The prepare_bemmodel calls a function "write_tri" when using the > dipoli option. I cannot find this function on the server or in any > of my downloaded files. Does anyone have it to share? please find it attached. Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: write_tri.m Type: application/octet-stream Size: 651 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Wed Mar 14 10:43:54 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 14 Mar 2007 10:43:54 +0100 Subject: Problem with BESA coordinate system In-Reply-To: Message-ID: Dear Chen, I have just made some changes to the layout parts of the code. If you download the latest FT zip file from our FTP server you can see the changes. I replaced the private/createlayout function by a new main function PREPARE_LAYOUT. I also updated the LAYOUTPLOT function (actually I forgot in my previous mail to mention the existence of that function). The specification of the 2D positions for topo and multiplotting can now be done more explicitely, and is documented in prepare_layout. Also the conversion from 3D to 2D locations is also more easily to recognize. The layoutplot function is there to help in the debugging. What now happens is that in the case of specifying cfg.gradfile or cfg.grad, it will rotate by default with 90 deg. When specifying cfg.elecfile or cfg.elec, it will NOT rotate. When specifying cfg.layout, it will just read the *.lay file, or it will read it as matlab *.mat file without further manipulation, or it will read it as electrode file and in that case not rotate it. It now would be easy to explicitely add an cfg.rotate option to the prepare_layout implementation, but I think that the current version should already solve your problem. best regards, Robert On 13 Mar 2007, at 20:49, Y Chen wrote: > Hi Robert, > > Thanks for your kind reply. However when I check the createlayout.m > function, it turns out that in line 229, the coordinate has been > rotated > 90 degree (multiply [0 1; -1 0]). For my electrode file, when I remove > this coordinate transformation, I get the right layout. > > Chen From gmcauley at LLU.EDU Wed Mar 14 20:32:51 2007 From: gmcauley at LLU.EDU (McAuley, Grant (LLU)) Date: Wed, 14 Mar 2007 12:32:51 -0700 Subject: Error in FREQANALYSIS Message-ID: I am seeing an error in FREQANALYSIS (see output below). It seems centered around the 'cfg.tapper' field. I have tried 'dpss', 'hanning' (output below), and 'sine' (which gives an Out of Memory Error). (Not sure where to find info on WINDOW). My data is in a structure as described here: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:frequently_asked_questions (How can I import my own dataformat?) Relevant MATLAB output is below. Pardon me if I am missing something obvious - this is new territory for me. Any ideas on what might be the problem? % my data structure with example values >> hv1_69 hv1_69 = label: {2x1 cell} fsample: 200 trial: {[2x48528 double]} time: {[1x48529 double]} >> hv1_69.trial{1}(1,1:5) ans = 4.9460 4.2540 1.9510 0.0820 0.6380 >> hv1_69.time{1}(1,1:5) ans = 0 0.0050 0.0100 0.0150 0.0200 % here are cfg values >> cfg cfg = output: 'pow' method: 'mtmfft' tapsmofrq: 4 pad: 'maxperlen' taper: 'dpss' foilim: [0 100] >> [freq] = freqanalysis(cfg, hv1_69); ??? Undefined function or method 'dpss' for input arguments of type 'double'. Error in ==> freqanalysis_mtmfft>double_dpss at 560 tap = dpss(double(a), double(b), varargin{:}); Error in ==> freqanalysis_mtmfft at 387 tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; Error in ==> freqanalysis at 193 [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), cfg, data); % try different 'cfg.taper' value >> cfg.taper = 'hanning'; >> [freq] = freqanalysis(cfg, hv1_69); ??? Undefined function or method 'window' for input arguments of type 'char'. Error in ==> freqanalysis_mtmfft at 393 tap = window(cfg.taper, numdatbns)'; Error in ==> freqanalysis at 193 [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), cfg, data); %MATLAB version >> version ans = 7.3.0.267 (R2006b) From gmcauley at LLU.EDU Wed Mar 14 20:37:18 2007 From: gmcauley at LLU.EDU (McAuley, Grant (LLU)) Date: Wed, 14 Mar 2007 12:37:18 -0700 Subject: Spectral Medium, Edge and Dominant Frequency Functions Message-ID: Pardon me if I missed it, but are there functions in FT for computing Spectral Edge, Medium and Dominant Frequency for a data trial? If not, perhaps someone knows of an implementation of such algorithms somewhere else? From c.hesse at FCDONDERS.RU.NL Wed Mar 14 22:12:45 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 14 Mar 2007 22:12:45 +0100 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Hi Grant, Ahhh ... you're trying to do all of this without the signal processing toolbox, aren't you. In that case I must apologize for having given you slightly inaccurate info before: the DPSS and WINDOW functions are from the signal processing toolbox. Having just had a play with FREQANALYSIS it turns out that in it's current version a taper must be specified (e.g., cfg.taper = 'none') gives an error. This means that you apparently cannot use FieldTrip (in its current form) to do simple, "no-frills" spectral estimation. I will have a closer look to see if we can change it so allow cfg.taper = 'none', since this means that you could apply your own taper to your data before using FREQANALYSIS or just leave it out. Realistically speaking though, it seems to me that your best options are basically a) to get the signal processing toolbox, or b) to just write your own matlab functions to estimate your power spectra (about 3 lines of code) and then calculate your SEF and MF measures (another few lines at most). Cheers, Christian > I am seeing an error in FREQANALYSIS (see output below). It seems > centered around the 'cfg.tapper' field. I have tried 'dpss', > 'hanning' (output below), and 'sine' (which gives an Out of Memory > Error). (Not sure where to find info on WINDOW). > > > My data is in a structure as described here: > http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:frequently_asked_questions > (How can I import my own dataformat?) > > > Relevant MATLAB output is below. > > > Pardon me if I am missing something obvious - this is new territory > for me. Any ideas on what might be the problem? > > > > > % my data structure with example values >>> hv1_69 > > hv1_69 = > > label: {2x1 cell} > fsample: 200 > trial: {[2x48528 double]} > time: {[1x48529 double]} > > >>> hv1_69.trial{1}(1,1:5) > > ans = > > 4.9460 4.2540 1.9510 0.0820 0.6380 > >>> hv1_69.time{1}(1,1:5) > > ans = > > 0 0.0050 0.0100 0.0150 0.0200 > > % here are cfg values >>> cfg > > cfg = > > output: 'pow' > method: 'mtmfft' > tapsmofrq: 4 > pad: 'maxperlen' > taper: 'dpss' > foilim: [0 100] > > >>> [freq] = freqanalysis(cfg, hv1_69); > ??? Undefined function or method 'dpss' for input arguments of type > 'double'. > > Error in ==> freqanalysis_mtmfft>double_dpss at 560 > tap = dpss(double(a), double(b), varargin{:}); > > Error in ==> freqanalysis_mtmfft at 387 > tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./ > data.fsample))'; > > Error in ==> freqanalysis at 193 > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > cfg, data); > > > > % try different 'cfg.taper' value >>> cfg.taper = 'hanning'; >>> [freq] = freqanalysis(cfg, hv1_69); > ??? Undefined function or method 'window' for input arguments of > type 'char'. > > Error in ==> freqanalysis_mtmfft at 393 > tap = window(cfg.taper, numdatbns)'; > > Error in ==> freqanalysis at 193 > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > cfg, data); > > > %MATLAB version >>> version > > ans = > > 7.3.0.267 (R2006b) > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Wed Mar 14 22:39:08 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 14 Mar 2007 22:39:08 +0100 Subject: Spectral Medium, Edge and Dominant Frequency Functions In-Reply-To: Message-ID: Hi Grant, > Pardon me if I missed it, but are there functions in FT for > computing Spectral Edge, Medium and Dominant Frequency for a data > trial? > > If not, perhaps someone knows of an implementation of such > algorithms somewhere else? As far as I am aware, there are no direct functions in Fieldtrip for extracting these measures from power spectra (since this sort of approach to spectral analysis is a tad more reductionist that is useful for most FT purposes). There is also nothing in the Signal Processing Toolbox, since this has mainly to do with spectral estimation as such, filter design, prediction, etc ... However, computing these measures is quite straightforward in matlab assuming you have the power spectum of the data (The matlab help for FFT tells you how to compute the power spectrum in a few simple lines, which you can turn into your own function). The following is only pseudo/outline code for a little function to get median, spectral edge and dominant frequencies: function [mf, sef, df] = specstats(freq, pyy) % your frequency axis is freq (a vector) % your power spectrum is pyy (a vector) % normalize spectrum to get a density pyy_norm = pyy./sum(pyy); % compute cumulative density pyy_cum = cumsum(pyy_norm); % median frequency corresponds to the frequency at (nearest to) % the point on the freq axis where pyy_cum = 0.5 [val, idx] = min(abs(pyy_cum-0.5)); mf = freq(idx); % spectral edge frequency corresponds to the frequency at (nearest to) % the point on the freq axis where pyy_cum = 0.05 [val, idx] = min(abs(pyy_cum-0.05)); sef = freq(idx); % you can extend this code for dominant frequency accordingly ... if all you mean % is the peak frequency then you have [val, idx] = max(pyy); df = freq(idx); Depending on how sophisticated you want to get you can apply a bit of interpolation to pyy as well, but that is probably overkill. I hope that helps Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Mar 15 13:53:46 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 15 Mar 2007 13:53:46 +0100 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Hi Grant On 14 Mar 2007, at 22:12, Christian Hesse wrote: > Ahhh ... you're trying to do all of this without the signal > processing toolbox, aren't you. In that case I must apologize for > having given you slightly inaccurate info before: the DPSS and > WINDOW functions are from the signal processing toolbox. > > ... > Realistically speaking though, it seems to me that your best > options are basically a) to get the signal processing toolbox, or > b) to just write your own matlab functions to estimate your power > spectra (about 3 lines of code) and then calculate your SEF and MF > measures (another few lines at most). with respect to option "b": I think the easiest is to replicate the WINDOW function from the signal preocessing toolbox. The dpss is difficult, but hanning, triangle, rectwin and some others are trivial. The WINDOW function is just a convenient wrapper function for various tapers. See at the bottom of this mail for the full help. The window replacement function to be written should behave as >> tap = window('hanning', 10) tap = 0.0794 0.2923 0.5712 0.8274 0.9797 0.9797 0.8274 0.5712 0.2923 0.0794 >> tap = window('rectwin', 10) tap = 1 1 1 1 1 1 1 1 1 1 >> tap = window('triang', 10) tap = 0.1000 0.3000 0.5000 0.7000 0.9000 0.9000 0.7000 0.5000 0.3000 0.1000 I hope that this suggestion helps, Robert --------------- >> help window WINDOW Window function gateway. WINDOW(@WNAME,N) returns an N-point window of type specified by the function handle @WNAME in a column vector. @WNAME can be any valid window function name, for example: @bartlett - Bartlett window. @barthannwin - Modified Bartlett-Hanning window. @blackman - Blackman window. @blackmanharris - Minimum 4-term Blackman-Harris window. @bohmanwin - Bohman window. @chebwin - Chebyshev window. @flattopwin - Flat Top window. @gausswin - Gaussian window. @hamming - Hamming window. @hann - Hann window. @kaiser - Kaiser window. @nuttallwin - Nuttall defined minimum 4-term Blackman-Harris window. @parzenwin - Parzen (de la Valle-Poussin) window. @rectwin - Rectangular window. @tukeywin - Tukey window. @triang - Triangular window. WINDOW(@WNAME,N,OPT) designs the window with the optional input argument specified in OPT. To see what the optional input arguments are, see the help for the individual windows, for example, KAISER or CHEBWIN. WINDOW launches the Window Design & Analysis Tool (WinTool). EXAMPLE: N = 65; w = window(@blackmanharris,N); w1 = window(@hamming,N); w2 = window(@gausswin,N,2.5); plot(1:N,[w,w1,w2]); axis([1 N 0 1]); legend('Blackman-Harris','Hamming','Gaussian'); See also bartlett, barthannwin, blackman, blackmanharris, bohmanwin, chebwin, gausswin, hamming, hann, kaiser, nuttallwin, parzenwin, rectwin, triang, tukeywin, WINTOOL. From Brian.Roach at YALE.EDU Wed Mar 14 23:25:06 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Wed, 14 Mar 2007 18:25:06 -0400 Subject: results of prepare_bemmodel Message-ID: FT users, after running vol = prepare_bemmodel(cfg, mri) where cfg = tissue: [1 2 3] numvertices: [1000 2000 3000] conductivity: [1 0.0125 1] isolatedsource: 3 method: 'dipoli' dipoli: '/home/bjr39/FTsource/dipoli' and mri = dim: [181 217 181] xgrid: [1x181 double] ygrid: [1x217 double] zgrid: [1x181 double] anatomy: [181x217x181 double] transform: [4x4 double] hdr: [1x1 struct] seg: [181x217x181 double] I am trying to make figures of the surfaces with triplot.m: >> triplot(vol.bnd(1).pnt, vol.bnd(1).tri, 'faces_skin'); rotate3d ??? Subscript indices must either be real positive integers or logicals. Error in ==> triplot at 38 h = plot(x(d), y(d),c,varargin{start:end}); -------------------------------------------------------------------------- I must have done something wrong along the way, but I am not sure what. Any ideas? thanks, Brian From t.schneider at UKE.UNI-HAMBURG.DE Thu Mar 15 15:45:35 2007 From: t.schneider at UKE.UNI-HAMBURG.DE (Till Schneider) Date: Thu, 15 Mar 2007 15:45:35 +0100 Subject: results of prepare_bemmodel In-Reply-To: <6.1.2.0.2.20070314181408.02df3d70@email.med.yale.edu> Message-ID: Dear Brian, there are actually two triplot functions: one in the fieldtrip private directory and one 'official' matlab function. You should use the fieldtrip function, for the line of code below. It should work then. Regards, Till Brian Roach schrieb: > FT users, > > after running vol = prepare_bemmodel(cfg, mri) > > where cfg = > > tissue: [1 2 3] > numvertices: [1000 2000 3000] > conductivity: [1 0.0125 1] > isolatedsource: 3 > method: 'dipoli' > dipoli: '/home/bjr39/FTsource/dipoli' > > and mri = > > dim: [181 217 181] > xgrid: [1x181 double] > ygrid: [1x217 double] > zgrid: [1x181 double] > anatomy: [181x217x181 double] > transform: [4x4 double] > hdr: [1x1 struct] > seg: [181x217x181 double] > > > I am trying to make figures of the surfaces with triplot.m: > > >> triplot(vol.bnd(1).pnt, vol.bnd(1).tri, 'faces_skin'); rotate3d > ??? Subscript indices must either be real positive integers or logicals. > > Error in ==> triplot at 38 > h = plot(x(d), y(d),c,varargin{start:end}); > -------------------------------------------------------------------------- > > I must have done something wrong along the way, but I am not sure > what. Any ideas? > > thanks, > Brian > > -- Pflichtangaben gemäß Gesetz über elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universitätsklinikum Hamburg-Eppendorf Körperschaft des öffentlichen Rechts Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Jörg F. Debatin (Vorsitzender) Dr. Alexander Kirstein Ricarda Klein Prof. Dr. Rolf A.K. Stahl From Brian.Roach at YALE.EDU Thu Mar 15 16:00:25 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 15 Mar 2007 11:00:25 -0400 Subject: results of prepare_bemmodel In-Reply-To: <45F95C0F.1020408@uke.uni-hamburg.de> Message-ID: That did it - thanks!!! At 10:45 AM 3/15/2007, you wrote: >Dear Brian, > >there are actually two triplot functions: one in the fieldtrip private >directory and one 'official' matlab function. >You should use the fieldtrip function, for the line of code below. It >should work then. > >Regards, >Till > > >Brian Roach schrieb: >>FT users, >> >>after running vol = prepare_bemmodel(cfg, mri) >> >>where cfg = >> >> tissue: [1 2 3] >> numvertices: [1000 2000 3000] >> conductivity: [1 0.0125 1] >> isolatedsource: 3 >> method: 'dipoli' >> dipoli: '/home/bjr39/FTsource/dipoli' >> >>and mri = >> >> dim: [181 217 181] >> xgrid: [1x181 double] >> ygrid: [1x217 double] >> zgrid: [1x181 double] >> anatomy: [181x217x181 double] >> transform: [4x4 double] >> hdr: [1x1 struct] >> seg: [181x217x181 double] >> >> >>I am trying to make figures of the surfaces with triplot.m: >> >> >> triplot(vol.bnd(1).pnt, vol.bnd(1).tri, 'faces_skin'); rotate3d >>??? Subscript indices must either be real positive integers or logicals. >> >>Error in ==> triplot at 38 >>h = plot(x(d), y(d),c,varargin{start:end}); >>-------------------------------------------------------------------------- >>I must have done something wrong along the way, but I am not sure what. >>Any ideas? >> >>thanks, >>Brian >> > > > >-- > >Pflichtangaben gemäß Gesetz über elektronische Handelsregister und >Genossenschaftsregister sowie das Unternehmensregister (EHUG): > >Universitätsklinikum Hamburg-Eppendorf >Körperschaft des öffentlichen Rechts >Gerichtsstand: Hamburg > >Vorstandsmitglieder: >Prof. Dr. Jörg F. Debatin (Vorsitzender) >Dr. Alexander Kirstein >Ricarda Klein >Prof. Dr. Rolf A.K. Stahl >ca From gmcauley at LLU.EDU Fri Mar 16 17:30:51 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Fri, 16 Mar 2007 09:30:51 -0700 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Thanks Christian, I will go with option b. ~ Grant On Wed, 2007-03-14 at 22:12 +0100, Christian Hesse wrote: > Hi Grant, > > > Ahhh ... you're trying to do all of this without the signal processing > toolbox, aren't you. In that case I must apologize for having given > you slightly inaccurate info before: the DPSS and WINDOW functions are > from the signal processing toolbox. > > > Having just had a play with FREQANALYSIS it turns out that in it's > current version a taper must be specified (e.g., cfg.taper = 'none') > gives an error. This means that you apparently cannot use FieldTrip > (in its current form) to do simple, "no-frills" spectral estimation. I > will have a closer look to see if we can change it so allow cfg.taper > = 'none', since this means that you could apply your own taper to your > data before using FREQANALYSIS or just leave it out. > > > Realistically speaking though, it seems to me that your best options > are basically a) to get the signal processing toolbox, or b) to just > write your own matlab functions to estimate your power spectra (about > 3 lines of code) and then calculate your SEF and MF measures (another > few lines at most). > > > Cheers, > Christian > > > > > > > > I am seeing an error in FREQANALYSIS (see output below). It seems > > centered around the 'cfg.tapper' field. I have tried 'dpss', > > 'hanning' (output below), and 'sine' (which gives an Out of Memory > > Error). (Not sure where to find info on WINDOW). > > > > > > > > > > My data is in a structure as described here: > > http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:frequently_asked_questions > > (How can I import my own dataformat?) > > > > > > > > > > Relevant MATLAB output is below. > > > > > > > > > > Pardon me if I am missing something obvious - this is new territory > > for me. Any ideas on what might be the problem? > > > > > > > > > > > > > > > > > > % my data structure with example values > > > > hv1_69 > > > > > > hv1_69 = > > > > > > label: {2x1 cell} > > fsample: 200 > > trial: {[2x48528 double]} > > time: {[1x48529 double]} > > > > > > > > > > > > hv1_69.trial{1}(1,1:5) > > > > > > ans = > > > > > > 4.9460 4.2540 1.9510 0.0820 0.6380 > > > > > > > > hv1_69.time{1}(1,1:5) > > > > > > ans = > > > > > > 0 0.0050 0.0100 0.0150 0.0200 > > > > > > % here are cfg values > > > > cfg > > > > > > cfg = > > > > > > output: 'pow' > > method: 'mtmfft' > > tapsmofrq: 4 > > pad: 'maxperlen' > > taper: 'dpss' > > foilim: [0 100] > > > > > > > > > > > > [freq] = freqanalysis(cfg, hv1_69); > > ??? Undefined function or method 'dpss' for input arguments of type > > 'double'. > > > > > > Error in ==> freqanalysis_mtmfft>double_dpss at 560 > > tap = dpss(double(a), double(b), varargin{:}); > > > > > > Error in ==> freqanalysis_mtmfft at 387 > > tap = > > double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; > > > > > > Error in ==> freqanalysis at 193 > > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > > cfg, data); > > > > > > > > > > > > > > % try different 'cfg.taper' value > > > > cfg.taper = 'hanning'; > > > > [freq] = freqanalysis(cfg, hv1_69); > > ??? Undefined function or method 'window' for input arguments of > > type 'char'. > > > > > > Error in ==> freqanalysis_mtmfft at 393 > > tap = window(cfg.taper, numdatbns)'; > > > > > > Error in ==> freqanalysis at 193 > > [freq] = feval(sprintf('freqanalysis_ü·¢xÞ',lower(cfg.method)), > > cfg, data); > > > > > > > > > > %MATLAB version > > > > version > > > > > > ans = > > > > > > 7.3.0.267 (R2006b) > > > > > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From gmcauley at LLU.EDU Fri Mar 16 17:46:09 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Fri, 16 Mar 2007 09:46:09 -0700 Subject: Spectral Medium, Edge and Dominant Frequency Functions In-Reply-To: Message-ID: Thanks Christian, This is very helpful. I did not know about the 'cumsum' function - it makes this almost trivial. ~ Grant On Wed, 2007-03-14 at 22:39 +0100, Christian Hesse wrote: > Hi Grant, > > > > Pardon me if I missed it, but are there functions in FT for > > computing Spectral Edge, Medium and Dominant Frequency for a data > > trial? > > > > > > If not, perhaps someone knows of an implementation of such > > algorithms somewhere else? > > > As far as I am aware, there are no direct functions in Fieldtrip for > extracting these measures from power spectra (since this sort of > approach to spectral analysis is a tad more reductionist that is > useful for most FT purposes). There is also nothing in the Signal > Processing Toolbox, since this has mainly to do with spectral > estimation as such, filter design, prediction, etc ... > > > However, computing these measures is quite straightforward in matlab > assuming you have the power spectum of the data (The matlab help for > FFT tells you how to compute the power spectrum in a few simple lines, > which you can turn into your own function). The following is only > pseudo/outline code for a little function to get median, spectral edge > and dominant frequencies: > > > > > function [mf, sef, df] = specstats(freq, pyy) > % your frequency axis is freq (a vector) > % your power spectrum is pyy (a vector) > > > % normalize spectrum to get a density > pyy_norm = pyy./sum(pyy); > > > % compute cumulative density > pyy_cum = cumsum(pyy_norm); > > > % median frequency corresponds to the frequency at (nearest to) > % the point on the freq axis where pyy_cum = 0.5 > [val, idx] = min(abs(pyy_cum-0.5)); > mf = freq(idx); > > > % spectral edge frequency corresponds to the frequency at (nearest to) > % the point on the freq axis where pyy_cum = 0.05 > [val, idx] = min(abs(pyy_cum-0.05)); > sef = freq(idx); > > > % you can extend this code for dominant frequency accordingly ... if > all you mean > % is the peak frequency then you have > [val, idx] = max(pyy); > df = freq(idx); > > > > > Depending on how sophisticated you want to get you can apply a bit of > interpolation to pyy as well, but that is probably overkill. > > > > > I hope that helps > Christian > > > > ---------------------------------------------------------------------- > Christian Hesse, PhD, MIEEE > > > F.C. Donders Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > > Tel.: +31 (0)24 36 68293 > Fax: +31 (0)24 36 10989 > > > Email: c.hesse at fcdonders.ru.nl > Web: www.fcdonders.ru.nl > ---------------------------------------------------------------------- > > > > > > > > -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From gmcauley at LLU.EDU Fri Mar 16 17:50:52 2007 From: gmcauley at LLU.EDU (Grant McAuley) Date: Fri, 16 Mar 2007 09:50:52 -0700 Subject: Error in FREQANALYSIS In-Reply-To: Message-ID: Thanks Robert, I have decided to go with option b). The 'WINDOW' information is enlightening and very helpful. ~ Grant On Thu, 2007-03-15 at 13:53 +0100, Robert Oostenveld wrote: > Hi Grant > > On 14 Mar 2007, at 22:12, Christian Hesse wrote: > > Ahhh ... you're trying to do all of this without the signal > > processing toolbox, aren't you. In that case I must apologize for > > having given you slightly inaccurate info before: the DPSS and > > WINDOW functions are from the signal processing toolbox. > > > > ... > > Realistically speaking though, it seems to me that your best > > options are basically a) to get the signal processing toolbox, or > > b) to just write your own matlab functions to estimate your power > > spectra (about 3 lines of code) and then calculate your SEF and MF > > measures (another few lines at most). > > with respect to option "b": I think the easiest is to replicate the > WINDOW function from the signal preocessing toolbox. The dpss is > difficult, but hanning, triangle, rectwin and some others are > trivial. The WINDOW function is just a convenient wrapper function > for various tapers. See at the bottom of this mail for the full help. > The window replacement function to be written should behave as > > >> tap = window('hanning', 10) > tap = > 0.0794 > 0.2923 > 0.5712 > 0.8274 > 0.9797 > 0.9797 > 0.8274 > 0.5712 > 0.2923 > 0.0794 > > >> tap = window('rectwin', 10) > tap = > 1 > 1 > 1 > 1 > 1 > 1 > 1 > 1 > 1 > 1 > > >> tap = window('triang', 10) > tap = > 0.1000 > 0.3000 > 0.5000 > 0.7000 > 0.9000 > 0.9000 > 0.7000 > 0.5000 > 0.3000 > 0.1000 > > I hope that this suggestion helps, > Robert > > > --------------- > > >> help window > WINDOW Window function gateway. > WINDOW(@WNAME,N) returns an N-point window of type specified > by the function handle @WNAME in a column vector. @WNAME can > be any valid window function name, for example: > @bartlett - Bartlett window. > @barthannwin - Modified Bartlett-Hanning window. > @blackman - Blackman window. > @blackmanharris - Minimum 4-term Blackman-Harris window. > @bohmanwin - Bohman window. > @chebwin - Chebyshev window. > @flattopwin - Flat Top window. > @gausswin - Gaussian window. > @hamming - Hamming window. > @hann - Hann window. > @kaiser - Kaiser window. > @nuttallwin - Nuttall defined minimum 4-term Blackman-Harris > window. > @parzenwin - Parzen (de la Valle-Poussin) window. > @rectwin - Rectangular window. > @tukeywin - Tukey window. > @triang - Triangular window. > WINDOW(@WNAME,N,OPT) designs the window with the optional input > argument > specified in OPT. To see what the optional input arguments are, > see the help > for the individual windows, for example, KAISER or CHEBWIN. > WINDOW launches the Window Design & Analysis Tool (WinTool). > EXAMPLE: > N = 65; > w = window(@blackmanharris,N); > w1 = window(@hamming,N); > w2 = window(@gausswin,N,2.5); > plot(1:N,[w,w1,w2]); axis([1 N 0 1]); > legend('Blackman-Harris','Hamming','Gaussian'); > > See also bartlett, barthannwin, blackman, blackmanharris, > bohmanwin, > chebwin, gausswin, hamming, hann, kaiser, nuttallwin, > parzenwin, > rectwin, triang, tukeywin, WINTOOL. -- Grant McAuley Research Affairs IS Support Loma Linda University 909-558-1000 Ext 87750 gmcauley at llu.edu From c.hesse at FCDONDERS.RU.NL Fri Mar 16 17:56:21 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Fri, 16 Mar 2007 17:56:21 +0100 Subject: Spectral Medium, Edge and Dominant Frequency Functions In-Reply-To: <1174063569.11369.63.camel@localhost.localdomain> Message-ID: Hi Grant, glad I was (eventually) able to help you out; good luck and success with option b) ! On 16 Mar 2007, at 17:46, Grant McAuley wrote: > Thanks Christian, > > This is very helpful. I did not know about the 'cumsum' function - it > makes this almost trivial. > > ~ Grant b.t.w. you could have also done it in 2 lines of code without the cumsum function: pyy_cum = pyy_norm; for i=1:length(pyy_cum), if (i>1), pyy_cum(i) = pyy_cum(i) + pyy_cum (i-1); end; end; % or leave out the if statement if you are sure that length(pyy_cum) >=2 ;-) ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Mon Mar 19 00:14:35 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Sun, 18 Mar 2007 16:14:35 -0700 Subject: MultiplotER using Neuromag lay In-Reply-To: Message-ID: Hi, Christian, Sorry I didn't reply this for a long time. Thanks for these suggestions. They work well. And I found after using read_data, the other processing still can work for whole data. However, I met another problem. After I did timelockanalysis, I tried to plot average data using multiplotER. I downloaded the file "NM306mag.lay" and other two you offered. The layoutplot(cfg) shows that the files are correct. However, when I used multiplotER(cfg,avgdata), the figure showed up was blank. Nothing on it even the lables. Could you or other experts tell me the possible way to figure it out? Thanks so much. Best, Eve Christian Hesse wrote: Hi Eve, I can use meg-pd toolbox now. However, it seems all the functions in FieldTrip are for evoked data while my raw data is continuous data. FieldTrip handles a variety of data, and the low level reading functions can deal with continuous or epoch based raw data. When you analyze your data in FT, you usually start by defining your trials, i.e. epochs in your continuous data that are of interest, w.r.t. to some sort of trigger or event. The function PREPROCESSING then scans through your raw data file and returns a data structure which contains all of the specified epochs (for a particular trial definition) in a field data.trial. Please note that this has nothing to do with evoked vs induced responses just yet. You can use the output of PREPROCESSING as input to either TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced phenomena, respectively. Afterwards you can call various statistical functions such as FREQDESCRIPTIVES, etc ... So the reason why I have been giving you the examples using read_header and read_data is because I needed to determine the nature of the error you were getting without really knowning anything about what sort of data is in your file. In your use of FT you do not actually use these functions yourself, but basically use functions like DEFINE_TRIAL and PREPROCESSING to start with. --------------------------------- No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started. -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Mon Mar 19 08:52:40 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Mon, 19 Mar 2007 08:52:40 +0100 Subject: MultiplotER using Neuromag lay In-Reply-To: <448639.81069.qm@web56614.mail.re3.yahoo.com> Message-ID: Hi Eve, > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. Could you email (cut past from matlab) any of the warnings and errors that the call to MULTIPLOTER produced, thanks. It is also possible that this strange behaviour of MULTIPLOTER may have something to do with some minor changes that were recently made to the layout structure used by FT. There is now a function called PREPARE_LAYOUT (download the latest version of FT, and it lives in the fieldtrip directory) which will generate the correct layout structure for you, using the gradiometer information in your data structure. Try using the layout generated by this function for plotting, and please let me know if there are any errors. Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From jgross at UNI-DUESSELDORF.DE Mon Mar 19 10:38:12 2007 From: jgross at UNI-DUESSELDORF.DE (Joachim Gross) Date: Mon, 19 Mar 2007 09:38:12 +0000 Subject: MultiplotER using Neuromag lay In-Reply-To: <448639.81069.qm@web56614.mail.re3.yahoo.com> Message-ID: Hi Eve, I think I had a similar problem. In my case the channel labels in NM306mag.lay did not exactly match the labels in avgdata.label. After changing either set of labels it worked for me. Joachim alotof eve wrote: > Hi, Christian, > > Sorry I didn't reply this for a long time. Thanks for these > suggestions. They work well. And I found after using read_data, the > other processing still can work for whole data. > > However, I met another problem. > > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. > > Could you or other experts tell me the possible way to figure it > out? Thanks so much. > > Best, > Eve > > > */Christian Hesse /* wrote: > > Hi Eve, > >> I can use meg-pd toolbox now. However, it seems all the functions >> in FieldTrip are for evoked data while my raw data is continuous >> data. > > FieldTrip handles a variety of data, and the low level reading > functions can deal with continuous or epoch based raw data. > > When you analyze your data in FT, you usually start by defining > your trials, i.e. epochs in your continuous data that are of > interest, w.r.t. to some sort of trigger or event. The function > PREPROCESSING then scans through your raw data file and returns a > data structure which contains all of the specified epochs (for a > particular trial definition) in a field data.trial. Please note > that this has nothing to do with evoked vs induced responses just yet. > > You can use the output of PREPROCESSING as input to either > TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced > phenomena, respectively. Afterwards you can call various > statistical functions such as FREQDESCRIPTIVES, etc ... > > So the reason why I have been giving you the examples using > read_header and read_data is because I needed to determine the > nature of the error you were getting without really knowning > anything about what sort of data is in your file. In your use of > FT you do not actually use these functions yourself, but basically > use functions like DEFINE_TRIAL and PREPROCESSING to start with. > > ------------------------------------------------------------------------ > No need to miss a message. Get email on-the-go > > with Yahoo! Mail for Mobile. Get started. > From sameer at ANDREW.CMU.EDU Mon Mar 19 14:26:39 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 19 Mar 2007 09:26:39 -0400 Subject: cross spectral density issues Message-ID: Hi, When I do cfgCSD = []; cfgCSD.output = 'powandcsd'; cfgCSD.method = 'mtmfft'; cfgCSD.foilim = [5 100]; cfgCSD.tapsmofrq = 5; cfgCSD.keeptrials = 'yes'; cfgCSD.channel = {'MEG'} ; cfgCSD.channelcmb = {'MEG' 'MEG'}; freqCSD_RR_One = freqanalysis(cfgCSD,dataRR_One); I get the following error. ??? Error using ==> unknown Maximum variable size allowed by the program is exceeded. Error in ==> freqanalysis_mtmfft at 342 if csdflg, crsspctrm = complex(zeros(numper,numsgncmb,numboi)); end Error in ==> freqanalysis at 167 [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); But I remember using something very close to this some ten days ago. So I am not sure what I might be doing wrong. Any suggestions are very welcome. I tried using method 'mtmwelch' but that gave a host of other errors including looking for cfg.foi instead of cfg.foilim (non uniformity in application). best, sameer From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 19 15:27:39 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 19 Mar 2007 10:27:39 -0400 Subject: MultiplotER using Neuromag lay Message-ID: Hi, Can someone give me the link where I can download NM306mag.lay? Thanks, Matt -----Original Message----- From: FieldTrip discussion list on behalf of Joachim Gross Sent: Mon 3/19/2007 5:38 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay Hi Eve, I think I had a similar problem. In my case the channel labels in NM306mag.lay did not exactly match the labels in avgdata.label. After changing either set of labels it worked for me. Joachim alotof eve wrote: > Hi, Christian, > > Sorry I didn't reply this for a long time. Thanks for these > suggestions. They work well. And I found after using read_data, the > other processing still can work for whole data. > > However, I met another problem. > > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. > > Could you or other experts tell me the possible way to figure it > out? Thanks so much. > > Best, > Eve > > > */Christian Hesse /* wrote: > > Hi Eve, > >> I can use meg-pd toolbox now. However, it seems all the functions >> in FieldTrip are for evoked data while my raw data is continuous >> data. > > FieldTrip handles a variety of data, and the low level reading > functions can deal with continuous or epoch based raw data. > > When you analyze your data in FT, you usually start by defining > your trials, i.e. epochs in your continuous data that are of > interest, w.r.t. to some sort of trigger or event. The function > PREPROCESSING then scans through your raw data file and returns a > data structure which contains all of the specified epochs (for a > particular trial definition) in a field data.trial. Please note > that this has nothing to do with evoked vs induced responses just yet. > > You can use the output of PREPROCESSING as input to either > TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced > phenomena, respectively. Afterwards you can call various > statistical functions such as FREQDESCRIPTIVES, etc ... > > So the reason why I have been giving you the examples using > read_header and read_data is because I needed to determine the > nature of the error you were getting without really knowning > anything about what sort of data is in your file. In your use of > FT you do not actually use these functions yourself, but basically > use functions like DEFINE_TRIAL and PREPROCESSING to start with. > > ------------------------------------------------------------------------ > No need to miss a message. Get email on-the-go > > with Yahoo! Mail for Mobile. Get started. > From Daria.Osipova at FCDONDERS.RU.NL Mon Mar 19 15:47:57 2007 From: Daria.Osipova at FCDONDERS.RU.NL (Daria Osipova) Date: Mon, 19 Mar 2007 15:47:57 +0100 Subject: FW: [FIELDTRIP] .lay layout file for neuromag 306 channels Message-ID: Hi Matt Here they are. Best regards, Dasha PS Robert, wouldn't it be a good idea to include these layouts in fieldtrip? _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daria Osipova Sent: Monday, February 19, 2007 4:31 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Attached are 306-channel Neuromag layout files (also for magnetometers and gradiometers separately). Cheers, Dasha _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Christian Hesse Sent: Monday, February 19, 2007 9:19 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Sameer, please have a look at the FT (in fieldtrip/private) function "createlayout.m" (in the fieldtrip/private directory) which should be able to create a layout for your Neuromag306 data on the fly. The function takes a structure containing gradiometer information as input. If you read in your data using "preprocessing.m" then the gradiometer info will be contained in a field called data.grad. Hope this helps, Christian On 16 Feb 2007, at 21:46, Sameer Walawalkar wrote: Hi, As I had written some time ago, I could not find a .lay file which would be useful for neuromag 306 (there is a NM122.lay file there). Is there some way around this? sameer ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- From shtrahman.matthew at MEDSCHOOL.PITT.EDU Mon Mar 19 16:30:42 2007 From: shtrahman.matthew at MEDSCHOOL.PITT.EDU (Shtrahman, Matthew) Date: Mon, 19 Mar 2007 11:30:42 -0400 Subject: FW: [FIELDTRIP] .lay layout file for neuromag 306 channels Message-ID: Hi Dasha, Sorry,I don't see the attachment. Matt ________________________________ From: FieldTrip discussion list on behalf of Daria Osipova Sent: Mon 3/19/2007 10:47 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] FW: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Matt Here they are. Best regards, Dasha PS Robert, wouldn't it be a good idea to include these layouts in fieldtrip? _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Daria Osipova Sent: Monday, February 19, 2007 4:31 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Attached are 306-channel Neuromag layout files (also for magnetometers and gradiometers separately). Cheers, Dasha _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Christian Hesse Sent: Monday, February 19, 2007 9:19 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] .lay layout file for neuromag 306 channels Hi Sameer, please have a look at the FT (in fieldtrip/private) function "createlayout.m" (in the fieldtrip/private directory) which should be able to create a layout for your Neuromag306 data on the fly. The function takes a structure containing gradiometer information as input. If you read in your data using "preprocessing.m" then the gradiometer info will be contained in a field called data.grad. Hope this helps, Christian On 16 Feb 2007, at 21:46, Sameer Walawalkar wrote: Hi, As I had written some time ago, I could not find a .lay file which would be useful for neuromag 306 (there is a NM122.lay file there). Is there some way around this? sameer ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- From Daria.Osipova at FCDONDERS.RU.NL Mon Mar 19 16:42:28 2007 From: Daria.Osipova at FCDONDERS.RU.NL (Daria Osipova) Date: Mon, 19 Mar 2007 16:42:28 +0100 Subject: MultiplotER using Neuromag lay In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB01103578@medstudent.medschool.nt.pitt.edu> Message-ID: Oops they didn't get attached Hopefully now it works -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Shtrahman, Matthew Sent: Monday, March 19, 2007 3:28 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay Hi, Can someone give me the link where I can download NM306mag.lay? Thanks, Matt -----Original Message----- From: FieldTrip discussion list on behalf of Joachim Gross Sent: Mon 3/19/2007 5:38 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay Hi Eve, I think I had a similar problem. In my case the channel labels in NM306mag.lay did not exactly match the labels in avgdata.label. After changing either set of labels it worked for me. Joachim alotof eve wrote: > Hi, Christian, > > Sorry I didn't reply this for a long time. Thanks for these > suggestions. They work well. And I found after using read_data, the > other processing still can work for whole data. > > However, I met another problem. > > After I did timelockanalysis, I tried to plot average data using > multiplotER. I downloaded the file "NM306mag.lay" and other two you > offered. The layoutplot(cfg) shows that the files are correct. > However, when I used multiplotER(cfg,avgdata), the figure showed up > was blank. Nothing on it even the lables. > > Could you or other experts tell me the possible way to figure it > out? Thanks so much. > > Best, > Eve > > > */Christian Hesse /* wrote: > > Hi Eve, > >> I can use meg-pd toolbox now. However, it seems all the functions >> in FieldTrip are for evoked data while my raw data is continuous >> data. > > FieldTrip handles a variety of data, and the low level reading > functions can deal with continuous or epoch based raw data. > > When you analyze your data in FT, you usually start by defining > your trials, i.e. epochs in your continuous data that are of > interest, w.r.t. to some sort of trigger or event. The function > PREPROCESSING then scans through your raw data file and returns a > data structure which contains all of the specified epochs (for a > particular trial definition) in a field data.trial. Please note > that this has nothing to do with evoked vs induced responses just yet. > > You can use the output of PREPROCESSING as input to either > TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and induced > phenomena, respectively. Afterwards you can call various > statistical functions such as FREQDESCRIPTIVES, etc ... > > So the reason why I have been giving you the examples using > read_header and read_data is because I needed to determine the > nature of the error you were getting without really knowning > anything about what sort of data is in your file. In your use of > FT you do not actually use these functions yourself, but basically > use functions like DEFINE_TRIAL and PREPROCESSING to start with. > > ------------------------------------------------------------------------ > No need to miss a message. Get email on-the-go > > with Yahoo! Mail for Mobile. Get started. > -------------- next part -------------- A non-text attachment was scrubbed... Name: NM306planar.lay Type: application/octet-stream Size: 9638 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NM306mag.lay Type: application/octet-stream Size: 5027 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NM306all.lay Type: application/octet-stream Size: 14476 bytes Desc: not available URL: From c.hesse at FCDONDERS.RU.NL Mon Mar 19 17:02:38 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Mon, 19 Mar 2007 17:02:38 +0100 Subject: MultiplotER using Neuromag lay In-Reply-To: <703AA10462B85E42BEA1AF9BDEC642FB01103578@medstudent.medschool.nt.pitt.edu> Message-ID: Hi Matt, you can use the function PREPARE_LAYOUT to generate a layout using the gradiometer information in your data. Regards, Christian On 19 Mar 2007, at 15:27, Shtrahman, Matthew wrote: > Hi, > > Can someone give me the link where I can download NM306mag.lay? > > Thanks, > > Matt > > > -----Original Message----- > From: FieldTrip discussion list on behalf of Joachim Gross > Sent: Mon 3/19/2007 5:38 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] MultiplotER using Neuromag lay > > Hi Eve, > > I think I had a similar problem. > In my case the channel labels in NM306mag.lay did not exactly match > the > labels in avgdata.label. > After changing either set of labels it worked for me. > > Joachim > > alotof eve wrote: >> Hi, Christian, >> >> Sorry I didn't reply this for a long time. Thanks for these >> suggestions. They work well. And I found after using read_data, the >> other processing still can work for whole data. >> >> However, I met another problem. >> >> After I did timelockanalysis, I tried to plot average data using >> multiplotER. I downloaded the file "NM306mag.lay" and other two you >> offered. The layoutplot(cfg) shows that the files are correct. >> However, when I used multiplotER(cfg,avgdata), the figure showed up >> was blank. Nothing on it even the lables. >> >> Could you or other experts tell me the possible way to figure it >> out? Thanks so much. >> >> Best, >> Eve >> >> >> */Christian Hesse /* wrote: >> >> Hi Eve, >> >>> I can use meg-pd toolbox now. However, it seems all the >>> functions >>> in FieldTrip are for evoked data while my raw data is continuous >>> data. >> >> FieldTrip handles a variety of data, and the low level reading >> functions can deal with continuous or epoch based raw data. >> >> When you analyze your data in FT, you usually start by defining >> your trials, i.e. epochs in your continuous data that are of >> interest, w.r.t. to some sort of trigger or event. The function >> PREPROCESSING then scans through your raw data file and returns a >> data structure which contains all of the specified epochs (for a >> particular trial definition) in a field data.trial. Please note >> that this has nothing to do with evoked vs induced responses >> just yet. >> >> You can use the output of PREPROCESSING as input to either >> TIMELOCKANALYSIS or FREQUANALYSIS which look at evoked and >> induced >> phenomena, respectively. Afterwards you can call various >> statistical functions such as FREQDESCRIPTIVES, etc ... >> >> So the reason why I have been giving you the examples using >> read_header and read_data is because I needed to determine the >> nature of the error you were getting without really knowning >> anything about what sort of data is in your file. In your use of >> FT you do not actually use these functions yourself, but >> basically >> use functions like DEFINE_TRIAL and PREPROCESSING to start with. >> >> --------------------------------------------------------------------- >> --- >> No need to miss a message. Get email on-the-go >> >> with Yahoo! Mail for Mobile. Get started. >> > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicola.ray at DPAG.OX.AC.UK Mon Mar 19 18:03:26 2007 From: nicola.ray at DPAG.OX.AC.UK (Niki Ray) Date: Mon, 19 Mar 2007 18:03:26 +0100 Subject: Exporting back to CTF tools Message-ID: Hi, Thank you for your previous answers re: ICA. Things are mush clearer now. I want to use the CTF tools to do a SAM analysis, but want to first run the ICA in fieldtrip. Is it possible to export data back into the format required by the CTF SAMsuite after preprocessing in fieldtrip? Thank you in advance! Niki From sameer at ANDREW.CMU.EDU Mon Mar 19 19:22:19 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Mon, 19 Mar 2007 14:22:19 -0400 Subject: frequencies of interest not assigned properly in freqanalysis Message-ID: I am trying to understand why the frequencies of interest do not seem to get assigned properly as shown below. cfgPre = ouput: 'powandcsd' method: 'mtmfft' keeptrials: 'no' tapsmofrq: 4 foilim: [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100] channel: 'MEG' channelcmb: {'MEG' 'MEG'} freqPreRR = freqanalysis(cfgPre,dataRRpre_One); freqPreRR = label: {306x1 cell} dimord: 'chan_freq' freq: [5.9880 7.9840 9.9800] powspctrm: [306x3 double] labelcmb: {46665x2 cell} crsspctrm: [46665x3 double] grad: [1x1 struct] cfg: [1x1 struct] thanks, sameer From ingrid.nieuwenhuis at FCDONDERS.RU.NL Mon Mar 19 19:49:30 2007 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Mon, 19 Mar 2007 19:49:30 +0100 Subject: frequencies of interest not assigned properly in freqanalysis In-Reply-To: Message-ID: Hi Sameer, The frequency resolution with mtmfft depends on the length of your trials. Cfg.foilim should be only two numbers, the lower and upper boundary of the frequency. It seems as if you are confusing mtmconvol and mtmfft. In mtmconvol you can specify the cfg.foi as a vector with more than 2 frequencies. See the help information of these both functions. Hopes this helps you along, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Monday, March 19, 2007 7:22 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] frequencies of interest not assigned properly in freqanalysis I am trying to understand why the frequencies of interest do not seem to get assigned properly as shown below. cfgPre = ouput: 'powandcsd' method: 'mtmfft' keeptrials: 'no' tapsmofrq: 4 foilim: [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100] channel: 'MEG' channelcmb: {'MEG' 'MEG'} freqPreRR = freqanalysis(cfgPre,dataRRpre_One); freqPreRR = label: {306x1 cell} dimord: 'chan_freq' freq: [5.9880 7.9840 9.9800] powspctrm: [306x3 double] labelcmb: {46665x2 cell} crsspctrm: [46665x3 double] grad: [1x1 struct] cfg: [1x1 struct] thanks, sameer From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:22:55 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:22:55 +0100 Subject: write_tri.m file and results from volplot In-Reply-To: <6.1.2.0.2.20070312180158.05005420@email.med.yale.edu> Message-ID: On 12 Mar 2007, at 23:12, Brian Roach wrote: > To construct a headmodel for EEG source analysis. I have attached > the result from a call to: > > volplot(skin+skull+brain); I am new to this, and wonder how to > judge the success of this script in creating a new model. What > kinds of things do I want to see in this plot, or the volplot of > the skin, skull, or brain, individually? The example script says > that it requires a lot of trial and error, so I am assuming that > just running that script is not all that is necessary, but I do not > know. Hi Brian The segmentation in your figure looks fine to me. There are three tissue types visible at the locatins where you expect them, and the boundaries between the tissue types are also well defined and smooth. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:28:41 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:28:41 +0100 Subject: first steps using lcmv In-Reply-To: <8A3F5CCB-C26C-46E7-BE2C-22CF761817E0@lyon.inserm.fr> Message-ID: Hi Nathan On 7 Mar 2007, at 18:08, Nathan Weisz wrote: > i found a standard bem in the dipfit plugin folder of eeglab > (standard_vol.mat). > > >> vol > > vol = > > bnd: [1x3 struct] > cond: [0.3300 0.0041 0.3300] > mat: [3000x3000 double] > type: 'dipoli' > > i guess that i can simply exchange my standard spherical model > (same as in eeglab) and use this bem volume for calculating the > leadfield. Yes, that volume conduction model is fine. > one aspect are the electrode locations: the positions are given on > a sphere ... so probably there'll has to be some transformation of > the positions. There should be EEG electrode locations for the 10-20, the 10-10 and the 10-5 system with the EEGLAB-dipfit release as well. If not, please use attached electrode file. It should match the BEM model. You can check the match with HEADMODELPLOT. you can do elec = read_fcdc_elec('standard_1005.elc'); and then cfg.elec = elec; or alternatively cfg.elecfile = 'standard_1005.elc'; in sourceanalysis. best Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: standard_1005.elc Type: application/octet-stream Size: 11176 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:40:58 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:40:58 +0100 Subject: Exporting back to CTF tools In-Reply-To: Message-ID: Hi Niki On 19 Mar 2007, at 18:03, Niki Ray wrote: > I want to use the CTF tools to do a SAM analysis, but want to > first run > the ICA in fieldtrip. Is it possible to export data back into the > format > required by the CTF SAMsuite after preprocessing in fieldtrip? We do not have tools to write CTF data. However, the CTF meg4 format is very simple. As long as you apply the same (inverse) amplitude calibration and convert the double data back to int32, it should be possible to insert the processed values back into a CTF meg4 file. You can have a look at fieldtrip/private/read_ctf_meg4.m and try to reverse-engineer the reading function. The code looks more complex than it is, that is due to the multi-file handling (files cannot be larger than 2GB). If I recall correctly, the meg4 file consists of a 8 byte header, followed by blocks of data. Each block is hdr.nSamples*hdr.nChans*4 butes large. Within a block the data is not multiplexed, but instead one channel after the other. best regards, Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 21:58:57 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 21:58:57 +0100 Subject: cross spectral density issues In-Reply-To: Message-ID: Hi Sameer, On 19 Mar 2007, at 14:26, Sameer Walawalkar wrote: > When I do > > cfgCSD = []; > cfgCSD.output = 'powandcsd'; > cfgCSD.method = 'mtmfft'; > cfgCSD.foilim = [5 100]; > cfgCSD.tapsmofrq = 5; > cfgCSD.keeptrials = 'yes'; > cfgCSD.channel = {'MEG'} ; > cfgCSD.channelcmb = {'MEG' 'MEG'}; > freqCSD_RR_One = freqanalysis(cfgCSD,dataRR_One); > > I get the following error. > > ??? Error using ==> unknown > Maximum variable size allowed by the program is exceeded. > > Error in ==> freqanalysis_mtmfft at 342 > if csdflg, crsspctrm = complex(zeros > (numper,numsgncmb,numboi)); end How large is the matrix that you are trying to allocate? I.e. how large is Ntrials times (Nchans^2)/2 times the number of frequency bins? The number of frequency bins depends on the data, specifically on the length of your trials. For 1-sec trials, you have one frequency bin per Herz, for 2-sec trials you have two, etc. The total amount of memory is the number of elements in the matrix times 16 bytes (since each matrix element has a double precision real and imaginary number). > Error in ==> freqanalysis at 167 > [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, > data); > > > But I remember using something very close to this some ten days > ago. So I am not sure what I might be doing wrong. Any suggestions > are very welcome. You may have used fewer frequency bins (cfg.foilim) or the data may have had fewer trials. > I tried using method 'mtmwelch' but that gave a host of other > errors including looking for cfg.foi instead of cfg.foilim (non > uniformity in application). Please look at the documentation in FREQANALYSIS_MTMWELCH. I suspect that the mtmwelch method will require even more memory. Are you sure with the amount of data that you have that you want to keep trials? Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 19 22:12:29 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Mar 2007 22:12:29 +0100 Subject: MNI aligned grids, mris and segmentation In-Reply-To: Message-ID: Hi Sameer On 13 Mar 2007, at 15:27, Sameer Walawalkar wrote: > I want to start DICS analysis of my MEG data. For this I need to > have MRI and MEG data coregistered. I also need multisphere forward > models for which segmentation is necessary. > > Am I correct in understanding that the following webpage contains > info about segmentation? (in addition to MNI aligning all grids) > > From (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? > id=fieldtrip:documentation:create_single- > subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_spa > ce) I suggest that you also look at http://www2.ru.nl/fcdonders/fieldtrip/ doku.php? id=fieldtrip:documentation:make_leadfields_using_different_headmodels > Here, in the very beginning, > ... > I understand that in the commands above, first we are creating a > template mri to which all other grids will later be aligned. What > exactly is t1_icbm_normal_1mm_pn0_rf0.mnc ? Is it a slice from an > mri image. The idea here is to use an existing template MRI to construct a headmodel, and define a dipole grid in it. Then, each individual MRI is warped to the template MRI, and the inverse of that warp is applied to the dipole grid. Subsequently, an individual headmodel is made for each individual MRI and the warped dipole grid (in individual subjects' coordinates) is used together with the individual headmodel for the beaming. The source reconstructions are computed, and can immediately be averaged over subjects. The underlying motivation relates to group statistics without the neccessity to interpolate the source reconstructions to an artifical higher resolution. Since you are just starting with beamforming, I advice that you do not immediately try to follow the "MNI common grids" approach. Better is first to explore some single subject beamed data. > Can I give the path to my dicom mri images directory and the name > of a file ending in .dcm? > > Incidently >>> mri = > read_fcdc_mri('Z:\KarmaCond\BIRC_images_foolaround\070207134421\2 > \02-0001-000001.dcm'); > ??? Undefined function or variable "hdr". > > Error in ==> read_fcdc_mri at 179 > [z, indx] = sort(cell2mat({hdr.SliceLocation})); If you have the image processing toolbox, you should be able to read in a set of DICOM files. Note that the homogenous transformation matrix then is not yet correct, i.e. the slice resolution and spacing and the coordinate axes are not yet specified. Figuring the slice ordering from a set of loose dicom files is tricky. I think that the naming of your dicom files differs from ours, we have a directory containing files like this: ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.92.2003.7.31.11.19.16.578000.53834891.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.93.2003.7.31.11.19.16.578000.53834906.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.94.2003.7.31.11.19.16.578000.53834921.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.95.2003.7.31.11.19.16.578000.53834936.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.96.2003.7.31.11.19.16.578000.53834951.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.97.2003.7.31.11.19.16.578000.53834966.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.98.2003.7.31.11.19.16.15000.53831961.IMA ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. 2.99.2003.7.31.11.19.16.15000.53831976.IMA The detection of the correct dcm files in your directory seems not to work. I suggest that you set a debugger breakpoint in read_fcdc_mri and that you step through it one line at a time. best regards, Robert From sghosh at HSS.IITD.AC.IN Tue Mar 20 09:37:42 2007 From: sghosh at HSS.IITD.AC.IN (Shantanu Ghosh) Date: Tue, 20 Mar 2007 09:37:42 +0100 Subject: Datastructure inclusion Message-ID: Hi Christian It took me sometime to figure out the dtaformat, so I prepared the format like this using a .MAT file and some synthetic data like this data = []; data.fsample = 115.3402; data.label = {'FP1'; 'FP2'; 'Fz'; %presently using only 3 channels %'F3'; 'F4'; 'F7'; 'F8'; ... %'T3'; 'T4'; 'T5'; 'T6';... %'P3'; 'P4'; 'Pz'; 'O1'; 'O2'; 'Oz';... %'C3'; 'C4'; 'Cz'; 'A1'; 'A2'; 'EKG'}; data.nTrial=3; trial1 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];% other channel data to be added here trial2 = [[2.9;2.2;2.3;2.4;2.2],[7.5;7.9;7.8;7.2;7.1],[1.5;1.9;1.8;1.2;1.1]];%sllrly, other channel data to be added here trial3 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];% sllrly,other channel data to be added here time1 = [1,2,3,4,5];%and here time2 = [.1,.2,.3,.4,.5];%and here time3 = [1,2,3,4,5];%and here %Is there another way to do this as the same time axis is there for all channels? data.trial = cell(data.nTrial,1); data.trial{1,1} = trial1 ; data.trial{2,1} = trial2 ; data.trial{3,1} = trial3 ; data.time = cell(data.nTrial,1) ; data.time{1,1} = time1; data.time{2,1} = time2; data.time{3,1} = time3; data Gives the output data = fsample: 115.3402 label: {23x1 cell} nTrial: 3 trial: {3x1 cell} time: {3x1 cell} If this is ok, then why am I getting error when I run it for FT? >> read_fcdc_data(data); ??? Function 'exist' is not defined for values of class 'struct'. Error in ==> exist at 41 [varargout{1:nargout}] = builtin('exist', varargin{:}); Error in ==> fieldtrip\private\read_data at 70 if ~exist(filename) Error in ==> read_fcdc_data at 49 [dat] = read_data(varargin{:}); -------------- next part -------------- data = []; data.fsample = 115.3402; data.label = {'FP1'; 'FP2'; 'Fz'; % 'F3'; 'F4'; 'F7'; 'F8'; ... % 'T3'; 'T4'; 'T5'; 'T6';... % 'P3'; 'P4'; 'Pz'; 'O1'; 'O2'; 'Oz';...\exp1\myDataStructure % 'C3'; 'C4'; 'Cz'; 'A1'; 'A2'; 'EKG'}; data.nTrial=3; trial1 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];%...other channels to be added here trial2 = [[2.9;2.2;2.3;2.4;2.2],[7.5;7.9;7.8;7.2;7.1],[1.5;1.9;1.8;1.2;1.1]];%...other channels to be added here trial3 = [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];%...other channels to be added here time1 = [1,2,3,4,5]; time2 = [.1,.2,.3,.4,.5]; time3 = [1,2,3,4,5]; data.trial = cell(data.nTrial,1); data.trial{1,1} = trial1 ; data.trial{2,1} = trial2 ; data.trial{3,1} = trial3 ; data.time = cell(data.nTrial,1) ; data.time{1,1} = time1; data.time{2,1} = time2; data.time{3,1} = time3; data From c.hesse at FCDONDERS.RU.NL Tue Mar 20 10:59:27 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 20 Mar 2007 10:59:27 +0100 Subject: Neuromag layouts Message-ID: Dear Neuromag Users, to facilitate (any kind of) topographical plotting of your 122 or 306 channel MEG data, fieldtrip now includes (or at least will from the next daily update this evening 22:00 CET) several *.lay files for Neuromag systems. If the labels in your data do not match the labels any of the layout files, then you can readily generate your own layout using the function PREPARE_LAYOUT which requires an input data structure containing a field with gradiometer information, e.g., your data header or the data output from PREPROCESSING. (Note that this function can handle channel labels with and without spaces between the "MEG" and "number" tokens of the label string.) You can check whether the layout is correct using the function LAYOUTPLOT Hope you find this helpful Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.hesse at FCDONDERS.RU.NL Tue Mar 20 12:12:42 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Tue, 20 Mar 2007 12:12:42 +0100 Subject: Data structur In-Reply-To: <1416.10.100.2.68.1174375806.squirrel@www.iitd.ac.in> Message-ID: Hi Shantanu, > It took me sometime to figure out the dtaformat, so I prepared the > format > like this using a .MAT file and some synthetic data like this > > data = []; > data.fsample = 115.3402; > data.label = {'FP1'; 'FP2'; 'Fz'; %presently using only 3 channels > %'F3'; 'F4'; 'F7'; 'F8'; ... > %'T3'; 'T4'; 'T5'; 'T6';... > %'P3'; 'P4'; 'Pz'; 'O1'; 'O2'; 'Oz';... > %'C3'; 'C4'; 'Cz'; 'A1'; 'A2'; 'EKG'}; > > data.nTrial=3; > > trial1 = > [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]];% > other channel data to be added here > trial2 = > [[2.9;2.2;2.3;2.4;2.2],[7.5;7.9;7.8;7.2;7.1],[1.5;1.9;1.8;1.2;1.1]]; > %sllrly, > other channel data to be added here > trial3 = > [[1.1;1.2;1.6;6.7;7.2],[1.5;1.9;1.8;1.2;1.1],[1.5;1.9;1.8;1.2;1.1]]; > %sllrly,other > channel data to be added here > > time1 = [1,2,3,4,5];%and here > time2 = [.1,.2,.3,.4,.5];%and here > time3 = [1,2,3,4,5];%and here > > %Is there another way to do this as the same time axis is there for > all > channels? The FT data structure assumes that there is one time axis for each trial which is the same for all channels. In your case it may even be the same time axis on all trials, however, this is a) not the general case and b) a trial time axis is required later on for averaging and spectral analysis to make sure the data epochs on different trials are correctly aligned over trials. > > data.trial = cell(data.nTrial,1); > > data.trial{1,1} = trial1 ; > data.trial{2,1} = trial2 ; > data.trial{3,1} = trial3 ; > > data.time = cell(data.nTrial,1) ; > > data.time{1,1} = time1; > data.time{2,1} = time2; > data.time{3,1} = time3; > > data > > > Gives the output > > data = > > fsample: 115.3402 > label: {23x1 cell} > nTrial: 3 > trial: {3x1 cell} > time: {3x1 cell} This is the correct format (except that in FT there is no "nTrial" field); > If this is ok, then why am I getting error when I run it for FT? > >>> read_fcdc_data(data); > ??? Function 'exist' is not defined for values of class 'struct'. > > Error in ==> exist at 41 > [varargout{1:nargout}] = builtin('exist', varargin{:}); > > Error in ==> fieldtrip\private\read_data at 70 > if ~exist(filename) > > Error in ==> read_fcdc_data at 49 > [dat] = read_data(varargin{:}); If you look at the function definition (interface) for READ_FCDC_DATA you will see that it expects a sting argument (i.e. a filename) as input since it is used to read data from data files with known format. The error is generated because Matlab is trying to determine whether your input "data" refers to an existing file in the system, which of course it does not. Since the data format you are using is not known to FT, you cannot use any of the READ_FCDC_XXXX (or lower level) functions. Instead, you have to read your data into an FT data structure yourself, as you now seem to have done successfully. Once you have the data structure, you just pass it to the different analysis functions like TIMELOCKANALYSIS or FREQANALYSIS. I hope this helps, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ychen at BME.UFL.EDU Tue Mar 20 15:32:19 2007 From: ychen at BME.UFL.EDU (Chen) Date: Tue, 20 Mar 2007 15:32:19 +0100 Subject: weird result for EEG visual N1 source localization using lcmv Message-ID: Hi, I am doing source localization on EEG biosemi 128 channels recordings and get weird result. I am giving the details in the following to seek any help: KrisS = eeglab2fieldtrip(EEG,'preprocessing'); cfg=[]; cfg.latency=[.08 .12]; %latency of N1 cfg.covariancewindow=[.08 .12]; cfg.covariance='yes'; cfg.keeptrials='no'; datTest=timelockanalysis(cfg,KrisS); clear KrisS cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 5; figure(1);topoplotER(cfg,datTest); datTest.elec.pnt = 1000 * datTest.elec.pnt*[0 -1 0; 1 0 0;0 0 1]; %convert electrode coordinates from m to mm and make the x go to nose load standard_vol.mat %use standard BEM vol from EEGLAB load standard_mri.mat %use standard mri from EEGLAB cfg=[]; cfg.vol=vol; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; [grid] = prepare_leadfield(cfg, datTest); cfg=[]; cfg.grid=source2sparse(grid); cfg.method='lcmv'; cfg.vol=vol; cfg.projectnoise='yes'; cfg.lambda=1; [sourceN1] = sourceanalysis(cfg, datTest); cfg=[]; cfg.powmethod='none'; %only option that works [sourcenai] = sourcedescriptives(cfg, sourceN1); cfg =[]; cfg.downsample = 2; cfg.funparameter = 'nai';%or neural activity indes (nai) sourceN1F=source2full(sourcenai); [interp]=sourceinterpolate(cfg,sourceN1F,mri); figure(3);sliceinterp(cfg,interp) I have the following specific questions: 1. Should the units all be mm? 2. Is my coordinate rotation right? 3. How to choose the value of lambda? I just randomly choose 1 now since without lamda I always get warnings of rank-deficient and divided by zeros. 4. Since I am using the standard BEM and mri, my electrodes are not on the skin( see the attached figure), when I try to realign based on fiducials, it is still the same. I check the function of electroderealign and find out that norm.m is always identy matrix which make the realign doing nothing. Why? Appreciate to point out what I am wrong. Chen -------------- next part -------------- A non-text attachment was scrubbed... Name: TopoN1.jpg Type: image/pjpeg Size: 43181 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: N1source.jpg Type: image/pjpeg Size: 32703 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ElecHead.jpg Type: image/pjpeg Size: 36116 bytes Desc: not available URL: From sameer at ANDREW.CMU.EDU Tue Mar 20 19:10:36 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Tue, 20 Mar 2007 14:10:36 -0400 Subject: MNI aligned grids, mris and segmentation In-Reply-To: Message-ID: Dear Robert, Thank you for your reply to my question about (MNI aligned grids, MRIs and segmentation). I am going to take your advise of exploring single subject beamed data. But, I want to clarify one or two points before going on. I am using Neuromag 306 data. Or the MRIs, I have already used MNE to generate bem head model meshes stored in files of kind _bem_sol.fif, but which fieldtrip program do I use to extract this (the info is for ctf and I could not find an intuitive or obvious extension to my case). Can I simply proceed as bem_head = appropriate-field-trip-function(_bem_sol.fif); hdr = read_fcdc_header(datafile.fif); cfg = []; cfg.grad = hdr.grad; cfg.vol = bem_head; cfg.resolution = 1; grid_bem = prepare_leadfield(cfg); Also am not sure how to extract head shape which is needed for plotting headmodel. Is it shimply the HPI coils information ? thanks for your time. sameer On Mon, 19 Mar 2007, Robert Oostenveld wrote: > Hi Sameer > > On 13 Mar 2007, at 15:27, Sameer Walawalkar wrote: >> I want to start DICS analysis of my MEG data. For this I need to have MRI >> and MEG data coregistered. I also need multisphere forward models for which >> segmentation is necessary. >> >> Am I correct in understanding that the following webpage contains info >> about segmentation? (in addition to MNI aligning all grids) >> >> From (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? >> id=fieldtrip:documentation:create_single- >> subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space) > > I suggest that you also look at http://www2.ru.nl/fcdonders/fieldtrip/ > doku.php? > id=fieldtrip:documentation:make_leadfields_using_different_headmodels > >> Here, in the very beginning, >> ... >> I understand that in the commands above, first we are creating a template >> mri to which all other grids will later be aligned. What exactly is >> t1_icbm_normal_1mm_pn0_rf0.mnc ? Is it a slice from an mri image. > > The idea here is to use an existing template MRI to construct a headmodel, > and define a dipole grid in it. Then, each individual MRI is warped to the > template MRI, and the inverse of that warp is applied to the dipole grid. > Subsequently, an individual headmodel is made for each individual MRI and the > warped dipole grid (in individual subjects' coordinates) is used together > with the individual headmodel for the beaming. The source reconstructions are > computed, and can immediately be averaged over subjects. The underlying > motivation relates to group statistics without the neccessity to interpolate > the source reconstructions to an artifical higher resolution. > > Since you are just starting with beamforming, I advice that you do not > immediately try to follow the "MNI common grids" approach. Better is first to > explore some single subject beamed data. > >> Can I give the path to my dicom mri images directory and the name of a file >> ending in .dcm? >> >> Incidently >>>> mri = >> read_fcdc_mri('Z:\KarmaCond\BIRC_images_foolaround\070207134421\2 >> \02-0001-000001.dcm'); >> ??? Undefined function or variable "hdr". >> >> Error in ==> read_fcdc_mri at 179 >> [z, indx] = sort(cell2mat({hdr.SliceLocation})); > > If you have the image processing toolbox, you should be able to read in a set > of DICOM files. Note that the homogenous transformation matrix then is not > yet correct, i.e. the slice resolution and spacing and the coordinate axes > are not yet specified. Figuring the slice ordering from a set of loose dicom > files is tricky. I think that the naming of your dicom files differs from > ours, we have a directory containing files like this: > > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.92.2003.7.31.11.19.16.578000.53834891.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.93.2003.7.31.11.19.16.578000.53834906.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.94.2003.7.31.11.19.16.578000.53834921.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.95.2003.7.31.11.19.16.578000.53834936.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.96.2003.7.31.11.19.16.578000.53834951.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.97.2003.7.31.11.19.16.578000.53834966.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.98.2003.7.31.11.19.16.15000.53831961.IMA > ERIVDBER_030731_R.OOSTERVELD.MR.PAUGAA_ANATOMICAL-3D. > 2.99.2003.7.31.11.19.16.15000.53831976.IMA > > The detection of the correct dcm files in your directory seems not to work. I > suggest that you set a debugger breakpoint in read_fcdc_mri and that you step > through it one line at a time. > > best regards, > Robert > From h.stoegbauer at GMAIL.COM Wed Mar 21 00:02:59 2007 From: h.stoegbauer at GMAIL.COM (Harald Stoegbauer) Date: Tue, 20 Mar 2007 16:02:59 -0700 Subject: timelockstatistics Message-ID: Hi FieldTrippers, Exist there any example code for the 'timelockstatistics' function ? Thanks, Harald -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Wed Mar 21 07:03:23 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Wed, 21 Mar 2007 07:03:23 +0100 Subject: timelockstatistics In-Reply-To: Message-ID: Dear Harald, Exist there any example code for the 'timelockstatistics' function ? Not yet, but we are working on it. To get started, you could make use of the clusterrandanalysis-tutorial and combine this with the help-information from timelockstatistics. Clusterrandanalysis is the predecessor of timelock-, freq-, and sourcestatistics. Good luck, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulla.rantakokko at TKK.FI Wed Mar 21 09:41:45 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Wed, 21 Mar 2007 10:41:45 +0200 Subject: TFR:boundaries, resolution Message-ID: Hi everyone, 1. Is there a way to get rid of boundary effects for low frequencies. The boundary is moving but it is not disappearing. 2. The output is very grainy i.e. so called pixels are big and sharp edged even with as high tapsmofrq as is possible with available memory. Is there a way to make the output prettier ? 3. TopoplotTFR is not functioning. It only draws a blank figure. MultiplotTFR and singleplotTFR function perfectly. I use .grad generated layout for 306 channel Neuromag. Thanks Ulla From muthuraman10 at HOTMAIL.COM Wed Mar 21 11:02:55 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Wed, 21 Mar 2007 10:02:55 +0000 Subject: Sliceinterp-Sourceplot! Message-ID: Hello Fieldtrippers, I have attached two plots with this mail, one is sliceinterp and the other is the source plot of the same data with MRI taken from the fieldtrip 'subject01.mri' In the sourceplot i do not get the anatomical information, according to the fieldtrip documentation need to interpolate the functional data with the anatomical data by sourceinterpolate.m and then is the configuration for the source plot then i get the error cfg.method='ortho'; cfg.slicedim=3; cfg.anaparamter= 'anatomy'; cfg.funparameter='coh'; cfg.maskparameter='coh'; sourceplot(cfg,interp); I get the error ??? Error using ==> reshape To RESHAPE the number of elements must not change. Error in ==> sourceplot at 409 if hasana, ana = reshape(ana, dim); end; Any suggestions on this will be appreciated Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It�s cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in -------------- next part -------------- A non-text attachment was scrubbed... Name: sliceinterp.jpg Type: image/jpeg Size: 43669 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sourceplot.jpg Type: image/jpeg Size: 35027 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Wed Mar 21 12:44:12 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 21 Mar 2007 12:44:12 +0100 Subject: Sliceinterp-Sourceplot! In-Reply-To: Message-ID: On 21 Mar 2007, at 11:02, Muthuraman Muthuraman wrote: > I get the error > > ??? Error using ==> reshape > To RESHAPE the number of elements must not change. > > Error in ==> sourceplot at 409 > if hasana, ana = reshape(ana, dim); end; > > Any suggestions on this will be appreciated You seem to have constructed an interpolated source reconstruction in which the anatomy and the functional data are not on the same grid of voxels. What is the cfg and the output of sourceinterpolate? Robert From muthuraman10 at HOTMAIL.COM Wed Mar 21 13:04:40 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Wed, 21 Mar 2007 12:04:40 +0000 Subject: Sliceinterp-Sourceplot! In-Reply-To: <8F94F951-2872-456B-A9E3-CB5E07FB15C8@fcdonders.ru.nl> Message-ID: Hello Dr.Robert, Thankyou for the immediate reply, the cfg structure of the sourceinterpolate [mri] = read_fcdc_mri('Subject01.mri') dim: [256 256 256] anatomy: [256x256x256 uint16] hdr: [1x1 struct] transform: [4x4 double] cfg.downsample=4; [interp] = sourceinterpolate(cfg, source1, mri) and the output of sourceinterpolate avg: [1x1 struct] inside: [64x64x64 logical] dim: [64 64 64] transform: [4x4 double] anatomy: [64x64x64 uint16] cfg: [1x1 struct] Thanking you With regards M.Muthuraman. _________________________________________________________________ Sign in and get updated on all the action from Formula One http://content.msn.co.in/Sports/FormulaOne/Default From r.oostenveld at FCDONDERS.RU.NL Wed Mar 21 13:37:39 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 21 Mar 2007 13:37:39 +0100 Subject: MNI aligned grids, mris and segmentation In-Reply-To: Message-ID: On 20 Mar 2007, at 19:10, Sameer Walawalkar wrote: > I am using Neuromag 306 data. Or the MRIs, I have already used MNE > to generate bem head model meshes stored in files of kind > _bem_sol.fif, but which fieldtrip program do I use to > extract this (the info is for ctf and I could not find an intuitive > or obvious extension to my case). > > Can I simply proceed as You can use neuromag BEM models, but that requires a licensed copy of the meg-calc toolbox (which contans some mex files that are then called by fieldtrip). > bem_head = appropriate-field-trip-function(_bem_sol.fif); > hdr = read_fcdc_header(datafile.fif); > > cfg = []; > cfg.grad = hdr.grad; instead of cfg.grad please specify cfg.gradfile='datafile.fif', since has to be interpreted by the neuromag mex files. > cfg.vol = bem_head; instead of reading the model with appropriate-field-trip-function() you should specify the file that contains the model. That is done with cfg.hdmfile. The neuromag mex file will then "initialize" with the model in the fif file. > cfg.resolution = 1; > grid_bem = prepare_leadfield(cfg); Then the remainder should in principle work. I have not been able to test it exhaustivelym since I do not have a license for the neuromag meg-calc toolbox. > Also am not sure how to extract head shape which is needed for > plotting headmodel. Is it shimply the HPI coils information ? The head shape is the triangulated boundary. That boundary will be read from the fif file at the appropriate time (e.g. in headmodelplot). Actually, the initialization of the neuromag mex files and reading of the triangulation is done in private/ prepare_vol_sens. I suggest you look in that function and search for 'neuromag_fif'. hope this helps, Robert PS you can also use other head models, such as single and multiple spheres and a analytic realistic single-shell model. Those are all implemneted in plain Matlab. From r.oostenveld at FCDONDERS.RU.NL Wed Mar 21 13:40:27 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 21 Mar 2007 13:40:27 +0100 Subject: Sliceinterp-Sourceplot! In-Reply-To: Message-ID: On 21 Mar 2007, at 13:04, Muthuraman Muthuraman wrote: > cfg.downsample=4; > [interp] = sourceinterpolate(cfg, source1, mri) > > and the output of sourceinterpolate > > avg: [1x1 struct] > inside: [64x64x64 logical] > dim: [64 64 64] > transform: [4x4 double] > anatomy: [64x64x64 uint16] > cfg: [1x1 struct] What is in interp.avg? I would expect it to contain interp.avg.pow [64x64x64 double] interp.avg.nai [64x64x64 double] If that is the case, then sourceplot should just work and not complain about different dimensions. Robert From c.hesse at FCDONDERS.RU.NL Wed Mar 21 15:43:52 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 21 Mar 2007 15:43:52 +0100 Subject: TFR:boundaries, resolution In-Reply-To: <20070321104145.g0i8xwoj4sok0s8c@webmail1.tkk.fi> Message-ID: Hi Ulla, > 1. Is there a way to get rid of boundary effects for low > frequencies. The boundary is moving but it is not disappearing. You can't get rid of boundary effects as such. However, you could use a longer window in your time-frequency analysis and then only plot the part of the window without the edge effects. > 2. The output is very grainy i.e. so called pixels are big and > sharp edged even with as high tapsmofrq as is possible with > available memory. Is there a way to make the output prettier ? The "pixels" are partly determined by the size of the time-frequency tiles (whose and their size is determined by the width of your time- window and frequency band at each point in your TFR) and the degree of overlap between the tiles. If you want to make things look "smoother" then you could try increasing the time resolution (spacing between windows) and the temporal smoothing (size of each window), and do the same for the frequency axis. > 3. TopoplotTFR is not functioning. It only draws a blank figure. > MultiplotTFR and singleplotTFR function perfectly. I use .grad > generated layout for 306 channel Neuromag. I have made a small change to the function PREPARE_LAYOUT which should fix the problem in TOPOPLOTTFR. The new version will be available with the daily update this evening at approximately 22:00 CET (and is also attached). The layout stuff has been undergoing some changes recently, and at present there does not really seem to be an appropriate way of passing a "pre-prepared, grad-generated" layout structure to the plotting functions. Currently, provided the gradiometer information is either in cfg.grad or in dat.grad, the plotting functions will automatically generate a layout structure using lay = prepare_layout (cfg, dat) every time they are called. As a sort of compromise, you are (for the time being at least) allowed to put the pre-computed layout structure in cfg.layout, when you call TOPOPLOTTFR and it should work. In the future, I expect that an additional field for pre-computed layout structures might be added at some point. Regards, Christian  ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: prepare_layout.m.zip Type: application/zip Size: 3721 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.smart at NYU.EDU Wed Mar 21 21:39:32 2007 From: andrew.smart at NYU.EDU (Andrew Smart) Date: Wed, 21 Mar 2007 21:39:32 +0100 Subject: importing BESA *.tfc files Message-ID: When using besa2fieldtrip on a *.tfc file I get the following errors in Matlab: ??? Error using ==> colon First and last colon operands must be char. Error in ==> fieldtrip-20070320\private\read_besa_tfc at 77 Time = [TimeStartInMS:TimeIntervalInMS:(NumberTimeSamples-1)*TimeIntervalInMS+TimeStartInMS]; Error in ==> besa2fieldtrip at 140 [ChannelLabels, Time, Frequency, Data, Info] = read_besa_tfc(filename); any suggestions? An example file is attached. Thanks andy -------------- next part -------------- A non-text attachment was scrubbed... Name: Coercion_01_ERA.tfc Type: application/octet-stream Size: 27561 bytes Desc: not available URL: From h.stoegbauer at GMAIL.COM Thu Mar 22 06:09:56 2007 From: h.stoegbauer at GMAIL.COM (Harald Stoegbauer) Date: Wed, 21 Mar 2007 22:09:56 -0700 Subject: timelockstatistics In-Reply-To: <007a01c76b7e$a24b6590$6501a8c0@fcdonders.nl> Message-ID: Dear Eric, Looking forward to get an example code, at the moment I tried to use "Clusterrandanalysis" as guideline. It was hard to guess all the necessary cfg settings, particular ' cfg.correctm' and 'cfg.design' are not listed in the index. In the end it was running but I don't know how to interpret/plot the output (looks quiet different to 'Clusterrandanalysis'). Would be thankful about any short example. A short additional question, it is also possible to make a 'normal' ttest on a particular time window of an ordinary VEP-ERP ? Thanks, Harald On 3/20/07, Eric Maris wrote: > > Dear Harald, > > > > > > Exist there any example code for the 'timelockstatistics' function ? > > Not yet, but we are working on it. To get started, you could make use of > the clusterrandanalysis-tutorial and combine this with the help-information > from timelockstatistics. Clusterrandanalysis is the predecessor of > timelock-, freq-, and sourcestatistics. > > > > Good luck, > > > > Eric > > > > > -- -------------------------------- Harald Stoegbauer, PhD 1200 E. California Blvd CALTECH - Mail code 114-96 Pasadena, CA 91125 Phone: +1-626-395-8959 -------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Mar 22 09:49:57 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Mar 2007 09:49:57 +0100 Subject: timelockstatistics In-Reply-To: <5bbfdea0703212209k1b4c9149wc19daa37767872c5@mail.gmail.com> Message-ID: On 22 Mar 2007, at 6:09, Harald Stoegbauer wrote: > A short additional question, it is also possible to make a 'normal' > ttest on a particular time window of an ordinary VEP-ERP ? TIMELOCKSTATISTICS (idem for freq/source) allows you to do conventional tests as well. Instead of cfg.method = 'montecarlo' % since the p-value is a monte- carlo estimate cfg.correctm = 'cluster' you would specify cfg.method = 'analytic' % since it is an analytic p- value that will be computed cfg.correctm = 'no' % or bonferoni, fdr, holms The cfg.statistic is the same, just as the cfg.design matrix. The choises that you have for multiple-comparison correction are different. See the help of STATISTICS_ANALYTIC for more details. best Robert From ulla.rantakokko at TKK.FI Thu Mar 22 10:10:02 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Thu, 22 Mar 2007 10:10:02 +0100 Subject: TFR:boundaries, resolution Message-ID: Thanks Christian, 1. & 2. Ok. I haven't succeeded well with multitapers because of memory problems. For some reason 'wltconvol' is also impossible for the same reason but this far 'tfr' works well (?) which is a little suprizing . I can get this far singleplot only. 3. I found the new layout files the minute I sent the mail... However, I get >> multiplotTFR(cfg, TFRmult_th_ad); ??? Undefined function or variable "Lbl". Error in ==> fieldtrip-20070226/private/createlayout at 244 if ~any(strcmp('COMNT', Lbl)) Error in ==> multiplotTFR at 234 lay = createlayout(cfg.layout); .................... even though the neuromag data is recognized well. 4. A new idea to reduce the length of trial and thus get better pictures is to separate baseline from the data-trials to one baseline set. How can I relate the baseline with the data as whole information and not just time limits. Am I making myself clear ? Best regs Ulla From c.hesse at FCDONDERS.RU.NL Thu Mar 22 10:40:38 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Thu, 22 Mar 2007 10:40:38 +0100 Subject: TFR:boundaries, resolution In-Reply-To: Message-ID: Hi Ulla, On 22 Mar 2007, at 10:10, Ulla Rantakokko wrote: > Thanks Christian, > > 1. & 2. Ok. I haven't succeeded well with multitapers because of > memory > problems. For some reason 'wltconvol' is also impossible for the > same reason > but this far 'tfr' works well (?) which is a little suprizing . I > can get > this far singleplot only. Using multitapers is not really equally appropriate at all frequencies, and especially not recommended at the "lower" frequencies (say below 20 Hz). I guess it would be fair to say that multitapers are most useful for "pulling out" activity in the high gamma bands (> 60Hz). At frequencies below 40 Hz, I would just use a hanning window and specify the time frequency tiles using cfg = []; cfg.method = 'mtmconvol'; cfg.output = 'pow'; cfg.taper = 'hanning'; cfg.foi = [fbeg:fshift:fend]; cfg.toi = [tbeg:tshift:tend]; cfg.f_timwin = ones(max(size(cfg.foi)),1).*twin; these cfg options essentially give you a "classic" spectrogram which (in my opinion) should be the first step in any time frequency analysis before using more "advanced" techniques such as wavelets or multitapers (both of which, by the way, are much greedier in terms of memory and computation time than the spectrogram). Depending on the goals of your analysis and the frequency range of interest, there may also simply not be sufficient motivation to use either wavelets or multitapers at all. In any event, in the above cfg options, twin is the width of your time window in seconds, and the rest is probably self explanatory. You can also adjust cfg.f_timwin to have different lengths for different frequencies if you wish. With the current settings you should have less problems with running out of memory. > I found the new layout files the minute I sent the mail... However, > I get > >>> multiplotTFR(cfg, TFRmult_th_ad); > ??? Undefined function or variable "Lbl". > > Error in ==> fieldtrip-20070226/private/createlayout at 244 > if ~any(strcmp('COMNT', Lbl)) > > Error in ==> multiplotTFR at 234 > lay = createlayout(cfg.layout); You may want to get the latest version of FT since there have been a lot of changes in the past 2 weeks to the layout stuff. The call to the function CREATELAYOUT (and the date stamp in your fieldtrip directory :-) suggest that you are using an FT version which predates the key changes made on 14.03.2007. It should be fine in the latest version. > 4. A new idea to reduce the length of trial and thus get better > pictures is > to separate baseline from the data-trials to one baseline set. How > can I > relate the baseline with the data as whole information and not just > time > limits. Am I making myself clear ? Not 100%, sorry. Can you say (write) that again? Regards, Christian ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulla.rantakokko at TKK.FI Thu Mar 22 11:40:13 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Thu, 22 Mar 2007 11:40:13 +0100 Subject: TFR:boundaries, resolution Message-ID: Hi Christian, I enjoy your being so precise :) I actually downloaded the version 20070320, removed the older one from path but still matlab somehow finds the old version... maybe I must delete the old one from the computer for good. > You may want to get the latest version of FT since there have been a lot of changes in the past 2 weeks to the layout stuff. The call to the function CREATELAYOUT (and the date stamp in your fieldtrip directory :-) suggest that you are using an FT version which predates the key changes made on 14.03.2007. It should be fine in the latest version. > > Not 100%, sorry. Can you say (write) that again? > I was thinking that I save data separately for data trials with different trigger and another data set solemnly for baseline purpose with another trigger. Because my perfect baseline signal lies some 2000 ms before the data trial and because the data trial is long already the 2 secs for gap between trial and baseline is memory consuming and of no use. So I thought I could plot the data w.r.t. baseline activity from separate sets, when the data trial actually starts much later than the baseline. Now I have the impression that the baseline wants to refer to the same time limits as the data in trial. So can I select the baseline time and signal from another set and the data activity from another data set ie something like: select and preprocess data for baseline: cfg_baseline, data_baseline ...and for data: cfg, data (actually because this far the computation does not require too much memory, the trial could also be one long data set. I would like to compute the TFRs separately with only the time of interest differing into two sets: ) TFRmult_baseline = freqanalysis(cfg_baseline, data_baseline); TFRmult = freqanalysis(cfg, data); and then plot the latter w.r.t. the previous But here I get lost how to tell to FT that baseline could be the whole information (trial and time) and not only a time limit in cfg that is extracted from the data for baseline purpose. So is it possible or do I have to start to imagine ways around the problem ? I hope this lengthy description didn't make the idea even cloudier Best regs Ulla From k.kessler at PSY.GLA.AC.UK Thu Mar 22 11:35:21 2007 From: k.kessler at PSY.GLA.AC.UK (Klaus Kessler) Date: Thu, 22 Mar 2007 11:35:21 +0100 Subject: postdoc job available at Glasgow Message-ID: Dear all, if you are looking for a postdoc position and would like to work with MEG, EEG, TMS and eye tracking, then you might be interested in the position below. Cheers Klaus UNIVERSITY of GLASGOW DEPARTMENT OF PSYCHOLOGY CENTRE FOR COGNITIVE NEUROIMAGING (CCNi) RESEARCH ASSISTANT Salary: £23,002 - £25,889 / £25,889 - £31,840 (depending on experience and qualifications) REF 13147/DPO/A3 Applications are invited for a Postdoctoral Research Assistant to work with Dr Marie-Helene Grosbras and Dr Klaus Kessler on projects using magnetoencephalography (MEG) and transcranial magnetic stimulation (TMS). MEG experiments will aim at identifying cortical networks involved in cognitive processing and analyzing the underlying connectivity (coherence, synchronization). Functional hypotheses will then be tested by means of TMS and simultaneous eye tracking (ET). Future work may also include TMS during EEG recordings. Research projects focus on visual attention, vigilance, consciousness and action observation. You will have the opportunity to: contribute to the design of experiments; collect data with state of the art systems; develop, validate and apply cutting edge techniques to analyse brain signals in the time and frequency domain; search for solutions to the inverse problem in order to identify processing networks. Finally, this will also give you the opportunity to apply your skills in writing scientific articles for high impact journals. For at least two years you will be part of a successful team of researchers in Glasgow who work on related topics. The current creation of a Centre for Cognitive Neuroimaging (CCNi) within the Department of Psychology is a strategic priority of Glasgow University. Equipment will include a 3T fMRI scanner, a MEG system, two TMS systems with frameless stereotaxy, and several EEG systems – including fMRI compatible systems, providing a comprehensive platform of complementary, state-of-the-art brain imaging facilities dedicated to Cognitive Neuroscience research. The centre is scheduled to be opened in autumn. This post is initially available from 1 May 2007 for 2 years. You will be qualified, with a PhD, or equivalent, in Psychology, Neuroscience, Bioengineering, Physics or a related discipline. Experience with MEG/EEG, TMS and/or eye tracking is highly desirable. Programming skills (preferably with MATLAB) and experience with signal analysis in the time-frequency domain (including phase coherence/ synchronisation) is also highly desirable. Salary scale will depend on qualifications and experience. Finally you should have a strong interest in developing your own scientific programme and pursuing a research career. Informal enquiries may be made to Marie-Helene Grosbras (+44 (0)141 330 5264; m.grosbras at psy.gla.ac.uk) or Klaus Kessler (+44 (0)141 330 4774; k.kessler at psy.gla.ac.uk). For further details about the post and how to apply: see our web site at http://www.psy.gla.ac.uk/jobs.php or contact Clare Alexander, Department of Psychology, University of Glasgow, G12 8QQ (+44 (0) 141 330 5090, c.alexander at psy.gla.ac.uk Closing date: 16 April 2007. From sameer at ANDREW.CMU.EDU Thu Mar 22 17:09:08 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 22 Mar 2007 12:09:08 -0400 Subject: prepare_single_shell errors Message-ID: Hi, I am trying to use prepare_singleshell to try and get a single shell model using brain surface from segmented mri. I try to generate this segmented mri using (is this correct) >> [mri]= read_fcdc_mri('/mnt/condor2/sameer/Software/freesurfer/subjects/WS/mri/T1-neuromag/sets/COR.fif') mri = dim: [256 256 256] anatomy: [256x256x256 uint8] hdr: [1x1 struct] transform: [4x4 double] The file COR.fif is acquired by implementing mne_setup_mri of MNE-suite, and it in turn acts upon freeserfer treatment of dicom files of mri data. Then, >> cfg = []; cfg.gradfile = 'ws_011207_1_checkers.fif'; >> ft_singleshell = prepare_singleshell(cfg,mri); smoothing the segmentation with a 5-pixel FWHM kernel Warning: Divide by zero. > In mean at 29 In prepare_singleshell at 100 Warning: Divide by zero. > In mean at 29 In prepare_singleshell at 101 Warning: Divide by zero. > In mean at 29 In prepare_singleshell at 102 ??? Subscript indices must either be real positive integers or logicals. Error in ==> fieldtrip/private/triangulate_seg at 55 int = seg(sel); Error in ==> prepare_singleshell at 103 pnt = triangulate_seg(seg, cfg.spheremesh, ori); >> ft_segment = prepare_localspheres(cfg,mri); gives me similar errors. Any ideas how to troubleshoot these problems? If it will help, (fiff_read_mri is a MNE-suite utility) >> [stack] = fiff_read_mri(' Software/freesurfer/subjects/WS/mri/T1-neuromag/sets/COR.fif') Creating tag directory for /mnt/condor2/sameer/Software/freesurfer/subjects/WS/mri/T1-neuromag/sets/COR.fif...[done] Reading slices..50..100..150..200..250..256..[done] stack = id: [1x1 struct] trans: [1x1 struct] nslice: 256 slices: [1x256 struct] thanks for your time. best, sameer From r.oostenveld at FCDONDERS.RU.NL Thu Mar 22 17:47:00 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Mar 2007 17:47:00 +0100 Subject: prepare_single_shell errors In-Reply-To: Message-ID: Hi Sameer, The second input of prepare_singleshell should be a segmented MRI (i.e the output of VOLUMESEGMENT) and not an original gray-value MRI. On 22 Mar 2007, at 17:09, Sameer Walawalkar wrote: > I am trying to use prepare_singleshell to try and get a single > shell model using brain surface from segmented mri. > > I try to generate this segmented mri using (is this correct) > >>> [mri]= > read_fcdc_mri('/mnt/condor2/sameer/Software/freesurfer/subjects/WS/ > mri/T1-neuromag/sets/COR.fif') > > mri = > > dim: [256 256 256] > anatomy: [256x256x256 uint8] > hdr: [1x1 struct] > transform: [4x4 double] The anatomy here contains (that is what I suspect) all values between 0 and 255 that, when plotted, represent the anatomical MRI. > The file COR.fif is acquired by implementing mne_setup_mri of MNE- > suite, and it in turn acts upon freeserfer treatment of dicom files > of mri data. The output of volumesegment would contain mri.gray 256^3 mri.white 256^3 mri.csf 256^3 subsequently what prepare_singleshell does (see the first part in the code) is seg = zeros(mri.dim); if isfield(mri, 'gray') fprintf('including gray matter in segmentation for brain compartment\n') seg = seg | (mri.gray>(cfg.threshold*max(mri.gray(:)))); end if isfield(mri, 'white') fprintf('including white matter in segmentation for brain compartment\n') seg = seg | (mri.white>(cfg.threshold*max(mri.white(:)))); end if isfield(mri, 'csf') fprintf('including CSF in segmentation for brain compartment\n') seg = seg | (mri.csf>(cfg.threshold*max(mri.csf(:)))); end i.e. it fuses gray+white+csf into a single black-white 3-D volume that represents the skull content. Around that part of the 3-D volume the triangulation is constructed. Note that the mri.transform has to be correct and match with the headcoordinates of the gradiometers (you can use VOLUMEREALIGN if the coordinates are not properly aligned yet). Robert From levy at NMR.MGH.HARVARD.EDU Thu Mar 22 17:44:25 2007 From: levy at NMR.MGH.HARVARD.EDU (Robert Levy) Date: Thu, 22 Mar 2007 12:44:25 -0400 Subject: Field Trip and MNE Localization In-Reply-To: Message-ID: Hello, I just discovered Fieldtrip, and it seems like a very powerful tool for spectral analysis of MEG data. Our lab uses Matti Hamalainen's Neuromag MNE tools to localize ERMF generator sources. A spectral analysis feature is in development for these tools, but at present it can be done using Matlab either from scratch or potentially it seems with the help Fieldtrip. So as not to attempt reinventing the wheel I was wondering if anyone here has used Fieldtrip in conjunction with the Neuromag tools to both localize MEG data and analyze it spectrally. If anyone has done this already I would appreciate any suggestions, pointers or references to papers. Thanks, Rob From christoph.braun at UNI-TUEBINGEN.DE Thu Mar 22 18:21:43 2007 From: christoph.braun at UNI-TUEBINGEN.DE (Dr. Christoph Braun) Date: Thu, 22 Mar 2007 18:21:43 +0100 Subject: Postdoc position at the MEG-Center in T=?ISO-8859-15?Q?=FCbingen?= , Germany Message-ID: *Postdoctoral position in a "Bernstein Cooperation Project" related to voluntary control of brain activity* *for three years * The MEG-Center of the University of Tübingen offers a postdoc position in neuroscience. The candidate should have received a PhD in neuroscience, physics, mathematics, bio-informatics, medicine, psychology, or other disciplines related to studies in human neuroscience. The project investigates decoding of movement-related brain signals in close collaboration with the "Bernstein Center for Computational Neuroscience" of Freiburg. The project aims to improve neuronal decoding by voluntary modulation of brain signals using MEG and EEG recordings. Experience in psycho- and physiological experimentation and in the analysis of neurophysiological data is requested. Since the project requires intensive exchange with our cooperation partner, the candidate should be skilled in project organization and team-work. Salary is according to the German TV-L E13 (previously BAT IIa) which is about 43.000 € gross pay per year. The appointment is for a term of three years. Applicants should send an email including a statement of their research background and interests. Furthermore, a curriculum vitae, publication record and a list of scientific talks is requested. Finally three references should be provided. In case of questions and for your application please contact Dr. Christoph Braun, MEG-Center, Otfried-Müller-Str. 47, 72076 Tübingen, Germany. Email: christoph.braun at uni-tuebingen.de . Applications should be handed in before 15^th April 2007. -- Christoph Braun MEG-Zentrum Universität Tübingen Otfried-Müller-Str. 47 Telefon: +49(0)7071-2987705 Fax: +49(0)7071-295706 email: christoph.braun at uni-tuebingen.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From muthuraman10 at HOTMAIL.COM Thu Mar 22 18:38:17 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Thu, 22 Mar 2007 17:38:17 +0000 Subject: coherence in TFR! Message-ID: Hello Fieldtrippers, Is there way to plot the coherence in the TFR representation after using the 'mtmconvol' method with the output configuration 'powandcsd'. Thanking you With regards M.Muthuraman. _________________________________________________________________ Catch all the cricketing action right here. Live score, match reports, photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 22 19:44:05 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 22 Mar 2007 19:44:05 +0100 Subject: coherence in TFR!!! In-Reply-To: Message-ID: Yes, it is possible to plot coherence. Compute the coherence-spectrum using freqdescriptives, and plot it with topoplotTFR, setting cfg.zparam = 'cohspctrm', and specifying a cfg.cohrefchannel. It's documented in the help of topoplotTFR, which you can read, when you open the corresponding m-file, or type 'help topoplotTFR' on the commandline. JM -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Thursday, March 22, 2007 6:38 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] coherence in TFR! Hello Fieldtrippers, Is there way to plot the coherence in the TFR representation after using the 'mtmconvol' method with the output configuration 'powandcsd'. Thanking you With regards M.Muthuraman. _________________________________________________________________ Catch all the cricketing action right here. Live score, match reports, photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx From conrado.bosman at GMAIL.COM Fri Mar 23 13:47:04 2007 From: conrado.bosman at GMAIL.COM (Conrado Bosman) Date: Fri, 23 Mar 2007 13:47:04 +0100 Subject: Problem to configurate electrode positions for freqstatistic analysis Message-ID: Dear Fieldtrippers, I am currently analyzing some old EEG data., butI have some problems to define the electrode configuration to run clusterrandanalysis or freqstatistics. All data were register in a Neuroscan equipment with a strange configuration of 80 channels that is not easy to find in the internet or in the Neuroscan website. However, using the script prepare_layout, I could get a .lay file with the positions, that is very useful to make topographies, but I am not able to use this file to define electrode position for statistical analysis. My question is: Is there any way to obtain a cfg.elec configuration starting from the .lay file so i could use with freqstatistics? Thanks in advance, -- Conrado From maris at NICI.RU.NL Fri Mar 23 13:59:05 2007 From: maris at NICI.RU.NL (Eric Maris) Date: Fri, 23 Mar 2007 13:59:05 +0100 Subject: Problem to configurate electrode positions for freqstatistic analysis In-Reply-To: Message-ID: Hi Conrado, > I am currently analyzing some old EEG data., butI have some problems > to define the electrode configuration to run clusterrandanalysis or > freqstatistics. All data were register in a Neuroscan equipment with a > strange configuration of 80 channels that is not easy to find in the > internet or in the Neuroscan website. However, using the script > prepare_layout, I could get a .lay file with the positions, that is > very useful to make topographies, but I am not able to use this file > to define electrode position for statistical analysis. My question is: > > Is there any way to obtain a cfg.elec configuration starting from the > .lay file so i could use with freqstatistics? I think not, because the .lay file contains coordinates in a plane, whereas the cfg.elec structure must contain coordinates in 3 dimensions. You can construct the neighborhood-structure manually. This is described in the help documentation of clusterrandanalysis (and in one of the subfunctions that is called by freqstatistics). This is a boring job and takes a couple of hours, but it may well be the most time-efficient approach. Good luck, Eric Maris From ulla.rantakokko at TKK.FI Fri Mar 23 15:04:46 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Fri, 23 Mar 2007 15:04:46 +0100 Subject: Layout lay Message-ID: Hello, Concerning the layout created with lay=prepare_layout(cfg, data), where data is from preprocessing and FT version is 20070320 (for sure, previous deleted), I still get: multiplotTFR(cfg, TFRspect); creating layout from data.grad creating layout for neuromag306 system ??? Reference to non-existent field 'lbl'. Error in ==> multiplotTFR at 275 k = cellstrmatch('COMNT',lay.lbl); >> ...from before..: suggest that you are using an FT version which predates the key changes made on 14.03.2007. It should be fine in the latest version. >>>>>>>>>> Regards Ulla From c.hesse at FCDONDERS.RU.NL Fri Mar 23 15:16:02 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Fri, 23 Mar 2007 15:16:02 +0100 Subject: Layout lay In-Reply-To: Message-ID: Hi Ulla, the changes in PREPARE_LAYOUT (which is the "key" function here) were made on 21.03.2007 (see recent changes at http://www2.ru.nl/fcdonders/ fieldtrip/doku.php?id=fieldtrip) the day after your newest FT version. If it does not work with the absolute newest version either, then please let me know. Regards, Christian On 23 Mar 2007, at 15:04, Ulla Rantakokko wrote: > Hello, > > Concerning the layout created with > lay=prepare_layout(cfg, data), > where data is from preprocessing and FT version is 20070320 (for sure, > previous deleted), > > I still get: > > multiplotTFR(cfg, TFRspect); > creating layout from data.grad > creating layout for neuromag306 system > ??? Reference to non-existent field 'lbl'. > > Error in ==> multiplotTFR at 275 > k = cellstrmatch('COMNT',lay.lbl); > > >>> ...from before..: > suggest that you are using an FT version which predates > the key changes made on 14.03.2007. It should be fine in the latest > version. >>>>>>>>>>> > > Regards > > Ulla > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From muthuraman10 at HOTMAIL.COM Fri Mar 23 16:43:44 2007 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Fri, 23 Mar 2007 15:43:44 +0000 Subject: coherence in TFR!!! In-Reply-To: <000301c76cb2$113e42e0$902dae83@fcdonders.nl> Message-ID: Hello Filedtripers, Thanks for the reply, and when i use the fdTFRmult = freqdescriptives([], TFRmult); to calculate the coherence after the time frequency analysis i get all the values of coherence to be 1.0. Is there any other configuration steps need to be followed in fieldtrip before calculating the coherence from the 'mtmconvol' method. Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It�s cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in From Brian.Roach at YALE.EDU Fri Mar 23 16:47:22 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Fri, 23 Mar 2007 11:47:22 -0400 Subject: coherence in TFR!!! In-Reply-To: Message-ID: You're not running on the average, are you? That would give coherence of 1. At 11:43 AM 3/23/2007, you wrote: >Hello Filedtripers, > >Thanks for the reply, and when i use the >fdTFRmult = freqdescriptives([], TFRmult); to calculate the >coherence after the time frequency analysis i get all the values of >coherence to be 1.0. > >Is there any other configuration steps need to be followed in fieldtrip >before calculating the coherence >from the 'mtmconvol' method. > > >Thanking you > >With regards >M.Muthuraman. > >_________________________________________________________________ >Tried the new MSN Messenger? It's cool! Download now. >http://messenger.msn.com/Download/Default.aspx?mkt=en-in > From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 23 16:54:33 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 23 Mar 2007 16:54:33 +0100 Subject: coherence in TFR!!!!! In-Reply-To: Message-ID: Hi Muthumaran, I agree with Brian. In fact, there are two other ways to achieve a coherence of 1: 1) the two signals you are computing the coherence for, are identical 2) you data-structure only specifies one trial (which you achieve when running the analysis on the average) I guess that the second way applies to your data. In this context, it does not make sense to compute coherence, because by definition it will be 1. In either case, there is nothing fieldtrip can do for you. Your data should be defined such, that it makes sense to compute coherence. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Friday, March 23, 2007 4:44 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] coherence in TFR!!! Hello Filedtripers, Thanks for the reply, and when i use the fdTFRmult = freqdescriptives([], TFRmult); to calculate the coherence after the time frequency analysis i get all the values of coherence to be 1.0. Is there any other configuration steps need to be followed in fieldtrip before calculating the coherence from the 'mtmconvol' method. Thanking you With regards M.Muthuraman. _________________________________________________________________ Tried the new MSN Messenger? It's cool! Download now. http://messenger.msn.com/Download/Default.aspx?mkt=en-in From sameer at ANDREW.CMU.EDU Fri Mar 23 17:18:54 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Fri, 23 Mar 2007 12:18:54 -0400 Subject: volumesegment has spm2 related memory issues Message-ID: Hi, When I run >> [segment] = volumesegment(cfg,mri) I get memory problems at a particular line in a spm2 matlab file. The error message is : performing the segmentation on the specified volume ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> spm_smoothto8bit>smoothto8bit at 41 buff = zeros([V.dim(1:2) r{3}.s*2+1]); On printing out these numbers, I find that spm2 is attempting to create a file Of size (256 x 256 x 23783). Has anyone else has had these kind of problems with spm2? Or is there (this is more likely) my problem with implementation. The information about mri is: >> mri mri = dim: [256 256 256] anatomy: [256x256x256 uint8] hdr: [1x1 struct] transform: [4x4 double] Thanks a lot. best, sameer From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 23 20:57:39 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 23 Mar 2007 20:57:39 +0100 Subject: volumesegment has spm2 related memory issues In-Reply-To: Message-ID: Dear Sameer, To give a short answer to your question: I never noticed a problem like this. I indeed think, that there is something not completely correct with the input. Let have a look at the code together to get a clue what might go wrong. You were on the good track working out the numbers, but let's pursue it a bit further: >Error in ==> spm_smoothto8bit>smoothto8bit at 41 >buff = zeros([V.dim(1:2) r{3}.s*2+1]); > >On printing out these numbers, I find that spm2 is attempting to create a >file >Of size (256 x 256 x 23783). The number 23783 likely causes the problem, because it's rather big. Apparently, r{3}.s*2+1 = 23783. So what is r{3}.s? Clearly this amounts to 11891. When we have a look into the for-loop, preceding the line which causes the crash, we see that r{3}.s = ceil(3.5*sqrt(s(i))). So, the variable s(i) (as an element of the 1x3-vector) is about 1.15e7. A few lines up, it says that s = (fwhm./vx./sqrt(8*log(2)) + eps).^2 Let's forget about eps (which is the numerical round-off error), some juggling with the numbers leads to fwhm./vx being [8000 8000 8000]. Typically fwhm = [8 8 8] (in mm), so vx in your case was something like 0.001. And this vx is derived from a variable V.mat, which is the affine-matrix which came along with the volume the function tries to smooth. This affine-matrix is needed to interpret the voxels in terms of a physical coordinate system. Importantly, since the smoothing kernel is defined in mm, the mapping which this matrix brings about, should also be defined in mm. Because there's a factor 1000 difference here, I suspect that your matrix has metres as a unit, instead of mm. The V.mat variable is taken from the input-mri, and is equal to mri.transform. Apparently, implicitly it assumes it to be defined in mm. So for now, I'd suggest to massage this mri.transform a bit such that starts to behave nicely. I guess it should be something like mri.transform(1:3,:) = 1000.*mri.transform(1:3,:); Then you should have a look at mri.transform(1:3,1:3). If you have a 1mm resolution mri, then sqrt(sum(mri.transform(1:3,1:3).^2)) should be one-ish. Good luck, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Friday, March 23, 2007 5:19 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] volumesegment has spm2 related memory issues Hi, When I run >> [segment] = volumesegment(cfg,mri) I get memory problems at a particular line in a spm2 matlab file. The error message is : performing the segmentation on the specified volume ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> spm_smoothto8bit>smoothto8bit at 41 buff = zeros([V.dim(1:2) r{3}.s*2+1]); On printing out these numbers, I find that spm2 is attempting to create a file Of size (256 x 256 x 23783). Has anyone else has had these kind of problems with spm2? Or is there (this is more likely) my problem with implementation. The information about mri is: >> mri mri = dim: [256 256 256] anatomy: [256x256x256 uint8] hdr: [1x1 struct] transform: [4x4 double] Thanks a lot. best, sameer From ulla.rantakokko at TKK.FI Tue Mar 27 12:03:46 2007 From: ulla.rantakokko at TKK.FI (Ulla Rantakokko) Date: Tue, 27 Mar 2007 12:03:46 +0200 Subject: Layout lay Message-ID: Hi Christian I reloaded the version: File: fieldtrip-20070320.zip 1665 KB 03/20/2007 08:06:00 PM which is the most resent version accessible at the moment. However, >> multiplotTFR(cfg, TFRwave); reverting to 151 channel CTF default when using lay as cfg.layout. Regards, Ulla Hi Ulla, the changes in PREPARE_LAYOUT (which is the "key" function here) were made on 21.03.2007 (see recent changes at http://www2.ru.nl/fcdonders/ fieldtrip/doku.php?id=fieldtrip) the day after your newest FT version. If it does not work with the absolute newest version either, then please let me know. Regards, Christian From c.hesse at FCDONDERS.RU.NL Wed Mar 28 11:58:06 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Wed, 28 Mar 2007 11:58:06 +0200 Subject: Layout lay In-Reply-To: Message-ID: Hi Ulla, there was a temporary (accidental) suspension of FT daily updates since 20.03.2007, which has just been spotted and stopped. The latest version of FT is available on the FTP-server NOW, so please download and let me know if the layout bugs persist. Regards, Christian On 23 Mar 2007, at 15:04, Ulla Rantakokko wrote: > Hello, > > Concerning the layout created with > lay=prepare_layout(cfg, data), > where data is from preprocessing and FT version is 20070320 (for sure, > previous deleted), > > I still get: > > multiplotTFR(cfg, TFRspect); > creating layout from data.grad > creating layout for neuromag306 system > ??? Reference to non-existent field 'lbl'. > > Error in ==> multiplotTFR at 275 > k = cellstrmatch('COMNT',lay.lbl); > > >>> ...from before..: > suggest that you are using an FT version which predates > the key changes made on 14.03.2007. It should be fine in the latest > version. >>>>>>>>>>> > > Regards > > Ulla > ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brian.Roach at YALE.EDU Thu Mar 29 01:07:37 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Wed, 28 Mar 2007 19:07:37 -0400 Subject: source analysis attempt using DICS method Message-ID: Attached is the output from a call to sourceinterp on source analysis output data. I am trying to use the DICS method, but my output looks nothing like the tutorial pictures. I am including what I believe to be the relevant code, and advice on the source of my mistake(s) would be appreciated: [EEG com] = pop_loadbv('/home/bjr39/FTsource', 'B22001hal.vhdr') EEG1 = pop_select(EEG) help eeglab2fieldtrip data = eeglab2fieldtrip(EEG1, 'preprocessing') %%% there is some code which I have not included that string matches my electrodes and uses coordinate that put the sites in MNI space according to the coordinates listed here:http://oase.uci.ru.nl/~roberto/electrode/realistic_1005.txt %%% cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [5 100]; cfg.tapsmofrq = 2; cfg.foilim = [35 45]; freq = freqanalysis(cfg, data) cfg = []; cfg.method = 'dics'; cfg.frequency = 40; cfg.hdmfile = '/home/bjr39/FTsource/vol.mat'; cfg.resolution = 2 pack;source = sourceanalysis(cfg, freq) sourcePost = sourcedescriptives([], source) cfg =[]; cfg.downsample = 2; cfg.funparameter = 'nai'; cfg.colmin = 'auto'; cfg.colmax = 'auto'; sourcePostF = source2full(sourcePost); sliceinterp(cfg,sourceInterp); I can share more info if it will help, related to the size of different data structures, or whatever anyone would need to know. I followed the guide for head model creation and plotted it at various points (one plot previously posted to the list). Could a poor head model create this problem? thanks, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TestSourceAnalysis.png Type: application/octet-stream Size: 278081 bytes Desc: not available URL: From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 29 08:29:06 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 29 Mar 2007 08:29:06 +0200 Subject: source analysis attempt using DICS method In-Reply-To: <6.1.2.0.2.20070328185248.01c377a0@email.med.yale.edu> Message-ID: Dear Brian, Allow me to point you to a quite related problem which has been posted by Nathan about a month ago. I think it was the beginning of March. You can browse through the discussion list's history when you go to the fieldtrip-website and click around a bit at the appropriate links. Even though the question here was related to LCMV-beamformer, the problems might have the same cause. Following Nathan's thread, a very likely cause is the incorrect specification of cfg.mriunits, and cfg.sourceunits prior to calling sourceinterpolate (I did not find back in the code you sent in your mail that you actually called it, but I assume you did). If not specified, fieldtrip puts cfg.mriunits to 'mm', and cfg.sourceunits to 'cm'. There might be a discrepancy in your data there. Perhaps you even explicitly have to check, whether your headmodel (in hdmfile) is defined in cm. At least the dipole-grid on which sourceanalysis performs the beamformer-scanning is defined in cm, and I guess the units should be identical here as well. Good luck, Jan-Mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Brian Roach Sent: Thursday, March 29, 2007 1:08 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] source analysis attempt using DICS method Attached is the output from a call to sourceinterp on source analysis output data. I am trying to use the DICS method, but my output looks nothing like the tutorial pictures. I am including what I believe to be the relevant code, and advice on the source of my mistake(s) would be appreciated: [EEG com] = pop_loadbv('/home/bjr39/FTsource', 'B22001hal.vhdr') EEG1 = pop_select(EEG) help eeglab2fieldtrip data = eeglab2fieldtrip(EEG1, 'preprocessing') %%% there is some code which I have not included that string matches my electrodes and uses coordinate that put the sites in MNI space according to the coordinates listed here:http://oase.uci.ru.nl/~roberto/electrode/realistic_1005.txt %%% cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [5 100]; cfg.tapsmofrq = 2; cfg.foilim = [35 45]; freq = freqanalysis(cfg, data) cfg = []; cfg.method = 'dics'; cfg.frequency = 40; cfg.hdmfile = '/home/bjr39/FTsource/vol.mat'; cfg.resolution = 2 pack;source = sourceanalysis(cfg, freq) sourcePost = sourcedescriptives([], source) cfg =[]; cfg.downsample = 2; cfg.funparameter = 'nai'; cfg.colmin = 'auto'; cfg.colmax = 'auto'; sourcePostF = source2full(sourcePost); sliceinterp(cfg,sourceInterp); I can share more info if it will help, related to the size of different data structures, or whatever anyone would need to know. I followed the guide for head model creation and plotted it at various points (one plot previously posted to the list). Could a poor head model create this problem? thanks, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Thu Mar 29 13:59:42 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Thu, 29 Mar 2007 04:59:42 -0700 Subject: problem on wavelet analysis In-Reply-To: <005c01c771cb$8d631850$902dae83@fcdonders.nl> Message-ID: Dear experts, Could you give me ome suggestion for wavelet analysis? These parameters are OK in EEG data I count using ohter software. I don't think it's different for MEG data but the error happened... >> cfg=[]; >> cfg.sgn='MEG'; >> cfg.method='wltconvol'; >> cfg.width=3; >> cfg.foi=4:1:30; >> cfg.toi=-0.4:0.05:1.4; >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis_wltconvol.m On line 234 ==> if csdflg, crsspctrm = complex(zeros(numsgncmb,numfoi,numtoi)); end Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); Any suggestions are appreciated. Best, Eve --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Mar 29 15:24:57 2007 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Mar 2007 15:24:57 +0200 Subject: source analysis attempt using DICS method In-Reply-To: <005c01c771cb$8d631850$902dae83@fcdonders.nl> Message-ID: On 29 Mar 2007, at 8:29, Jan Mathijs Schoffelen wrote: > a very likely cause is the incorrect specification of cfg.mriunits, > and cfg.sourceunits prior to calling sourceinterpolate (I did not > find back in the code you sent in your mail that you actually > called it, but I assume you did). If not specified, fieldtrip puts > cfg.mriunits to ‘mm’, and cfg.sourceunits to ‘cm’. There might be a > discrepancy in your data there. Perhaps you even explicitly have to > check, whether your headmodel (in hdmfile) is defined in cm. At > least the dipole-grid on which sourceanalysis performs the > beamformer-scanning is defined in cm, and I guess the units should > be identical here as well. The standard BEM EEG volume conduction model that you might have copied from EEGLAB is one that is based on the MNI template brain. It is in MNI coordinates (linked to the AC and PC) and the units are in mm (corresponding with SPM standards). Robert From sameer at ANDREW.CMU.EDU Thu Mar 29 16:20:56 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 29 Mar 2007 10:20:56 -0400 Subject: NANs in Time frequency analysis. Message-ID: Hi, I am using the following settng to run time frequency analysis. cfgTFR = []; cfgTFR.output = 'pow'; cfgTFR.channel = 'MEG'; cfgTFR.method = 'mtmconvol'; cfgTFR.foi = 05 : 2 : 35; cfgTFR.t_ftimwin = 5./cfgTFR.foi; cfgTFR.tapsmofrq = 0.4 *cfgTFR.foi; cfgTFR.toi = 1:0.05:2.5; cfgTFR.pad = 'maxperlen'; TFRmult = freqanalysis(cfgTFR, data); and find that the TFRplots for all channels (plottd using multiplot) are always deep blue in the high time end, especially at low frequencies. Inspection of TFR mult shows many NANs in the corresponding time regions. Does anyone has any ideas about this? thanks for your reply. best, sameer From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 29 16:34:31 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 29 Mar 2007 16:34:31 +0200 Subject: NANs in Time frequency analysis. In-Reply-To: Message-ID: Dear Sameer, A nan is given back at those time-frequency points at which no value can be estimated. This means that at the toi-foi pairs you specified in your configuration, the corresponding timewindow as specified in t_ftimwin cannot be completely filled with data. In your case, I therefore expect this 'problem' to be worse for the lower frequencies. It might seem a sorry answer, but this is just a thing you have to live with. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Sameer Walawalkar Sent: Thursday, March 29, 2007 4:21 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] NANs in Time frequency analysis. Hi, I am using the following settng to run time frequency analysis. cfgTFR = []; cfgTFR.output = 'pow'; cfgTFR.channel = 'MEG'; cfgTFR.method = 'mtmconvol'; cfgTFR.foi = 05 : 2 : 35; cfgTFR.t_ftimwin = 5./cfgTFR.foi; cfgTFR.tapsmofrq = 0.4 *cfgTFR.foi; cfgTFR.toi = 1:0.05:2.5; cfgTFR.pad = 'maxperlen'; TFRmult = freqanalysis(cfgTFR, data); and find that the TFRplots for all channels (plottd using multiplot) are always deep blue in the high time end, especially at low frequencies. Inspection of TFR mult shows many NANs in the corresponding time regions. Does anyone has any ideas about this? thanks for your reply. best, sameer From sameer at ANDREW.CMU.EDU Thu Mar 29 16:39:22 2007 From: sameer at ANDREW.CMU.EDU (Sameer Walawalkar) Date: Thu, 29 Mar 2007 10:39:22 -0400 Subject: NANs in Time frequency analysis. In-Reply-To: <007f01c7720f$5d4d4750$902dae83@fcdonders.nl> Message-ID: Thanks Jan-Mathijs, That was my expectation given how TFRs are calculated. sameer On Thu, 29 Mar 2007, Jan Mathijs Schoffelen wrote: > Dear Sameer, > > A nan is given back at those time-frequency points at which no value can be > estimated. This means that at the toi-foi pairs you specified in your > configuration, the corresponding timewindow as specified in t_ftimwin cannot > be completely filled with data. In your case, I therefore expect this > 'problem' to be worse for the lower frequencies. It might seem a sorry > answer, but this is just a thing you have to live with. > > Yours, > > Jan-Mathijs > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf > Of Sameer Walawalkar > Sent: Thursday, March 29, 2007 4:21 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] NANs in Time frequency analysis. > > Hi, > > I am using the following settng to run time frequency analysis. > > cfgTFR = []; > cfgTFR.output = 'pow'; > cfgTFR.channel = 'MEG'; > cfgTFR.method = 'mtmconvol'; > cfgTFR.foi = 05 : 2 : 35; > cfgTFR.t_ftimwin = 5./cfgTFR.foi; > cfgTFR.tapsmofrq = 0.4 *cfgTFR.foi; > cfgTFR.toi = 1:0.05:2.5; > cfgTFR.pad = 'maxperlen'; > > TFRmult = freqanalysis(cfgTFR, data); > > and find that the TFRplots for all channels (plottd using multiplot) are > always deep blue in the high time end, especially at low frequencies. > > Inspection of TFR mult shows many NANs in the corresponding time regions. > > Does anyone has any ideas about this? > > thanks for your reply. > > best, > sameer > > From alotof_xd at YAHOO.COM Fri Mar 30 05:48:06 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Thu, 29 Mar 2007 20:48:06 -0700 Subject: problem on wavelet analysis, combine channel Message-ID: Dear experts, I checked the script of freqanalysis_wltconvol and founf the default for output was 'powandcsd'. This output needs combine channels. My meuromag data seems has problem on something related "combine channels". It works when I change output as 'pow'. However, I wonder what might happen when using combining channels? I suppose it relates layout? Thanks for suggestion. Best, Eve alotof eve wrote: Date: Thu, 29 Mar 2007 04:59:42 -0700 From: alotof eve Subject: [FIELDTRIP] problem on wavelet analysis To: FIELDTRIP at NIC.SURFNET.NL Dear experts, Could you give me ome suggestion for wavelet analysis? These parameters are OK in EEG data I count using ohter software. I don't think it's different for MEG data but the error happened... >> cfg=[]; >> cfg.sgn='MEG'; >> cfg.method='wltconvol'; >> cfg.width=3; >> cfg.foi=4:1:30; >> cfg.toi=-0.4:0.05:1.4; >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis_wltconvol.m On line 234 ==> if csdflg, crsspctrm = complex(zeros(numsgncmb,numfoi,numtoi)); end Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); Any suggestions are appreciated. Best, Eve --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. --------------------------------- 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alotof_xd at YAHOO.COM Fri Mar 30 09:21:18 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Fri, 30 Mar 2007 00:21:18 -0700 Subject: sensortype Message-ID: Sorry for sending so many emails. The error for combine channel is due to sensortype.m cannot get my neuromag data type. I checked the length(grad.label). It's 612, double of 306 which is supposed. How can I settle it? Thanks in advance. Best, Eve alotof eve wrote: Date: Thu, 29 Mar 2007 20:48:06 -0700 From: alotof eve Subject: [FIELDTRIP] problem on wavelet analysis, combine channel To: FIELDTRIP at NIC.SURFNET.NL Dear experts, I checked the script of freqanalysis_wltconvol and founf the default for output was 'powandcsd'. This output needs combine channels. My meuromag data seems has problem on something related "combine channels". It works when I change output as 'pow'. However, I wonder what might happen when using combining channels? I suppose it relates layout? Thanks for suggestion. Best, Eve alotof eve wrote: Date: Thu, 29 Mar 2007 04:59:42 -0700 From: alotof eve Subject: [FIELDTRIP] problem on wavelet analysis To: FIELDTRIP at NIC.SURFNET.NL Dear experts, Could you give me ome suggestion for wavelet analysis? These parameters are OK in EEG data I count using ohter software. I don't think it's different for MEG data but the error happened... >> cfg=[]; >> cfg.sgn='MEG'; >> cfg.method='wltconvol'; >> cfg.width=3; >> cfg.foi=4:1:30; >> cfg.toi=-0.4:0.05:1.4; >> TFRwave_PA_A=freqanalysis(cfg, PA_A_fildata); ??? Error using ==> zeros Out of memory. Type HELP MEMORY for your options. Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis_wltconvol.m On line 234 ==> if csdflg, crsspctrm = complex(zeros(numsgncmb,numfoi,numtoi)); end Error in ==> C:\MATLAB6p5\toolbox\fieldtrip-20070328\freqanalysis.m On line 170 ==> [freq] = feval(sprintf('freqanalysis_%s',lower(cfg.method)), cfg, data); Any suggestions are appreciated. Best, Eve --------------------------------- Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. --------------------------------- 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut. --------------------------------- Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From weisz at LYON.INSERM.FR Fri Mar 30 09:31:17 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Fri, 30 Mar 2007 09:31:17 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <50358.94104.qm@web56614.mail.re3.yahoo.com> Message-ID: hi eve, i'm not too familiar with the fieldtrip specifications, but: > Out of memory. Type HELP MEMORY for your options. do you have enough RAM? this would then not be a real fieldtrip problem, but a rather common problem generally when using matlab. good luck! nathan From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 30 09:38:15 2007 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 30 Mar 2007 09:38:15 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <8B34AB95-3A47-4E90-9F37-33DFB292296B@lyon.inserm.fr> Message-ID: Dear Eve, I totally agree with Nathan. Specifying (unintended, but still... ;o) ) 'powandcsd', in particular in combination with a spectro-temporal reconstruction really blows up your memory requirements. Especially when (again probably unintended) you are computing csd's for all channelcombination. I'll leave it up to you to calculate how many bytes are needed only to represent your output csd-matrix in memory. Some hints: -each double precision number requires 8 bytes of memory in matlab -each complex number consists of two double precision numbers -(numberoftrials)x(numberofchannelcombinations)x(numberoffrequencypoints)x (numberoftimepoints) can become really big. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Friday, March 30, 2007 9:31 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem on wavelet analysis, combine channel hi eve, i'm not too familiar with the fieldtrip specifications, but: > Out of memory. Type HELP MEMORY for your options. do you have enough RAM? this would then not be a real fieldtrip problem, but a rather common problem generally when using matlab. good luck! nathan From alotof_xd at YAHOO.COM Fri Mar 30 15:49:35 2007 From: alotof_xd at YAHOO.COM (alotof eve) Date: Fri, 30 Mar 2007 06:49:35 -0700 Subject: problem on wavelet analysis, combine channel In-Reply-To: <001201c7729e$60b2ac70$902dae83@fcdonders.nl> Message-ID: Dear Jan and Nathan, Thank you so much. But I am 80 percent sure it's not a common memory problem. My computer is 1GB of RAM. And if I don't use combination, I can select very fine parameters for wavelet analysis. My data is neuromag .fif data. I suppose something wrong with the channel counting. Thanks. Best, eve Jan Mathijs Schoffelen wrote: Dear Eve, I totally agree with Nathan. Specifying (unintended, but still... ;o) ) 'powandcsd', in particular in combination with a spectro-temporal reconstruction really blows up your memory requirements. Especially when (again probably unintended) you are computing csd's for all channelcombination. I'll leave it up to you to calculate how many bytes are needed only to represent your output csd-matrix in memory. Some hints: -each double precision number requires 8 bytes of memory in matlab -each complex number consists of two double precision numbers -(numberoftrials)x(numberofchannelcombinations)x(numberoffrequencypoints)x (numberoftimepoints) can become really big. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Friday, March 30, 2007 9:31 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] problem on wavelet analysis, combine channel hi eve, i'm not too familiar with the fieldtrip specifications, but: > Out of memory. Type HELP MEMORY for your options. do you have enough RAM? this would then not be a real fieldtrip problem, but a rather common problem generally when using matlab. good luck! nathan --------------------------------- Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. -------------- next part -------------- An HTML attachment was scrubbed... URL: From weisz at LYON.INSERM.FR Fri Mar 30 16:23:47 2007 From: weisz at LYON.INSERM.FR (Nathan Weisz) Date: Fri, 30 Mar 2007 16:23:47 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <419502.11257.qm@web56614.mail.re3.yahoo.com> Message-ID: hi eve, > Thank you so much. But I am 80 percent sure it's not a common > memory problem. this leaves 20% uncertainty :-) taking jans' formula: > -(numberoftrials)x(numberofchannelcombinations)x > (numberoffrequencypoints)x > (numberoftimepoints) and assuming for simlicity you have 100 trials (... 302 channels, right). > ((100*90600*27*21)*16)/c(10^9) #90600 equals to number of all pairwise channel combinations [1] 82.19232 1GB RAM is not much help here for such a beast (and probably the lower limit when doing MEG-analysis), if i have no fundamental misunderstanding here. do you really need 'powandcsd'? why don't you first do the 'pow'- thing, look what's interesting (perhaps some stats) and then redo the freqanalysis with 'powandcsd' on time-frequency points of interest, taking account of your RAM. all the best, nathan From c.hesse at FCDONDERS.RU.NL Fri Mar 30 17:22:54 2007 From: c.hesse at FCDONDERS.RU.NL (Christian Hesse) Date: Fri, 30 Mar 2007 17:22:54 +0200 Subject: problem on wavelet analysis, combine channel In-Reply-To: <419502.11257.qm@web56614.mail.re3.yahoo.com> Message-ID: Hi Eve, just to chip in here: what (in simple terms) do you want to achieve using wavelet analysis of your data? What do you ultimately want to plot? Christian On 30 Mar 2007, at 15:49, alotof eve wrote: > Dear Jan and Nathan, > > Thank you so much. But I am 80 percent sure it's not a common > memory problem. My computer is 1GB of RAM. And if I don't use > combination, I can select very fine parameters for wavelet > analysis. My data is neuromag .fif data. I suppose something wrong > with the channel counting. > Thanks. > > Best, > eve > > Jan Mathijs Schoffelen wrote: > Dear Eve, > > I totally agree with Nathan. Specifying (unintended, but > still... ;o) ) > 'powandcsd', in particular in combination with a spectro-temporal > reconstruction really blows up your memory requirements. Especially > when > (again probably unintended) you are computing csd's for all > channelcombination. I'll leave it up to you to calculate how many > bytes are > needed only to represent your output csd-matrix in memory. > Some hints: > -each double precision number requires 8 bytes of memory in matlab > -each complex number consists of two double precision numbers > -(numberoftrials)x(numberofchannelcombinations)x > (numberoffrequencypoints)x > (numberoftimepoints) can become really big. > > Yours, > > Jan-Mathijs > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Nathan Weisz > Sent: Friday, March 30, 2007 9:31 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] problem on wavelet analysis, combine channel > > hi eve, > > i'm not too familiar with the fieldtrip specifications, but: > > > Out of memory. Type HELP MEMORY for your options. > > do you have enough RAM? > > this would then not be a real fieldtrip problem, but a rather common > problem generally when using matlab. > > good luck! > > nathan > > > Expecting? Get great news right away with email Auto-Check. > Try the Yahoo! Mail Beta. ---------------------------------------------------------------------- Christian Hesse, PhD, MIEEE F.C. Donders Centre for Cognitive Neuroimaging P.O. Box 9101 NL-6500 HB Nijmegen The Netherlands Tel.: +31 (0)24 36 68293 Fax: +31 (0)24 36 10989 Email: c.hesse at fcdonders.ru.nl Web: www.fcdonders.ru.nl ---------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brian.Roach at YALE.EDU Fri Mar 30 18:44:38 2007 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Fri, 30 Mar 2007 12:44:38 -0400 Subject: source analysis attempt using DICS method In-Reply-To: <19AD5C31-FFE9-47C6-AE75-0C7B444EA154@fcdonders.ru.nl> Message-ID: Thanks for these replies. I have now specified cfg.mriunits = 'mm' cfg.sourceunits = 'mm' Then, I should re-run sourceinterpolate.m? That seems to produce the new results, but the same new results whether I specify both units as 'cm' or 'mm'. If my MRI is in 'mm' and sourceanalysis.m uses cm, which are you supposed to use? thanks, Brian At 09:24 AM 3/29/2007, Robert Oostenveld wrote: >On 29 Mar 2007, at 8:29, Jan Mathijs Schoffelen wrote: >>a very likely cause is the incorrect specification of cfg.mriunits, >>and cfg.sourceunits prior to calling sourceinterpolate (I did not >>find back in the code you sent in your mail that you actually >>called it, but I assume you did). If not specified, fieldtrip puts >>cfg.mriunits to 'mm', and cfg.sourceunits to 'cm'. There might be a >>discrepancy in your data there. Perhaps you even explicitly have to >>check, whether your headmodel (in hdmfile) is defined in cm. At >>least the dipole-grid on which sourceanalysis performs the >>beamformer-scanning is defined in cm, and I guess the units should >>be identical here as well. > >The standard BEM EEG volume conduction model that you might have >copied from EEGLAB is one that is based on the MNI template brain. It >is in MNI coordinates (linked to the AC and PC) and the units are in >mm (corresponding with SPM standards). > >Robert