From christine.gruetzner at GOOGLEMAIL.COM Wed Jul 1 17:19:29 2009 From: christine.gruetzner at GOOGLEMAIL.COM (Christine Gruetzner) Date: Wed, 1 Jul 2009 17:19:29 +0200 Subject: Beamforming - filter dimensions Message-ID: Dear All, I'm using LCMV beamforming and I have a question regarding the dimensions of the filter. We have two different configurations for LCMV (see below) that result in one-dimensional filters (in the first case) and three-dimensional filters (in the second case). It seems that the only difference between the two configurations is the option cfg.projectmom = 'yes' (in the first configuration) vs. cfg.projectmom = 'no' (in the second configuration). Do you have any idea what makes the difference and why I only get one-dimensional filters in the first configuration? Which would be the correct options to use? Best Christine %------------------------------------------------------------------ configuration 1: cfg = []; % replaced by: fullnameGrid = strcat(mripath, DesignLCMVSources{i,2}); cfg = load(fullnameGrid); cfg.vol = cfg.hdm; %General source computation parameters cfg.method = 'lcmv'; cfg.lambda = 0.05; % regularization of 0.5% cfg.powmethod = 'trace'; % compute rms power per dipolelocation over all available directions cfg.feedback = 'text'; % give feedback on the progress of the calculations cfg.keepfilter = 'yes'; % keep the beamformer filters (virtual electrodes) for later use % % cfg.singletrial = 'yes'; cfg.keepmom = 'yes'; cfg.projectmom = 'yes'; cfg.keeptrial = 'yes'; InFilename = strcat(datapath, DesignLCMVSources{i,1}); load(InFilename); % a variable named TLDataOut must exist in the InFile DataLCMVIn = TLDataOutNew; clear TLDataOutNew; % for clarity of code remove if too slow cfg.cov = DataLCMVIn.cov; DataLCMVOut = sourceanalysis(cfg, DataLCMVIn); %---------------------------------------------------------------------------------------- configuration 2: cfgLCMV=[]; % cfgLCMV.frequency = ... % the bandwidth in LCMV comptations is % chosen in preprocessing (aka FreqLimits) cfgLCMV.grid=ForwardModel.grid; cfgLCMV.vol=ForwardModel.hdm; cfgLCMV.method='lcmv'; % cfgLCMV.projectnoise='yes'; % ??? cfgLCMV.keepfilter='yes'; cfgLCMV.lambda = DICSlambda ; % use the same as for DICS here cfgLCMV.powmethod = 'trace'; cfgLCMV.fixedori = 'no'; cfgLCMV.projectnoise = 'no'; % these filters are for computing virtual electrodes later cfgLCMV.projectmom = 'no'; % computation cfgLCMV.dim=[Nx Ny Nz] disp('running LCMV source analysis for common filters/virtual electrodes') CommonLCMVSources=sourceanalysis(cfgLCMV,CombiTimelockCov) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From fredericroux at HOTMAIL.DE Wed Jul 1 21:07:17 2009 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Wed, 1 Jul 2009 21:07:17 +0200 Subject: Beamforming - filter dimensions Message-ID: Hi Christine, I am wondering if this problem could result from the fact that the grids and headmodels were computed in a different way for each analysis. In your code it says: %for config 1 fullnameGrid = strcat(mripath, DesignLCMVSources{i,2}); cfg = load(fullnameGrid); cfg.vol = cfg.hdm; %for config 2 cfgLCMV.grid=ForwardModel.grid; cfgLCMV.vol=ForwardModel.hdm; Cheers, frederic _________________________________________________________________ http://redirect.gimas.net/?n=M0906xWLHM2 Unbegrenzter Speicher bei Windows Live Hotmail! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredericroux at HOTMAIL.DE Wed Jul 1 21:36:15 2009 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Wed, 1 Jul 2009 21:36:15 +0200 Subject: Beamforming - filter dimensions Message-ID: I found the origin of the difference. You have to specify the option: cfg.dim = [Nx Ny Nz] Otherwise your filters will have only one dimension. _________________________________________________________________ http://redirect.gimas.net/?n=M0906xWLHM2 Unbegrenzter Speicher bei Windows Live Hotmail! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.cook at ULETH.CA Thu Jul 2 02:54:59 2009 From: charles.cook at ULETH.CA (Charles Cook) Date: Thu, 2 Jul 2009 02:54:59 +0200 Subject: Update: Freqstatistics Now Yields (Som e) Significant Clusters Message-ID: Hi Michael, We are interested in determining just that, the presence of spatially and temporally contiguous effects that cross a certain threshold between my two groups (males vs. females) and within them (task 1 vs. task 2). After fully completing the analysis, I was able to find significant clusters in my within groups analysis (e.g. TF differences in male participants, task 1 vs. task 2, using dependent t-test) within a few discrete frequency bands. What we're now interested in doing is beamforming those discrete windows and frequencies that we have found with the cluster analysis in FieldTrip. Is this a feasible approach with the BESA exported TFC files? We had considered exporting VMP files from BESA and beamforming using Brain Voyager but thought that it might be simpler to do this all within FieldTrip. Cheers, Charles On Thu, 25 Jun 2009 12:00:31 +0200, Michael Wibral wrote: >Hi Charles, > >thanks for the update. Cluster based statistics is exactly what the name says: A statistics telling you whether you have spatially and temporally contiguous effects that cross a certain threshold - in sum over the cluster. It is sometimes worth considering, whether this is what you want to test after all. e.g. extended effects of small effect size per electrode but large time/frequency extent and effects of large effect size but small time/frequency extent may have similar cluster statistics. The even compete in the sense that randomizations of the larger of the two (in total cluster sum) may still have larger cluster statistics than the smaller of the two, thus effectively rendering in non-significant. Bear in mind that the only thing really tested is the exchangeability of the data (which is the null hypothesis). That may sometimes make your results more difficult to interpret. You could also try cfg.correctm = 'fdr', to get classical FDR correction, but you may loose sensitivity in some cases. > >One last thing: Check carefully that there is no factor that has been balanced over subjects (e.g. response hand) that may be resorted in the randomizations. For example: half of the subjects report match with the right hand and non-match with the left hand, the other half responding with an inverted assignment. This analysis setup: >1. violates the exchangeability hypothesis from the start (and you know!), but not in the way you wanted to test it - this is a serious error in applying randomization testing... >2. Consequently, it renders all other effects insignificant because the sorted response hand effects in the randomizations most likely exceed any other effect in the unrandomized data. > > >Michael ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Thu Jul 2 11:50:33 2009 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Thu, 2 Jul 2009 11:50:33 +0200 Subject: Update: Freqstatistics Now Yields (Som e) Significant Clusters Message-ID: Hi Charles, beamforming relies on the data (sensor) covariance matrix for the case of LCMV and other time domain beamformers and you get the focus on the desired frequency band by prefiltering For frequency domain beamforming - like DICS - computations rely on the cross spectral density matrix - again computed at the frequencies of interest. I do not think that BESA TFC files contain that information. That said, you can - depending on your Version of BESA and the modules included - use BESA's own beamformer (which allows for two bilateral synchronized sources to be present as an extra feature) and export the .dat file for statistics (I haven't done that myself). But using beamforming in Fieldtrip is also straightforward and very flexible. Let me know if you need help with that. Michael > -----Ursprüngliche Nachricht----- > Von: "Charles Cook" > Gesendet: 02.07.09 02:56:36 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Update: Freqstatistics Now Yields (Som e) Significant Clusters > Hi Michael, > > We are interested in determining just that, the presence of spatially and > temporally contiguous effects that cross a certain threshold between my two > groups (males vs. females) and within them (task 1 vs. task 2). After fully > completing the analysis, I was able to find significant clusters in my > within groups analysis (e.g. TF differences in male participants, task 1 vs. > task 2, using dependent t-test) within a few discrete frequency bands. What > we're now interested in doing is beamforming those discrete windows and > frequencies that we have found with the cluster analysis in FieldTrip. Is > this a feasible approach with the BESA exported TFC files? We had considered > exporting VMP files from BESA and beamforming using Brain Voyager but > thought that it might be simpler to do this all within FieldTrip. > > Cheers, > > Charles > > On Thu, 25 Jun 2009 12:00:31 +0200, Michael Wibral > wrote: > > >Hi Charles, > > > >thanks for the update. Cluster based statistics is exactly what the name > says: A statistics telling you whether you have spatially and temporally > contiguous effects that cross a certain threshold - in sum over the cluster. > It is sometimes worth considering, whether this is what you want to test > after all. e.g. extended effects of small effect size per electrode but > large time/frequency extent and effects of large effect size but small > time/frequency extent may have similar cluster statistics. The even compete > in the sense that randomizations of the larger of the two (in total cluster > sum) may still have larger cluster statistics than the smaller of the two, > thus effectively rendering in non-significant. Bear in mind that the only > thing really tested is the exchangeability of the data (which is the null > hypothesis). That may sometimes make your results more difficult to > interpret. You could also try cfg.correctm = 'fdr', to get classical FDR > correction, but you may loose sensitivity in some cases. > > > >One last thing: Check carefully that there is no factor that has been > balanced over subjects (e.g. response hand) that may be resorted in the > randomizations. For example: half of the subjects report match with the > right hand and non-match with the left hand, the other half responding with > an inverted assignment. This analysis setup: > >1. violates the exchangeability hypothesis from the start (and you know!), > but not in the way you wanted to test it - this is a serious error in > applying randomization testing... > >2. Consequently, it renders all other effects insignificant because the > sorted response hand effects in the randomizations most likely exceed any > other effect in the unrandomized data. > > > > > >Michael > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From wibral at BIC.UNI-FRANKFURT.DE Thu Jul 2 12:09:36 2009 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Thu, 2 Jul 2009 12:09:36 +0200 Subject: Beamforming - filter dimensions Message-ID: Dear Christine, dear Frederic, I think Christine's initial guess was right: The option " cfg.projectmom='yes' " seems to not only project the dipole moment timecourse on the direction of maximal power as it says in the beamformer-lcmv function but also compute an effective 1-D filter coefficient for this purpose and export that if you additionally specify cfg.keepfilters='yes'. To explain things in a little more detail: beamformer_lcmv.m could in principle compute 3D (or 2D for MEG) filters, compute the three timecourses, then compute the vector direction with the maximal power and export that power value but still keep all filter coefficients. But what it does (and what I think is more straight forward) is to do this projection by having a effective filter coefficient for that direction. On the other hand, the option cfg.dim = [Nx Ny Nz] is used to give the results of beamforming some regular dimensions when using reverse warped grids for single subjects like Ingrid does. I actually do not know whether the current versions of fieldtrip still need it. It was there to let sourcegrandaverage and sourcestatistics and the source plotting functions know how to handle results over subjects that had different, non-evenly spaced grids in true space but matching grids when transformed to MNI space (see Ingrid's tutorial/wiki page on this at the fieldtrip website . It simply gives the rectangular dimensions of the common grid in MNI space. Michael > -----Ursprüngliche Nachricht----- > Von: "Frederic Roux" > Gesendet: 01.07.09 21:13:25 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Beamforming - filter dimensions Hi Christine, > > I am wondering if this problem could result from the fact that the > grids and headmodels were computed in a different way for each > analysis. > > In your code it says: > > %for config 1 > fullnameGrid = strcat(mripath, DesignLCMVSources{i,2}); > cfg = load(fullnameGrid); > cfg.vol = cfg.hdm; > > %for config 2 > cfgLCMV.grid=ForwardModel.grid; > cfgLCMV.vol=ForwardModel.hdm; > > Cheers, > frederic > > > Kein Werbe-Blabla - hier klicken! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From wibral at BIC.UNI-FRANKFURT.DE Thu Jul 2 12:25:31 2009 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Thu, 2 Jul 2009 12:25:31 +0200 Subject: MEG lunch at HBM2009/minutes Message-ID: Hi Ole, Thanks for putting together the minutes of the HBM meeting and also for the organization of the meeting altogether. Could you also send around the actual name of the yahoo mailing list? That would help many of us to actually subscribe. Michael > -----Ursprüngliche Nachricht----- > Von: "Ole Jensen" > Gesendet: 30.06.09 22:01:05 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: [FIELDTRIP] MEG lunch at HBM2009/minutes > Dear all, > Attached please find the minutes from the MEG lunch at the HBM2009 meeting. > All the best, > Ole > > -- > Ole Jensen > Principal Investigator > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Office : +31 24 36 10884 > MEG lab : +31 24 36 10988 > > Fax : +31 24 36 10989 > > e-mail : ole.jensen at donders.ru.nl > URL : http://ojensen.ruhosting.nl/ > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From Sara.GonzalezAndino at HCUGE.CH Thu Jul 2 12:57:52 2009 From: Sara.GonzalezAndino at HCUGE.CH (Sara GONZALEZ ANDINO) Date: Thu, 2 Jul 2009 12:57:52 +0200 Subject: Paper Announcement Message-ID: Dear Colleagues, We would like to call your attention to the recent publication: http://www.hindawi.com/journals/cin/2009/659247.html The Neuroelectromagnetic Inverse Problem and the Zero Dipole Localization Error by: Rolando Grave de Peralta, Olaf Hauk and Sara L. Gonzalez Abstract: A tomography of neural sources could be constructed from EEG/MEG recordings once the neuroelectromagnetic inverse problem (NIP) is solved. Unfortunately the NIP lacks a unique solution and therefore additional constraints are needed to achieve uniqueness. Researchers are then confronted with the dilemma of choosing one solution on the basis of the advantages publicized by their authors. This study aims to help researchers to better guide their choices by clarifying what is hidden behind inverse solutions oversold by their apparently optimal properties to localize single sources. Here, we introduce an inverse solution (ANA) attaining perfect localization of single sources to illustrate how spurious sources emerge and destroy the reconstruction of simultaneously active sources. Although ANA is probably the simplest and robust alternative for data generated by a single dominant source plus noise, the main contribution of this manuscript is to show that zero localization error of single sources is a trivial and largely uninformative property unable to predict the performance of an inverse solution in presence of simultaneously active sources. We recommend as the most logical strategy for solving the NIP the incorporation of sound additional a priori information about neural generators that supplements the information contained in the data. best regards rolando www.electrical-neuroimaging.ch ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From bleichner.martin at GMAIL.COM Thu Jul 2 15:39:49 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Thu, 2 Jul 2009 15:39:49 +0200 Subject: frequency resolution of the power spectrum Message-ID: Hi there, this might be a stupid question. I probably miss something obvious. I want to compute the power spectrum over a single trial (around 5 minutes). using this piece of code cfg = []; cfg.method = 'mtmfft'; cfg.output = 'pow'; cfg.foilim = [1 100]; cfg.taper = 'hanning'; freq = freqanalysis(cfg, data); as a result I get freq: [1x62534 double] powspctrm: [96x62534 double] that is a frequency resolution of 0.0032Hz!? What determines the frequency resolution here? What can I do to make it less fine grained? Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.b.dijkman at STUDENT.UTWENTE.NL Thu Jul 2 15:53:44 2009 From: t.b.dijkman at STUDENT.UTWENTE.NL (Thomas Dijkman) Date: Thu, 2 Jul 2009 15:53:44 +0200 Subject: frequency resolution of the power spectrum Message-ID: Hi Martin, The frequency resolution is determined by the length of your trial -> 5 minutes = 300 seconds -> 1/300 = 0.0033 Hz. You have to divide your single trial into smaller fragments and then average the resulting spectra (I believe you can do this directly in Fieldtrip). You could for example use Welch's method. Regards, Thomas -----Oorspronkelijk bericht----- Van: FieldTrip discussion list namens Martin Bleichner Verzonden: do 2-7-2009 15:39 Aan: FIELDTRIP at NIC.SURFNET.NL Onderwerp: [FIELDTRIP] frequency resolution of the power spectrum Hi there, this might be a stupid question. I probably miss something obvious. I want to compute the power spectrum over a single trial (around 5 minutes). using this piece of code cfg = []; cfg.method = 'mtmfft'; cfg.output = 'pow'; cfg.foilim = [1 100]; cfg.taper = 'hanning'; freq = freqanalysis(cfg, data); as a result I get freq: [1x62534 double] powspctrm: [96x62534 double] that is a frequency resolution of 0.0032Hz!? What determines the frequency resolution here? What can I do to make it less fine grained? Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From thomas.hartmann at UNI-KONSTANZ.DE Thu Jul 2 15:59:34 2009 From: thomas.hartmann at UNI-KONSTANZ.DE (Thomas Hartmann) Date: Thu, 2 Jul 2009 15:59:34 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: Message-ID: hi martin, the spectral resolution of a fft is determined by the length of the data used to calculate it. e.g. a length of 1 second would give a frequency-resolution of 1Hz, 2 seconds of data would result in a resolution of 0.5Hz and so on.... what you actually missed is that you dont want to calculate one fft on your 5-minutes trial but rather several ffts on (overlapping) windows of your 5 minutes. to do this, refer to the mail by nathan weisz "re: preprocessing without trigger...". he shows some code there to cut long trials into several short ones. calculate the freqanalysis on these and you will get reasonable results. greez, thomas Martin Bleichner schrieb: > Hi there, > > this might be a stupid question. I probably miss something obvious. > > I want to compute the power spectrum over a single trial (around 5 > minutes). > > using this piece of code > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'pow'; > cfg.foilim = [1 100]; > cfg.taper = 'hanning'; > freq = freqanalysis(cfg, data); > > as a result I get > freq: [1x62534 double] > powspctrm: [96x62534 double] > > that is a frequency resolution of 0.0032Hz!? What determines the > frequency resolution here? What can I do to make it less fine grained? > > Thanks > Martin > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > -- Dipl. Psych. Thomas Hartmann OBOB-Lab University of Konstanz Department of Psychology P.O. Box D25 78457 Konstanz Germany Tel.: +49 (0)7531 88 4612 Fax: +49 (0)7531-88 4601 Email: thomas.hartmann at uni-konstanz.de Homepage: http://www.uni-konstanz.de/obob "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan Doyle) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From bleichner.martin at GMAIL.COM Thu Jul 2 16:04:52 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Thu, 2 Jul 2009 16:04:52 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: <4A4CBD46.3060405@uni-konstanz.de> Message-ID: thanks, I thought there might be an option I could hand over in the cfg. that will work 2009/7/2 Thomas Hartmann > hi martin, > the spectral resolution of a fft is determined by the length of the data > used to calculate it. e.g. a length of 1 second would give a > frequency-resolution of 1Hz, 2 seconds of data would result in a resolution > of 0.5Hz and so on.... > > what you actually missed is that you dont want to calculate one fft on your > 5-minutes trial but rather several ffts on (overlapping) windows of your 5 > minutes. to do this, refer to the mail by nathan weisz "re: preprocessing > without trigger...". he shows some code there to cut long trials into > several short ones. calculate the freqanalysis on these and you will get > reasonable results. > > greez, > thomas > > Martin Bleichner schrieb: > >> Hi there, >> >> this might be a stupid question. I probably miss something obvious. >> >> I want to compute the power spectrum over a single trial (around 5 >> minutes). >> >> using this piece of code >> cfg = []; >> cfg.method = 'mtmfft'; >> cfg.output = 'pow'; >> cfg.foilim = [1 100]; >> cfg.taper = 'hanning'; >> freq = freqanalysis(cfg, data); >> >> as a result I get >> freq: [1x62534 double] >> powspctrm: [96x62534 double] >> >> that is a frequency resolution of 0.0032Hz!? What determines the frequency >> resolution here? What can I do to make it less fine grained? >> >> Thanks >> Martin >> >> >> ---------------------------------- >> >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and >> EEG analysis. >> >> http://listserv.surfnet.nl/archives/fieldtrip.html >> >> http://www.ru.nl/fcdonders/fieldtrip/ >> >> > > -- > Dipl. Psych. Thomas Hartmann > > OBOB-Lab > University of Konstanz > Department of Psychology > P.O. Box D25 > 78457 Konstanz > Germany > > Tel.: +49 (0)7531 88 4612 > Fax: +49 (0)7531-88 4601 > Email: thomas.hartmann at uni-konstanz.de > Homepage: http://www.uni-konstanz.de/obob > > "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan > Doyle) > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingrid.nieuwenhuis at DONDERS.RU.NL Thu Jul 2 16:07:34 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 2 Jul 2009 16:07:34 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: <4A4CBD46.3060405@uni-konstanz.de> Message-ID: Hi > your 5 minutes. to do this, refer to the mail by nathan weisz "re: > preprocessing without trigger...". he shows some code there to cut long > trials into several short ones. Or use statfun_general see reply on that "re: > preprocessing without trigger..." Best Ingrid > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Thomas Hartmann > Sent: Thursday, July 02, 2009 4:00 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] frequency resolution of the power spectrum > > hi martin, > the spectral resolution of a fft is determined by the length of the data > used to calculate it. e.g. a length of 1 second would give a > frequency-resolution of 1Hz, 2 seconds of data would result in a > resolution of 0.5Hz and so on.... > > what you actually missed is that you dont want to calculate one fft on > your 5-minutes trial but rather several ffts on (overlapping) windows of > your 5 minutes. to do this, refer to the mail by nathan weisz "re: > preprocessing without trigger...". he shows some code there to cut long > trials into several short ones. calculate the freqanalysis on these and > you will get reasonable results. > > greez, > thomas > > Martin Bleichner schrieb: > > Hi there, > > > > this might be a stupid question. I probably miss something obvious. > > > > I want to compute the power spectrum over a single trial (around 5 > > minutes). > > > > using this piece of code > > cfg = []; > > cfg.method = 'mtmfft'; > > cfg.output = 'pow'; > > cfg.foilim = [1 100]; > > cfg.taper = 'hanning'; > > freq = freqanalysis(cfg, data); > > > > as a result I get > > freq: [1x62534 double] > > powspctrm: [96x62534 double] > > > > that is a frequency resolution of 0.0032Hz!? What determines the > > frequency resolution here? What can I do to make it less fine grained? > > > > Thanks > > Martin > > > > > > ---------------------------------- > > > > The aim of this list is to facilitate the discussion between users of > > the FieldTrip toolbox, to share experiences and to discuss new ideas > > for MEG and EEG analysis. > > > > http://listserv.surfnet.nl/archives/fieldtrip.html > > > > http://www.ru.nl/fcdonders/fieldtrip/ > > > > > -- > Dipl. Psych. Thomas Hartmann > > OBOB-Lab > University of Konstanz > Department of Psychology > P.O. Box D25 > 78457 Konstanz > Germany > > Tel.: +49 (0)7531 88 4612 > Fax: +49 (0)7531-88 4601 > Email: thomas.hartmann at uni-konstanz.de > Homepage: http://www.uni-konstanz.de/obob > > "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan > Doyle) > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Thu Jul 2 16:09:11 2009 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Thu, 2 Jul 2009 16:09:11 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: Message-ID: Hi Martin, take a look at http://fieldtrip.fcdonders.nl/faq/how_can_i_process_continuous_data_without_triggers to know how to preprocess your single trial Marco On 02/lug/09, at 15:39, Martin Bleichner wrote: > Hi there, > > this might be a stupid question. I probably miss something obvious. > > I want to compute the power spectrum over a single trial (around 5 > minutes). > > using this piece of code > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'pow'; > cfg.foilim = [1 100]; > cfg.taper = 'hanning'; > freq = freqanalysis(cfg, data); > > as a result I get > freq: [1x62534 double] > powspctrm: [96x62534 double] > > that is a frequency resolution of 0.0032Hz!? What determines the > frequency resolution here? What can I do to make it less fine grained? > > Thanks > Martin > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 3 16:42:25 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke van Dijk) Date: Fri, 3 Jul 2009 16:42:25 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. Message-ID: Dear all, I am getting started doing analysis on Elekta Neuromag data using fieldtrip, having been used to CTF data at the Donders before... My question regards loading mri data in order to do volumesegment and sourceanalysis in the end. In particular I would like to transform the outcome of the mne toolbox function: 'fif_read_mri.m' to a fieldtrip compatible format. F.Y.I, I'm working with data with recorded with the old 122 sensor system here in Duesseldorf, and with data of the newest 306 vector view system as well. Does anyone have experience with this? And of course maybe have a solution? Best and thanks in advance, Hanneke ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hubert.preissl at UNI-TUEBINGEN.DE Mon Jul 6 12:01:21 2009 From: hubert.preissl at UNI-TUEBINGEN.DE (Hubert Preissl) Date: Mon, 6 Jul 2009 12:01:21 +0200 Subject: MEG lunch at HBM2009/minutes In-Reply-To: <4A4A6DC8.8060406@donders.ru.nl> Message-ID: Dear Ole, during the last autumn school we recorded all lectures, maybe it would be interesting to make other people aware of this. if you want to have a look at this go to http://timms.uni-tuebingen.de/Search/SearchForm01.aspx search for: autumn school 2008 sincerely, hubert -- Dr. Hubert Preissl MEG-Center phone: ++49-(0)7071-2987704 Otfried Mueller Str 47 fax: ++49-(0)7071-295706 72076 Tübingen, Germany email: hubert.preissl at uni-tuebingen.de ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Paul.vandenHurk at FCDONDERS.RU.NL Mon Jul 6 14:28:27 2009 From: Paul.vandenHurk at FCDONDERS.RU.NL (Paul van den Hurk) Date: Mon, 6 Jul 2009 14:28:27 +0200 Subject: Failed to create socket while using the Fieldtrip buffer Message-ID: >>From June 22 until July 10 I'll be away. After that time, I'll respond as soon as possible. With kind regards, Paul van den Hurk PhD student in Mind-Brain-Mindfulness Group Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging Radboud University Nijmegen Postal Address: PO Box 9101 6500 HB NIJMEGEN The Netherlands Visiting address: Kapittelweg 29 room: 1.34 6525 EN NIJMEGEN tel.: +31 (0)243668388 e-mail: p.vandenhurk at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From christophe.grova at MCGILL.CA Mon Jul 6 16:34:52 2009 From: christophe.grova at MCGILL.CA (Christophe Grova) Date: Mon, 6 Jul 2009 09:34:52 -0500 Subject: Workshop "Inverse problems in brain imaging and multimodal data fusion" - Montreal - August 24-29 2009 Message-ID: ********************************************************************************************* CALL FOR ABSTRACT - DEADLINE FOR ABSTRACT SUBMISSION July 15th - REGISTRATION IS OPEN Inverse problems in brain imaging and multimodal data fusion Montreal, CANADA, August 24-29, 2009 Organizers: Christophe Grova(McGill), Sylvain Baillet (Med. College of Wisconsin), Jean-Marc Lina (Ecole de Technologie Superieure, CRM) (http://www.crm.umontreal.ca/Inverse09/index_e.php) ********************************************************************************************* Sylvain Baillet, Jean-MarcLina and myself are organizing a workshop entitled "Inverse problems in brain imagery and multimodal data fusion". This workshop supported by the "Centre de Recherche en Mathématiques" de l'Université de Montréal (http://www.crm.umontreal.ca/) will last 5 days in Montreal from the 24th to the 29th of August 2009 The diversity of non invasive imaging devices (MRI, EEG, MEG, Near Infrared Spectroscopyl) allows one to explore the brain dynamics provided there exists a mathematical framework that encompass this multimodality and the complexity of the inherent sources of the cerebral signals. Despite a general agreement about the source modelling, many mathematical strategies have been elaborated in order to solve the inevitable ill-posed inverse problem.. What are the common features between those approaches? What are the mathematical frameworks the most appropriate for handling simultaneous measurements from different modalities? What are the best approaches for estimating both spatial and temporal brain activities? The workshop will consist in full 3-hours invited lectures followed by more specific presentations and one poster session. Participants interested in presenting a contributed talk or a poster are invited to submit an abstract before the 15th of July 2009. Participants interested in attending, the registration is now open, places are limited Check our website for more information: http://www.crm.umontreal.ca/Inverse09/index_e.php Preliminary program below We hope to see you in Montreal Grova Christophe, Baillet Sylvain, and Lina Jean-Marc ----------------------------- Monday August 24th: Inverse problem (1) - Matti Hamalainen - Martinos Cent. for Biomed. Imag. Boston USA MEG and EEG side by side in terms of neural sources sources, measurement techniques, forward modeling, and source modeling. - Srikantan Nagarajan - Univ. Calif. at San Francisco USA Machine learning advances in electromagnetic imaging. Probabilistic algorithms developed for analyses of MEG and EEG data ------------------------------------------------------------------------------------------------------- Tuesday August 25th: Inverse problem (2) - Jan de Munck - VU Medical Center Amsterdam, Netherlands Computational aspects of forward and inverse modelling of MEG and EEG - Nelson Trujillo Barreto - Cuban Centre for Neurosciences - LaHavana, Cuba Probabilistic and biophysical models for the analysis and integration of functional neuroimages - Round table / discussion: How deep one can see with MEG vs EEG? Moderators: M. Hamalainen, J. de Munck ------------------------------------------------------------------------------------------------------- Wednesday August 26th: Dipole scanning approaches - J Mosher - Cleveland Clinic USA A Beamformer Perspective of MEG and EEG Source Analyses. (non-cerebral noise rejection in MEG/EEG, non linear source localization) - Douglas Cheyne: Toronto Sick Kids Hospital, Canada Application of beamformers in clinical and cognitive neuroimaging - Hermann Stefan - MEG Center, Erlangen, Germany Clinical application of multimodal data (EEG/MEG/MRI//PET/SPECT) in epilepsy - Round table / discussion : model comparison and model selection for EEG/MEG inverse problem Moderators: N. Trujillo-Barreto, J. Daunizeau ------------------------------------------------------------------------------------------------------- Thursday August 27th: Multimodal data fusion - Christophe Grova - McGill University, Biomedical Engineering Dpt, Canada Insights from electrophysiology (MEG/EEG) and hemodynamic processes (fMRI/NIRS) using multimodal imaging to characterize the epilptogenic network - Jean Daunizeau - Functional Imaging Lab., London, UK Stochastic dynamic causal models in EEG/MEG - Jorge Riera - Tohoku University, Japan Modeling the genesis of the primary current density from a mesoscopic viewpoint: the relationship with EEG and MEG data - Sylvain Baillet- The Medical College of Wisconsin, USA Optical flow techniques adapted to the analysis of time-resolved brain imaging data - Round table / discussion : source localization and induced activity Moderators: J.M Lina ------------------------------------------------------------------------------------------------------- Friday August 28th: Clinical and Neuroscience applications - Jean-Marc Lina - Ecole de Technologie Superieure, Montreal, Canada Entropic approaches dedicated to the EEG/MEG inverse problem - Eliane Kobayashi - McGill, Montreal Neurological Institute, Canada Clinical relevance of EEG/MEG and EEG/fMRI in epilepsy - Stephan Grimault MEG center - Université de Montréal, Canada Memory retention and source localization of induced activity in MEG - Round table / discussion : clinical and neuroscience application of the inverse problem,expectations of the users Moderators: P. Jolicoeur (UdM), J. Gotman (McGill) ------------------------------------------------------------------------------- *************************** Christophe Grova, PhD Assistant Professor Biomedical Engineering Dpt Neurology and Neurosurgery Dpt Montreal Neurological Institute Biomedical Engineering Department - Room 304 McGill University 3775 University Street, Montreal, Quebec, Canada, H3A 2B4 email : christophe.grova at mcgill.ca tel : (514) 398 2516 fax : (514) 398 7461 Research Assistant : MEG Center, CERNEC Université de Montréal tel : (514)-343-6111 ext 18878. web: http://www.mni.mcgill.ca/research/gotman/members/christophe.html http://www.bmed.mcgill.ca/ *************************** ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From florisdelange at GMAIL.COM Mon Jul 6 18:48:17 2009 From: florisdelange at GMAIL.COM (Floris de Lange) Date: Mon, 6 Jul 2009 18:48:17 +0200 Subject: dipole time course Message-ID: Dear Fieldtrippers, I have a fairly basic Fieldtrip question; I hope you can point me in the right direction. I'm running a dipole model on the early auditory response (60-90 ms after the click). The dipoloe fit works very well. Just for completeness, these are the lines of code I used: cfg = []; cfg.numdipoles = 2; cfg.symmetry = 'y'; cfg.model = 'regional'; cfg.latency = [-0.44 -0.41]; cfg.vol = vol; cfg.inwardshift = 0; source = dipolefitting(cfg,erf{1}); % visualize where the dipoles are figure(1); clf; headmodelplot(cfg,erf{1}) hold on; plot3([source.dip.pos(1,1)],[source.dip.pos(1,2)],[source.dip.pos(1,3)],'ro'); plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos(2,3)],'bo'); I have fitted the dipole over a 30 msec window. But now, I would like to plot the response of these dipoles for the whole time window sampled. In other words, I would like to use the coordinates obtained from the dipole fitting procedure, and use them as 'virtual sensors' to reduce the dimensionality of my data from 275 channel time courses to 2. I don't want to use the dipole moments, because they're only defined within the 30 ms that I used to calculate my dipole. I suppose I have to project my data through the dipoles, but I'm not sure how. Any help is greatly appreciated! Best wishes, Floris -- Floris de Lange http://www.florisdelange.com ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Mon Jul 6 21:39:53 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 6 Jul 2009 20:39:53 +0100 Subject: dipole time course In-Reply-To: <9fb563140907060948s59eedcbct39e5f92e7330e1d2@mail.gmail.com> Message-ID: Dear Floris, Dipolefitting uses the pseudo-inverse of the leadfield as its inverse operator. Using prepare_leadfield with the right input should give you the leadfields of the two locations of interest, pinv'ing the concatenated leadfields would give you the inverse operator (and multiplying the sensor level evoked field with the inverse operator gives you the dipoles' time courses (each in 3D)). The individual timecourses could be reduced to 1D by a pca. Alternatively, you could multiply each of the individual leadfields with the average reconstructed dipole orientation, so that you end up with a (concatenated across the two dipoles) forward model of 275x2, pinv'ing this one, and multiplying it with your sensor data directly gives you time courses in 1D. Cheers, JM On Jul 6, 2009, at 5:48 PM, Floris de Lange wrote: > Dear Fieldtrippers, > > I have a fairly basic Fieldtrip question; I hope you can point me > in the right direction. > I'm running a dipole model on the early auditory response (60-90 ms > after the click). The dipoloe fit works very well. Just for > completeness, these are the lines of code I used: > > cfg = []; > cfg.numdipoles = 2; > cfg.symmetry = 'y'; > cfg.model = 'regional'; > cfg.latency = [-0.44 -0.41]; > cfg.vol = vol; > cfg.inwardshift = 0; > source = dipolefitting(cfg,erf{1}); > > % visualize where the dipoles are > figure(1); clf; headmodelplot(cfg,erf{1}) > hold on; > plot3([source.dip.pos(1,1)],[source.dip.pos(1,2)],[source.dip.pos > (1,3)],'ro'); > plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos > (2,3)],'bo'); > > I have fitted the dipole over a 30 msec window. But now, I would > like to plot the response of these dipoles for the whole time > window sampled. > In other words, I would like to use the coordinates obtained from > the dipole fitting procedure, and use them as 'virtual sensors' to > reduce the dimensionality of my data from 275 channel time courses > to 2. I don't want to use the dipole moments, because they're only > defined within the 30 ms that I used to calculate my dipole. > I suppose I have to project my data through the dipoles, but I'm > not sure how. Any help is greatly appreciated! > > Best wishes, > Floris > > -- > Floris de Lange > http://www.florisdelange.com > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From florisdelange at GMAIL.COM Tue Jul 7 14:34:12 2009 From: florisdelange at GMAIL.COM (Floris de Lange) Date: Tue, 7 Jul 2009 14:34:12 +0200 Subject: dipole time course Message-ID: Dear Jan-Matthijs and other fieldtrippers, Thanks for your reply. I tried out your first suggestion. Unfortunately, the dipole time courses look considerably worse than what I get from picking the planar sensors that have the strongest signal. I've attached the results for 2 conditions in the left and right auditory cortex, for comparison. On the top left is (one of the 3 matrices of) the relevant leadfield, and on the right is the planar ERF. On the bottom are the time courses of the pinv'ed leadfield * ERF time course, which are then pca'ed. I have pasted the code used below. Any idea why the dipole time course looks so much worse? % calculate leadfields for the two dipole locations cfg = []; cfg.grad = erf{1}.grad; cfg.vol = vol; cfg.channel = {'MEG'}; cfg.grid.pos = source.dip.pos; [grid] = prepare_leadfield(cfg); % multiply pseudo-inverse of leadfield with erf, then do a pca dip{i}{cond} = pinv(grid.leadfield{i}) * erf{cond}.avg; [tmp1 tmp2] = pca(dip{i}{cond}); Any input appreciated, Best wishes, Floris Dear Floris, > > Dipolefitting uses the pseudo-inverse of the leadfield as its inverse > operator. Using prepare_leadfield with the right input should give > you the leadfields of the two locations of interest, pinv'ing the > concatenated leadfields would give you the inverse operator (and > multiplying the sensor level evoked field with the inverse operator > gives you the dipoles' time courses (each in 3D)). The individual > timecourses could be reduced to 1D by a pca. Alternatively, you could > multiply each of the individual leadfields with the average > reconstructed dipole orientation, so that you end up with a > (concatenated across the two dipoles) forward model of 275x2, > pinv'ing this one, and multiplying it with your sensor data directly > gives you time courses in 1D. > > Cheers, > > JM > > On Jul 6, 2009, at 5:48 PM, Floris de Lange wrote: > > > Dear Fieldtrippers, > > > > I have a fairly basic Fieldtrip question; I hope you can point me > > in the right direction. > > I'm running a dipole model on the early auditory response (60-90 ms > > after the click). The dipoloe fit works very well. Just for > > completeness, these are the lines of code I used: > > > > cfg = []; > > cfg.numdipoles = 2; > > cfg.symmetry = 'y'; > > cfg.model = 'regional'; > > cfg.latency = [-0.44 -0.41]; > > cfg.vol = vol; > > cfg.inwardshift = 0; > > source = dipolefitting(cfg,erf{1}); > > > > % visualize where the dipoles are > > figure(1); clf; headmodelplot(cfg,erf{1}) > > hold on; > > plot3([source.dip.pos(1,1)],[source.dip.pos(1,2)],[source.dip.pos > > (1,3)],'ro'); > > plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos > > (2,3)],'bo'); > > > > I have fitted the dipole over a 30 msec window. But now, I would > > like to plot the response of these dipoles for the whole time > > window sampled. > > In other words, I would like to use the coordinates obtained from > > the dipole fitting procedure, and use them as 'virtual sensors' to > > reduce the dimensionality of my data from 275 channel time courses > > to 2. I don't want to use the dipole moments, because they're only > > defined within the 30 ms that I used to calculate my dipole. > > I suppose I have to project my data through the dipoles, but I'm > > not sure how. Any help is greatly appreciated! > > > > Best wishes, > > Floris > -- Floris de Lange http://www.florisdelange.com ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_1_1.tif Type: image/tiff Size: 160706 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_1_2.tif Type: image/tiff Size: 172144 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_2_1.tif Type: image/tiff Size: 171686 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_2_2.tif Type: image/tiff Size: 184488 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Tue Jul 7 14:55:21 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Tue, 7 Jul 2009 13:55:21 +0100 Subject: dipole time course In-Reply-To: <9fb563140907070534x1e24d827r8da78d3d5b47a150@mail.gmail.com> Message-ID: Hi Floris, I suspect that the 'orientation' onto which the pca projects the dipoles is not optimal. Perhaps you might want to try the other way, i.e. compute the leadfields in 1D, either by specifying something in cfg.grid.mom (or ori, I keep forgetting) before calling prepare_leadfield, or by postmultiplying the 3D leadfields with the orientation as estimated by the dipole fit. Cheers, JM On Jul 7, 2009, at 1:34 PM, Floris de Lange wrote: > Dear Jan-Matthijs and other fieldtrippers, > > Thanks for your reply. I tried out your first suggestion. > Unfortunately, the dipole time courses look considerably worse than > what I get from picking the planar sensors that have the strongest > signal. I've attached the results for 2 conditions in the left and > right auditory cortex, for comparison. On the top left is (one of > the 3 matrices of) the relevant leadfield, and on the right is the > planar ERF. On the bottom are the time courses of the pinv'ed > leadfield * ERF time course, which are then pca'ed. I have pasted > the code used below. Any idea why the dipole time course looks so > much worse? > > % calculate leadfields for the two dipole locations > cfg = []; > cfg.grad = erf{1}.grad; > cfg.vol = vol; > cfg.channel = {'MEG'}; > cfg.grid.pos = source.dip.pos; > [grid] = prepare_leadfield(cfg); > > % multiply pseudo-inverse of leadfield with erf, then do a pca > dip{i}{cond} = pinv(grid.leadfield{i}) * erf{cond}.avg; > [tmp1 tmp2] = pca(dip{i}{cond}); > > Any input appreciated, > Best wishes, > Floris > > > > Dear Floris, > > Dipolefitting uses the pseudo-inverse of the leadfield as its inverse > operator. Using prepare_leadfield with the right input should give > you the leadfields of the two locations of interest, pinv'ing the > concatenated leadfields would give you the inverse operator (and > multiplying the sensor level evoked field with the inverse operator > gives you the dipoles' time courses (each in 3D)). The individual > timecourses could be reduced to 1D by a pca. Alternatively, you could > multiply each of the individual leadfields with the average > reconstructed dipole orientation, so that you end up with a > (concatenated across the two dipoles) forward model of 275x2, > pinv'ing this one, and multiplying it with your sensor data directly > gives you time courses in 1D. > > Cheers, > > JM > > On Jul 6, 2009, at 5:48 PM, Floris de Lange wrote: > > > Dear Fieldtrippers, > > > > I have a fairly basic Fieldtrip question; I hope you can point me > > in the right direction. > > I'm running a dipole model on the early auditory response (60-90 ms > > after the click). The dipoloe fit works very well. Just for > > completeness, these are the lines of code I used: > > > > cfg = []; > > cfg.numdipoles = 2; > > cfg.symmetry = 'y'; > > cfg.model = 'regional'; > > cfg.latency = [-0.44 -0.41]; > > cfg.vol = vol; > > cfg.inwardshift = 0; > > source = dipolefitting(cfg,erf{1}); > > > > % visualize where the dipoles are > > figure(1); clf; headmodelplot(cfg,erf{1}) > > hold on; > > plot3([source.dip.pos(1,1)],[ > source.dip.pos(1,2)],[source.dip.pos > > (1,3)],'ro'); > > plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos > > (2,3)],'bo'); > > > > I have fitted the dipole over a 30 msec window. But now, I would > > like to plot the response of these dipoles for the whole time > > window sampled. > > In other words, I would like to use the coordinates obtained from > > the dipole fitting procedure, and use them as 'virtual sensors' to > > reduce the dimensionality of my data from 275 channel time courses > > to 2. I don't want to use the dipole moments, because they're only > > defined within the 30 ms that I used to calculate my dipole. > > I suppose I have to project my data through the dipoles, but I'm > > not sure how. Any help is greatly appreciated! > > > > Best wishes, > > Floris > > > -- > Floris de Lange > http://www.florisdelange.com > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > > sults_2_1.tif> ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Jul 7 18:08:44 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 7 Jul 2009 18:08:44 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: Message-ID: Hi Hanneke, The read_mri function has support for MRIs in fif files using a meg_pd function (i.e. mex file), but not yet for the mne toolbox. Could you send me an example MRI dataset so that I can try it out? Robert PS See http://fieldtrip.fcdonders.nl/contact#how_should_i_send_example_data_to_the_developers On 3 Jul 2009, at 16:42, Hanneke van Dijk wrote: > Dear all, > > I am getting started doing analysis on Elekta Neuromag data using > fieldtrip, having been used to CTF data at the Donders before... > My question regards loading mri data in order to do volumesegment > and sourceanalysis in the end. > > In particular I would like to transform the outcome of the mne > toolbox function: 'fif_read_mri.m' to a fieldtrip compatible format. > > F.Y.I, I'm working with data with recorded with the old 122 sensor > system here in Duesseldorf, and with data of the newest 306 vector > view system as well. > > Does anyone have experience with this? And of course maybe have a > solution? > > Best and thanks in advance, > > Hanneke > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Wed Jul 8 09:01:28 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Wed, 8 Jul 2009 09:01:28 +0200 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Message-ID: Hi Robert, Thanks for your reply. I have tried the meg_pd function loadmri (via read_mri in fieldtrip) but I got the feedback: 'error loading mri-file'. So I have no idea what is going wrong. I will send you the example mri-file right now. It is probably not to difficult to work something out but I want to be sure that the mri head coordinates end up in the right way as device coordinates. Thanks in advance! Viele Gruße aus Düsseldorf ;-) Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von Robert Oostenveld Gesendet: Di 07.07.2009 18:08 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, The read_mri function has support for MRIs in fif files using a meg_pd function (i.e. mex file), but not yet for the mne toolbox. Could you send me an example MRI dataset so that I can try it out? Robert PS See http://fieldtrip.fcdonders.nl/contact#how_should_i_send_example_data_to_the_developers On 3 Jul 2009, at 16:42, Hanneke van Dijk wrote: > Dear all, > > I am getting started doing analysis on Elekta Neuromag data using > fieldtrip, having been used to CTF data at the Donders before... > My question regards loading mri data in order to do volumesegment > and sourceanalysis in the end. > > In particular I would like to transform the outcome of the mne > toolbox function: 'fif_read_mri.m' to a fieldtrip compatible format. > > F.Y.I, I'm working with data with recorded with the old 122 sensor > system here in Duesseldorf, and with data of the newest 306 vector > view system as well. > > Does anyone have experience with this? And of course maybe have a > solution? > > Best and thanks in advance, > > Hanneke > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. Hi ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 8 09:49:02 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 8 Jul 2009 09:49:02 +0200 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F347B@Mail2-UKD.VMED.UKD> Message-ID: Hi Hanneke, The mri.fif file that you sent only contains the header information, but not the slice/image information. >> fiff_read_mri('mri.fif') Reading slice information and pixel data.??? Error using ==> fiff_read_mri at 116 Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 Please also send the corresponding slice data. Robert On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > Hi Robert, > > Thanks for your reply. I have tried the meg_pd function loadmri (via > read_mri in fieldtrip) but I got the feedback: 'error loading mri- > file'. So I have no idea what is going wrong. I will send you the > example mri-file right now. It is probably not to difficult to work > something out but I want to be sure that the mri head coordinates > end up in the right way as device coordinates. > > Thanks in advance! > Viele Gruße aus Düsseldorf ;-) > > Hanneke ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Wed Jul 8 10:03:10 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Wed, 8 Jul 2009 10:03:10 +0200 Subject: AW: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Message-ID: Hi Robert, Done, sorry! Groetjes Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von Robert Oostenveld Gesendet: Mi 08.07.2009 09:49 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, The mri.fif file that you sent only contains the header information, but not the slice/image information. >> fiff_read_mri('mri.fif') Reading slice information and pixel data.??? Error using ==> fiff_read_mri at 116 Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 Please also send the corresponding slice data. Robert On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > Hi Robert, > > Thanks for your reply. I have tried the meg_pd function loadmri (via > read_mri in fieldtrip) but I got the feedback: 'error loading mri- > file'. So I have no idea what is going wrong. I will send you the > example mri-file right now. It is probably not to difficult to work > something out but I want to be sure that the mri head coordinates > end up in the right way as device coordinates. > > Thanks in advance! > Viele Gruße aus Düsseldorf ;-) > > Hanneke ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 8 10:09:08 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 8 Jul 2009 10:09:08 +0200 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <143C4174-C62D-4A08-888C-06A79538F7E5@fcdonders.ru.nl> Message-ID: Hi Hanneke, I have tried importing another MRI fif file which I still had on disk using the following modification of the fieldtrip/fileio/read_mri.m code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%% elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') % use the mne functions to read the Neuromag MRI hdr = fiff_read_mri(filename); img = cat(3, hdr.slices.data); hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data to save memory transform = hdr.trans.trans; and then slightly further down in the code % set up the axes of the volume in voxel coordinates nx = size(img,1); ny = size(img,2); nz = size(img,3); mri.dim = [nx ny nz]; % store the anatomical data mri.anatomy = img; % store the header with all fileformat specific details mri.hdr = hdr; try % if present, store the homogenous transformation matrix mri.transform = transform; end This results in a warning of the MNE fiff_read_mri function >> mri = read_mri('lp_mri_headcoords.fif') Reading slice information and pixel data..50..100..126..[done] The slices are not equally spaced. Voxel transformation will not be included mri = dim: [256 256 126] anatomy: [256x256x126 int16] hdr: [1x1 struct] transform: [4x4 double] and the resulting coordinate transformation matrix is not fully correct. You can check the coordinates by plotting it intreactively in sourceplot (after converting the image data from int16 into double). Perhaps one of the Neuromag experts on the list can help you further. best regards, Robert PS atatched is the latest read_mri function, which includes the call to fiff_read_mri. On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > Hi Hanneke, > > The mri.fif file that you sent only contains the header information, > but not the slice/image information. > > >> fiff_read_mri('mri.fif') > Reading slice information and pixel data.??? Error using ==> > fiff_read_mri at 116 > Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ > MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 > > Please also send the corresponding slice data. > > Robert > > > On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > >> Hi Robert, >> >> Thanks for your reply. I have tried the meg_pd function loadmri >> (via read_mri in fieldtrip) but I got the feedback: 'error loading >> mri-file'. So I have no idea what is going wrong. I will send you >> the example mri-file right now. It is probably not to difficult to >> work something out but I want to be sure that the mri head >> coordinates end up in the right way as device coordinates. >> >> Thanks in advance! >> Viele Gruße aus Düsseldorf ;-) >> >> Hanneke > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: read_mri.m Type: application/octet-stream Size: 11399 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Wed Jul 8 10:22:09 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 8 Jul 2009 09:22:09 +0100 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: Message-ID: Hi Hanneke, Please note that the X and Y axis in the neuromag head-coordinate system are swapped with respect to the CTF and 4D convention; i.e. X axis through the ears, and Y-axis to the nose. What usually works for me is discarding the mri.transform (mri = rmfield(mri, 'transform'), and call volumerealign in the interactive mode. You can then specify the location of the fiducials yourself and the output mri of the function will contain a transformation matrix according to ctf convention. This at least ensures that volumesegment etc kind of work properly. Yet, it is important to know that of course the gradiometer positions in the data are defined in neuromag convention, so after preparing your volume conduction model you probably have to swap the x and y coordinates of the vol.bnd.pnt (assuming you use a singleshell as volume conductor model), before proceeding to visualization (headmodelplot; just to check whether the head fits in the helmet), leadfield computation (only makes sense if the head fits in the helmet), and sourceanalysis (idem). Yours, JM On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > Hi Hanneke, > > I have tried importing another MRI fif file which I still had on > disk using the following modification of the fieldtrip/fileio/ > read_mri.m code > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %%%%%%%%%%%%%% > elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') > % use the mne functions to read the Neuromag MRI > hdr = fiff_read_mri(filename); > img = cat(3, hdr.slices.data); > hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data > to save memory > transform = hdr.trans.trans; > > and then slightly further down in the code > > % set up the axes of the volume in voxel coordinates > nx = size(img,1); > ny = size(img,2); > nz = size(img,3); > mri.dim = [nx ny nz]; > % store the anatomical data > mri.anatomy = img; > % store the header with all fileformat specific details > mri.hdr = hdr; > try > % if present, store the homogenous transformation matrix > mri.transform = transform; > end > > This results in a warning of the MNE fiff_read_mri function > > >> mri = read_mri('lp_mri_headcoords.fif') > Reading slice information and pixel data..50..100..126..[done] > The slices are not equally spaced. Voxel transformation will not > be included > > mri = > dim: [256 256 126] > anatomy: [256x256x126 int16] > hdr: [1x1 struct] > transform: [4x4 double] > > and the resulting coordinate transformation matrix is not fully > correct. You can check the coordinates by plotting it intreactively > in sourceplot (after converting the image data from int16 into > double). > > Perhaps one of the Neuromag experts on the list can help you further. > > best regards, > Robert > > PS atatched is the latest read_mri function, which includes the > call to fiff_read_mri. > > > On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> The mri.fif file that you sent only contains the header >> information, but not the slice/image information. >> >> >> fiff_read_mri('mri.fif') >> Reading slice information and pixel data.??? Error using ==> >> fiff_read_mri at 116 >> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >> >> Please also send the corresponding slice data. >> >> Robert >> >> >> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >> >>> Hi Robert, >>> >>> Thanks for your reply. I have tried the meg_pd function loadmri >>> (via read_mri in fieldtrip) but I got the feedback: 'error >>> loading mri-file'. So I have no idea what is going wrong. I will >>> send you the example mri-file right now. It is probably not to >>> difficult to work something out but I want to be sure that the >>> mri head coordinates end up in the right way as device coordinates. >>> >>> Thanks in advance! >>> Viele Gruße aus Düsseldorf ;-) >>> >>> Hanneke >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Wed Jul 8 10:29:09 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Wed, 8 Jul 2009 10:29:09 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. Message-ID: Hi Robert and Jan-Mathijs, Thanks so much for your quick replies and the script! I will try to work it out and keep you updated! Yours, Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von Robert Oostenveld Gesendet: Mi 08.07.2009 10:09 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, I have tried importing another MRI fif file which I still had on disk using the following modification of the fieldtrip/fileio/read_mri.m code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%% elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') % use the mne functions to read the Neuromag MRI hdr = fiff_read_mri(filename); img = cat(3, hdr.slices.data); hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data to save memory transform = hdr.trans.trans; and then slightly further down in the code % set up the axes of the volume in voxel coordinates nx = size(img,1); ny = size(img,2); nz = size(img,3); mri.dim = [nx ny nz]; % store the anatomical data mri.anatomy = img; % store the header with all fileformat specific details mri.hdr = hdr; try % if present, store the homogenous transformation matrix mri.transform = transform; end This results in a warning of the MNE fiff_read_mri function >> mri = read_mri('lp_mri_headcoords.fif') Reading slice information and pixel data..50..100..126..[done] The slices are not equally spaced. Voxel transformation will not be included mri = dim: [256 256 126] anatomy: [256x256x126 int16] hdr: [1x1 struct] transform: [4x4 double] and the resulting coordinate transformation matrix is not fully correct. You can check the coordinates by plotting it intreactively in sourceplot (after converting the image data from int16 into double). Perhaps one of the Neuromag experts on the list can help you further. best regards, Robert PS atatched is the latest read_mri function, which includes the call to fiff_read_mri. On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > Hi Hanneke, > > The mri.fif file that you sent only contains the header information, > but not the slice/image information. > > >> fiff_read_mri('mri.fif') > Reading slice information and pixel data.??? Error using ==> > fiff_read_mri at 116 > Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ > MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 > > Please also send the corresponding slice data. > > Robert > > > On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > >> Hi Robert, >> >> Thanks for your reply. I have tried the meg_pd function loadmri >> (via read_mri in fieldtrip) but I got the feedback: 'error loading >> mri-file'. So I have no idea what is going wrong. I will send you >> the example mri-file right now. It is probably not to difficult to >> work something out but I want to be sure that the mri head >> coordinates end up in the right way as device coordinates. >> >> Thanks in advance! >> Viele Gruße aus Düsseldorf ;-) >> >> Hanneke > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gsudre at POBOX.COM Wed Jul 8 14:17:09 2009 From: gsudre at POBOX.COM (Gustavo Sudre) Date: Wed, 8 Jul 2009 08:17:09 -0400 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <63C46F40-97E3-4E32-930D-6EC7D32F6A5D@psy.gla.ac.uk> Message-ID: Hi, I've been following this discussion closely because I've been having the same problem. The new read_mri worked fine for me (thanks for that!). Now, the mri I import is already in head coordinates (Neuromag standard: mri.hdr.trans.from=4), and it has been realigned to the data using a separate program, so I would prefer to not re-define the fiducials using volumerealign. In this case, is it enough to just switch the X and Y axes manually (mri.anatomy = permute(mri.anatomy,[2 1 3])) to conform to CTF standards, and use the identity matrix for mri.transform? If I understand it correctly, mri.transform is used to take the mri (or any volume) to head coordinates, right? So, I was wondering what steps the mri.transform matrix is required. Do other common future steps (e.g. plotting, preparing headmodel, leadfield, etc) assume the volume is already in head coordinates, or do they always use vol.transform for that? Also, when I tried removing mri,transform, volumerealign didn't like it because the mri structure wasn't a volume structure anymore (and I imagine other functions will complain about it too, that's why I used the identity). Thanks, Gus On Jul 8, 2009, at 4:22 AM, jan-mathijs schoffelen wrote: > Hi Hanneke, > > Please note that the X and Y axis in the neuromag head-coordinate > system are swapped with respect to the CTF and 4D convention; i.e. X > axis through the ears, and Y-axis to the nose. > What usually works for me is discarding the mri.transform (mri = > rmfield(mri, 'transform'), and call volumerealign in the interactive > mode. You can then specify the location of the fiducials yourself > and the output mri of the function will contain a transformation > matrix according to ctf convention. This at least ensures that > volumesegment etc kind of work properly. Yet, it is important to > know that of course the gradiometer positions in the data are > defined in neuromag convention, so after preparing your volume > conduction model you probably have to swap the x and y coordinates > of the vol.bnd.pnt (assuming you use a singleshell as volume > conductor model), before proceeding to visualization (headmodelplot; > just to check whether the head fits in the helmet), leadfield > computation (only makes sense if the head fits in the helmet), and > sourceanalysis (idem). > > Yours, > > JM > > > > > On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> I have tried importing another MRI fif file which I still had on >> disk using the following modification of the fieldtrip/fileio/ >> read_mri.m code >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %%%%%%%%%%%%% >> elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') >> % use the mne functions to read the Neuromag MRI >> hdr = fiff_read_mri(filename); >> img = cat(3, hdr.slices.data); >> hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data >> to save memory >> transform = hdr.trans.trans; >> >> and then slightly further down in the code >> >> % set up the axes of the volume in voxel coordinates >> nx = size(img,1); >> ny = size(img,2); >> nz = size(img,3); >> mri.dim = [nx ny nz]; >> % store the anatomical data >> mri.anatomy = img; >> % store the header with all fileformat specific details >> mri.hdr = hdr; >> try >> % if present, store the homogenous transformation matrix >> mri.transform = transform; >> end >> >> This results in a warning of the MNE fiff_read_mri function >> >> >> mri = read_mri('lp_mri_headcoords.fif') >> Reading slice information and pixel data..50..100..126..[done] >> The slices are not equally spaced. Voxel transformation will not >> be included >> >> mri = >> dim: [256 256 126] >> anatomy: [256x256x126 int16] >> hdr: [1x1 struct] >> transform: [4x4 double] >> >> and the resulting coordinate transformation matrix is not fully >> correct. You can check the coordinates by plotting it intreactively >> in sourceplot (after converting the image data from int16 into >> double). >> >> Perhaps one of the Neuromag experts on the list can help you further. >> >> best regards, >> Robert >> >> PS atatched is the latest read_mri function, which includes the >> call to fiff_read_mri. >> >> >> On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: >> >>> Hi Hanneke, >>> >>> The mri.fif file that you sent only contains the header >>> information, but not the slice/image information. >>> >>> >> fiff_read_mri('mri.fif') >>> Reading slice information and pixel data.??? Error using ==> >>> fiff_read_mri at 116 >>> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >>> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >>> >>> Please also send the corresponding slice data. >>> >>> Robert >>> >>> >>> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >>> >>>> Hi Robert, >>>> >>>> Thanks for your reply. I have tried the meg_pd function loadmri >>>> (via read_mri in fieldtrip) but I got the feedback: 'error >>>> loading mri-file'. So I have no idea what is going wrong. I will >>>> send you the example mri-file right now. It is probably not to >>>> difficult to work something out but I want to be sure that the >>>> mri head coordinates end up in the right way as device coordinates. >>>> >>>> Thanks in advance! >>>> Viele Gruße aus Düsseldorf ;-) >>>> >>>> Hanneke >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From gsudre at POBOX.COM Wed Jul 8 14:34:35 2009 From: gsudre at POBOX.COM (Gustavo Sudre) Date: Wed, 8 Jul 2009 08:34:35 -0400 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <63C46F40-97E3-4E32-930D-6EC7D32F6A5D@psy.gla.ac.uk> Message-ID: OK, so I just thought of two more questions, so I apologize for not including them in my previous e-mail... 1) If after importing the Neuromag MRI the (head) coordinate system of the mri structure matches the same coordinate system in the data (including conventions such as Y-axis through the nose), why do we need to change it? You mentioned that volumesegment works better with CTF coordinates? So, does the segmentation algorithm make assumptions about where brain regions are based on the axis? Also, what other function in fieldtrip depend on such coordinate system, and would not work just by having the data coordinate system match the volume's? 2) So, let's say I already have segmented MRIs. If I just import that (and assuming volumesegment with the assumptions above), is it possible to go ahead with other steps such as prepare_bem, and prepare_singleshell? Thanks, Gus On Jul 8, 2009, at 4:22 AM, jan-mathijs schoffelen wrote: > Hi Hanneke, > > Please note that the X and Y axis in the neuromag head-coordinate > system are swapped with respect to the CTF and 4D convention; i.e. X > axis through the ears, and Y-axis to the nose. > What usually works for me is discarding the mri.transform (mri = > rmfield(mri, 'transform'), and call volumerealign in the interactive > mode. You can then specify the location of the fiducials yourself > and the output mri of the function will contain a transformation > matrix according to ctf convention. This at least ensures that > volumesegment etc kind of work properly. Yet, it is important to > know that of course the gradiometer positions in the data are > defined in neuromag convention, so after preparing your volume > conduction model you probably have to swap the x and y coordinates > of the vol.bnd.pnt (assuming you use a singleshell as volume > conductor model), before proceeding to visualization (headmodelplot; > just to check whether the head fits in the helmet), leadfield > computation (only makes sense if the head fits in the helmet), and > sourceanalysis (idem). > > Yours, > > JM > > > > > On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> I have tried importing another MRI fif file which I still had on >> disk using the following modification of the fieldtrip/fileio/ >> read_mri.m code >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %%%%%%%%%%%%% >> elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') >> % use the mne functions to read the Neuromag MRI >> hdr = fiff_read_mri(filename); >> img = cat(3, hdr.slices.data); >> hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data >> to save memory >> transform = hdr.trans.trans; >> >> and then slightly further down in the code >> >> % set up the axes of the volume in voxel coordinates >> nx = size(img,1); >> ny = size(img,2); >> nz = size(img,3); >> mri.dim = [nx ny nz]; >> % store the anatomical data >> mri.anatomy = img; >> % store the header with all fileformat specific details >> mri.hdr = hdr; >> try >> % if present, store the homogenous transformation matrix >> mri.transform = transform; >> end >> >> This results in a warning of the MNE fiff_read_mri function >> >> >> mri = read_mri('lp_mri_headcoords.fif') >> Reading slice information and pixel data..50..100..126..[done] >> The slices are not equally spaced. Voxel transformation will not >> be included >> >> mri = >> dim: [256 256 126] >> anatomy: [256x256x126 int16] >> hdr: [1x1 struct] >> transform: [4x4 double] >> >> and the resulting coordinate transformation matrix is not fully >> correct. You can check the coordinates by plotting it intreactively >> in sourceplot (after converting the image data from int16 into >> double). >> >> Perhaps one of the Neuromag experts on the list can help you further. >> >> best regards, >> Robert >> >> PS atatched is the latest read_mri function, which includes the >> call to fiff_read_mri. >> >> >> On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: >> >>> Hi Hanneke, >>> >>> The mri.fif file that you sent only contains the header >>> information, but not the slice/image information. >>> >>> >> fiff_read_mri('mri.fif') >>> Reading slice information and pixel data.??? Error using ==> >>> fiff_read_mri at 116 >>> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >>> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >>> >>> Please also send the corresponding slice data. >>> >>> Robert >>> >>> >>> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >>> >>>> Hi Robert, >>>> >>>> Thanks for your reply. I have tried the meg_pd function loadmri >>>> (via read_mri in fieldtrip) but I got the feedback: 'error >>>> loading mri-file'. So I have no idea what is going wrong. I will >>>> send you the example mri-file right now. It is probably not to >>>> difficult to work something out but I want to be sure that the >>>> mri head coordinates end up in the right way as device coordinates. >>>> >>>> Thanks in advance! >>>> Viele Gruße aus Düsseldorf ;-) >>>> >>>> Hanneke >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ingrid.nieuwenhuis at DONDERS.RU.NL Wed Jul 8 16:15:12 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Wed, 8 Jul 2009 16:15:12 +0200 Subject: Clusterplot not highlighting clusters & average layout file In-Reply-To: Message-ID: Dear Manish, > Thanks for your quick reply. I wanted to run freqstats separately on > each frequency, since I don't have precise temporal resolution in my > data (no events). Hence I need to run stats on Freq-Space > representations and not on TFR. Since clusterplot was not handling > this case, probably because it is made to search across time and space > for a given frequency, I ran freqstats/clusterplot separately for each > frequency. Aha, so you have frequency and channels, no time. Clusterplot can handle both data with and without time dimension (it looks for a .time field in the data). It cannot handle data with multiple frequency dimensions, so therefore you have to avgoverfreq (in revision 1.8 of clusterplot from May 22nd, I added a check for appropriateness of the data, see line 58). So depending on the hypothesis you want to test and your data you can either avgoverfreq and use clusterplot (as I said before usually appropriate for the lower frequencies because of well defined narrow bands, but again it depends on the research questions you have), or use multiplot. But because you have no time dimension you should use multiplotER (not multiplotTFR), with xparam = 'freq', zparam = 'stat', and maskparameter = 'mask'. Then the frequencies that are in the cluster are marked with a box. I don't know if it all works properly, I recall there were some problems with the masking options in multiplotER. Let me know if you need it and you don't get it to work. Hope it's all clear now, Best Ingrid > -----Original Message----- > From: Manish Saggar [mailto:manish.saggar at gmail.com] > Sent: Tuesday, June 30, 2009 6:40 AM > To: ingrid.nieuwenhuis at donders.ru.nl > Cc: FieldTrip discussion list > Subject: Re: [FIELDTRIP] Clusterplot not highlighting clusters & average > layout file > > Thanks for your quick reply. I wanted to run freqstats separately on > each frequency, since I don't have precise temporal resolution in my > data (no events). Hence I need to run stats on Freq-Space > representations and not on TFR. Since clusterplot was not handling > this case, probably because it is made to search across time and space > for a given frequency, I ran freqstats/clusterplot separately for each > frequency. > > So just to make sure I understood correctly, you are saying either I > use 'cfg.avgoverfreq=yes' especially for lower frequencies and then > use clusterplot OR do it separately for each frequency but use > multiplotTFR instead. But it seems like I can also use clusterplot > separately for each frequency, right? It seemed to work fine. May be I > am missing some obvious point here. Please let me know. > > Another thing that might be of interest to other people that I noticed > recently is that neighbourdist measures distance in meters when the > ELP (sensor location) file is created using BESA for EEG data. Thus a > default value of 4 cm is considered as 4 m and hence all the available > channels become neighbors for each channel. Thus I had to use a value > of 0.1 for neighbourdist, which takes 6 neighbour channels into > account. I think that is roughly equivalent to the default value of 4 > cm. > > Regards, > Manish > > On Mon, Jun 29, 2009 at 3:09 PM, Ingrid > Nieuwenhuis wrote: > > Dear Manish, > > > > (I reply to the list again, than everyone can benefit). > > That depends on what you want to test. If you have multiple frequencies > in > > your freq-data, and you just call freqanalysis, and you do not average > over > > specific frequency range, then clusterplot will look for clusters in the > > time-frequency-place domain. This does not always make sense, for > instance > > in the lower frequencies we know that there are different frequency > bands > > that behave totally different (theta and alpha for instance). Then you > can > > better run freqanalysis for these frequencies separately (choose only > 10Hz > > for alpha, or choose 8:12 Hz and cfg.avgoverfreq = 'yes'). In this case > you > > can use clusterplot to visualize. > > > > If you have no idea which frequencies behave the same, or that is > something > > you are actually interested in (for instance you have a broadbanded high > > gamma in your TFR) you can put freq-data with multiple frequencies in > > freqanalysis and look at the cluster that comes out. This is a valid > thing > > to do, but you can only not use clusterplot to visualize then. What you > can > > do is plot with multiplotTFR with mask settings (cfg.zparam = 'stat', > > cfg.maskparam = 'mask'). > > > > Best Ingrid > > > >> -----Original Message----- > >> From: Manish Saggar [mailto:manish.saggar at gmail.com] > >> Sent: Monday, June 29, 2009 7:49 PM > >> To: ingrid.nieuwenhuis at donders.ru.nl > >> Subject: Re: [FIELDTRIP] Clusterplot not highlighting clusters & > average > >> layout file > >> > >> Dear Ingrid, > >> > >> Thanks for your reply. Sorry I was out and didn't get a chance to reply > >> back. > >> > >> Last question regarding your reply, can I simply run freqstats and > >> clusterplot for each frequency separately? > >> > >> Regards, > >> Manish > >> > >> On Fri, May 22, 2009 at 9:39 AM, Ingrid > >> Nieuwenhuis wrote: > >> > Dear Manish, > >> > > >> > If I understand correctly you have multiple frequencies over which > you > >> > cluster. Is that correct? (so cfg.avgoverfreq = 'no' when you called > >> > freqstatistics?) In that case you should not call clusterplot because > >> for > >> > different frequencies there can be different channels part of the > >> cluster. > >> > Instead you can call multiplotER or multiplotTFR and use > >> cfg.maskparameter = > >> > 'mask' to plot the significant cluster. > >> > > >> > Hope this helps, > >> > Ingrid > >> > > >> > > >> >> -----Original Message----- > >> >> From: Manish Saggar [mailto:manish.saggar at gmail.com] > >> >> Sent: Friday, May 15, 2009 8:26 AM > >> >> To: ingrid.nieuwenhuis at donders.ru.nl > >> >> Cc: FIELDTRIP at NIC.SURFNET.NL > >> >> Subject: Re: [FIELDTRIP] Clusterplot not highlighting clusters & > >> average > >> >> layout file > >> >> > >> >> Ingrid, thanks for replying back. > >> >> > >> >> Apologies for lack of information. > >> >> > >> >> Clusterplot is plotting clusters fine most of the times, but in some > >> >> cases it doesn't choose to highlight markers. I have attached two > such > >> >> images with this email. > >> >> > >> >> I do not get any errors or warnings. In fact the command window in > >> >> matlab says, cluster found (with some prob and highlighter sign) and > >> >> then the plot doesn't contain any highlighting. > >> >> Initially I thought that my layout file might be messing it up or > >> >> something, or may be I need to take an average layout file for group > >> >> analysis (since cap size and electrode digitization varies for each > >> >> subject). > >> >> > >> >> Then I put debug points in the code and found out that at line 235 > the > >> >> list cell (used to denote highlighted points) is empty. I am a > novice > >> >> so please forgive if what I am suggesting is dumb here, but I think > >> >> when cluster plot is searching for significant clusters it is only > >> >> looking into first column (which could correspond to first frequency > >> >> in band) if one cluster is found by freqstats. It might be that in > the > >> >> code you guys are sorting columns and I might have missed it. But I > >> >> thought I should clear this with you. > >> >> > >> >> In another thread you have mentioned to someone that their time > limits > >> >> might not be precise enough to get the clusers highlighted > >> >> > >> > (https://listserv.surfnet.nl/scripts/wa.cgi?A2=ind0709&L=FIELDTRIP&P=R680 > >> >> ). But they were doing time-freq analysis and I am just doing freq- > >> >> representations. So should I use freqstats on each freq separately ? > >> >> > >> >> On a side note, when I run freqstats on my data (with 88 channels) > >> >> command line says '89 neighbors per channel found'. I am a little > >> >> confused with this. First since I only have less than 88 channels in > >> >> the data and second since it should only consider a lower number for > >> >> neighbor distance, right? and how can I change it? > >> >> > >> >> Thanks a ton in advance, > >> >> Manish > >> >> > >> >> On May 13, 2009, at 2:10 AM, Ingrid Nieuwenhuis wrote: > >> >> > >> >> > Dear Manish, > >> >> > > >> >> > You give a bit too few information to be able to figure out what > >> >> > could be > >> >> > the problem with clusterplot. After calling clusterplot, > clusterplot > >> >> > gives > >> >> > information on which clusters it finds. Does the function find any > >> >> > clusters? > >> >> > Does the .mask field of the structure that comes out of > >> freqstatistics > >> >> > contain any ones? Is everything else plotted normally? Do you get > >> >> > any errors > >> >> > or warnings? > >> >> > > >> >> > I'm not familiar with BESA layout files, but assuming that all > >> >> > layout files > >> >> > are similar over subjects, I think it is fine to just use an > >> >> > individual > >> >> > subject's layout file. > >> >> > > >> >> > Hope this helps, > >> >> > Best Ingrid > >> >> > > >> >> > > >> >> >>  ---Original Message----- > >> >> >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On > >> >> >> Behalf Of Manish Saggar > >> >> >> Sent: Tuesday, May 12, 2009 10:17 AM > >> >> >> To: FIELDTRIP at NIC.SURFNET.NL > >> >> >> Subject: [FIELDTRIP] Clusterplot not highlighting clusters & > average > >> >> >> layout file > >> >> >> > >> >> >> All, > >> >> >> > >> >> >> I have a question regarding clusterplot function. I am doing a > >> >> >> within-subject analysis. > >> >> >> The experimental design that I have is as follows, there are > three > >> >> >> conditions C1, C2 and C3. Each condition is of 1 min duration > (e.g. > >> >> >> rest with eyes open for 1 min). > >> >> >> > >> >> >> Now I am comparing grandaverage of freq representation of a set > of > >> >> >> subjects for C2 with C1 etc. FreqStatistics is running just fine > >> >> >> creating significant (<0.025 alpha, for 2-tailed test) clusters > >> >> >> (positive). Now the problem is that when I try to plot the > location > >> >> >> of > >> >> >> this cluster using clusterplot it doesn't show any highlighted > >> >> >> channels. Any ideas why that is happening? > >> >> >> > >> >> >> Another question is that since I am using grandaverages of freq > >> >> >> representation, what should I use for layout file (using BESA sfp > >> >> >> file > >> >> >> here). I have individual subject layout files. Currently I am > just > >> >> >> giving any file from one of the subjects. Since, I noticed that > >> >> >> FreqStatistics finds a common minimum set of channels and then > apply > >> >> >> statistics on it. So do I need to average layout files for the > >> >> >> subject > >> >> >> group or is there any other way? > >> >> >> > >> >> >> Any help is much appreciated. > >> >> >> > >> >> >> Regards, > >> >> >> Manish > >> >> >> > >> >> >> ---------------------------------- > >> >> >> The aim of this list is to facilitate the discussion between > users > >> >> >> of the > >> >> >> FieldTrip  toolbox, to share experiences and to discuss new ideas > >> >> >> for MEG > >> >> >> and EEG analysis. See also > >> >> >> http://listserv.surfnet.nl/archives/fieldtrip.html and > >> >> >> http://www.ru.nl/neuroimaging/fieldtrip. > >> >> > > >> >> > ---------------------------------- > >> >> > The aim of this list is to facilitate the discussion between users > >> >> > of the FieldTrip  toolbox, to share experiences and to discuss new > >> >> > ideas for MEG and EEG analysis. See also > >> >> http://listserv.surfnet.nl/archives/fieldtrip.html > >> >> >  and http://www.ru.nl/neuroimaging/fieldtrip. > >> >> > >> > > >> > > >> > > >> > > > > > > > > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From am236 at GEORGETOWN.EDU Thu Jul 9 04:43:39 2009 From: am236 at GEORGETOWN.EDU (Andrei Medvedev) Date: Wed, 8 Jul 2009 22:43:39 -0400 Subject: beamformer source localization for EEG Message-ID: Dear Fieldtrip developers/users I am a relatively recent user of Fieldtrip (and very much appreciative of this software). Having good experience with the analysis of brain oscillations etc, I now want to proceed with source reconstruction and it appeared that I need some help with the beamformer technique for EEG data. I am trying to use it for EEG data collected with a 128-channel EGI system. I also have structural MRI data for my subjects and would like to use realistic head models etc. I was following the Fieldtrip tutorial (1) “Localizing oscillatory sources using beamformer techniques”, which applies this method to MEG data. My understanding is that the only difference I would make when applying this approach to EEG is that, instead of the command vol = prepare_singleshell(cfg, segmentedmriF); which implements Nolte’s approach for MEG data, I need to make a BEM model for EEG data and I thought that I could use an example Matlab script (2) “Create BEM headmodel for EEG” from the Fieldtrip site. This would give me a vol variable which I then use to calculate the grid variable using [grid] = prepare_leadfield(cfg); and the rest is the same as in tutorial (1). Q1. Is it a correct sequence of steps to do source reconstruction for EEG data in Fieldtrip or do I need to do something more different? Q2. My second question is about the function strel_bol() which I am not familiar with (it is used in script (2)). One can see from the script that it is a structural element function used in the Image Processing toolbox but this toolbox has only function strel(). Could you please explain what the strel_bol(5) is? Can it be replaced by something like strel('disk',5)? Your help is very much appreciated! Thank you, Andrei. Andrei Medvedev, PhD Assistant Professor, EEG and Optical Imaging Lab Center for Functional and Molecular Imaging Georgetown University Washington DC, 20057 From mark.drakesmith at POSTGRAD.MANCHESTER.AC.UK Thu Jul 9 16:29:41 2009 From: mark.drakesmith at POSTGRAD.MANCHESTER.AC.UK (Mark Drakesmith) Date: Thu, 9 Jul 2009 15:29:41 +0100 Subject: beamformer source localization for EEG In-Reply-To: <20090708224339.AEY51491@mstore-prod-1.pdc.uis.georgetown.edu> Message-ID: Hi. I ran into the same problem with strel_bol when trying to create a BEM model. It relies on a custom script which implements the strel command in the image processing toolbox. The script can be found in the message archives here: https://listserv.surfnet.nl/scripts/wa.exe?A2=ind0703&L=FIELDTRIP&P=R14835&D=0 Regards, Mark -- Mark Drakesmith PhD Student Neuroscience and Aphasia Research Unit (NARU) University of Manchester Andrei Medvedev wrote: > Dear Fieldtrip developers/users > > I am a relatively recent user of Fieldtrip (and very much appreciative of this software). Having good experience with the analysis of brain oscillations etc, I now want to proceed with source reconstruction and it appeared that I need some help with the beamformer technique for EEG data. I am trying to use it for EEG data collected with a 128-channel EGI system. I also have structural MRI data for my subjects and would like to use realistic head models etc. I was following the Fieldtrip tutorial (1) “Localizing oscillatory sources using beamformer techniques”, which applies this method to MEG data. My understanding is that the only difference I would make when applying this approach to EEG is that, instead of the command > > vol = prepare_singleshell(cfg, segmentedmriF); > > which implements Nolte’s approach for MEG data, I need to make a BEM model for EEG data and I thought that I could use an example Matlab script (2) “Create BEM headmodel for EEG” from the Fieldtrip site. This would give me a vol variable which I then use to calculate the grid variable using > > [grid] = prepare_leadfield(cfg); > > and the rest is the same as in tutorial (1). > > Q1. Is it a correct sequence of steps to do source reconstruction for EEG data in Fieldtrip or do I need to do something more different? > > Q2. My second question is about the function strel_bol() which I am not familiar with (it is used in script (2)). One can see from the script that it is a structural element function used in the Image Processing toolbox but this toolbox has only function strel(). Could you please explain what the strel_bol(5) is? Can it be replaced by something like strel('disk',5)? > > Your help is very much appreciated! > > Thank you, > > Andrei. > > Andrei Medvedev, PhD > Assistant Professor, > EEG and Optical Imaging Lab > Center for Functional and Molecular Imaging > Georgetown University > Washington DC, 20057 > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Thu Jul 9 20:26:58 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Thu, 9 Jul 2009 20:26:58 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. Message-ID: Dear all, An update on my progress reading .fif mri's with fieldtrip (using the mne toolbox). I'm happy to announce it worked! Thanks to Roberts new script and Jan-Mathijs' suggestion to swap the x and y coordinates of the vol.bnd.pnt variable. I used the realignment to mni template which can be found in one of the example scripts (I think that is a creation of Ingrids) and found out that also the x and y coordinates of the normalized-to-mni mri should be swapped. My batch script can now be found at: http://fieldtrip.fcdonders.nl/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space I hope that helps more neuromag-meg-people! Thanks for your help! Yours, Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen Gesendet: Mi 08.07.2009 10:22 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, Please note that the X and Y axis in the neuromag head-coordinate system are swapped with respect to the CTF and 4D convention; i.e. X axis through the ears, and Y-axis to the nose. What usually works for me is discarding the mri.transform (mri = rmfield(mri, 'transform'), and call volumerealign in the interactive mode. You can then specify the location of the fiducials yourself and the output mri of the function will contain a transformation matrix according to ctf convention. This at least ensures that volumesegment etc kind of work properly. Yet, it is important to know that of course the gradiometer positions in the data are defined in neuromag convention, so after preparing your volume conduction model you probably have to swap the x and y coordinates of the vol.bnd.pnt (assuming you use a singleshell as volume conductor model), before proceeding to visualization (headmodelplot; just to check whether the head fits in the helmet), leadfield computation (only makes sense if the head fits in the helmet), and sourceanalysis (idem). Yours, JM On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > Hi Hanneke, > > I have tried importing another MRI fif file which I still had on > disk using the following modification of the fieldtrip/fileio/ > read_mri.m code > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %%%%%%%%%%%%%% > elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') > % use the mne functions to read the Neuromag MRI > hdr = fiff_read_mri(filename); > img = cat(3, hdr.slices.data); > hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data > to save memory > transform = hdr.trans.trans; > > and then slightly further down in the code > > % set up the axes of the volume in voxel coordinates > nx = size(img,1); > ny = size(img,2); > nz = size(img,3); > mri.dim = [nx ny nz]; > % store the anatomical data > mri.anatomy = img; > % store the header with all fileformat specific details > mri.hdr = hdr; > try > % if present, store the homogenous transformation matrix > mri.transform = transform; > end > > This results in a warning of the MNE fiff_read_mri function > > >> mri = read_mri('lp_mri_headcoords.fif') > Reading slice information and pixel data..50..100..126..[done] > The slices are not equally spaced. Voxel transformation will not > be included > > mri = > dim: [256 256 126] > anatomy: [256x256x126 int16] > hdr: [1x1 struct] > transform: [4x4 double] > > and the resulting coordinate transformation matrix is not fully > correct. You can check the coordinates by plotting it intreactively > in sourceplot (after converting the image data from int16 into > double). > > Perhaps one of the Neuromag experts on the list can help you further. > > best regards, > Robert > > PS atatched is the latest read_mri function, which includes the > call to fiff_read_mri. > > > On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> The mri.fif file that you sent only contains the header >> information, but not the slice/image information. >> >> >> fiff_read_mri('mri.fif') >> Reading slice information and pixel data.??? Error using ==> >> fiff_read_mri at 116 >> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >> >> Please also send the corresponding slice data. >> >> Robert >> >> >> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >> >>> Hi Robert, >>> >>> Thanks for your reply. I have tried the meg_pd function loadmri >>> (via read_mri in fieldtrip) but I got the feedback: 'error >>> loading mri-file'. So I have no idea what is going wrong. I will >>> send you the example mri-file right now. It is probably not to >>> difficult to work something out but I want to be sure that the >>> mri head coordinates end up in the right way as device coordinates. >>> >>> Thanks in advance! >>> Viele Gruße aus Düsseldorf ;-) >>> >>> Hanneke >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Fri Jul 10 14:13:06 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 10 Jul 2009 14:13:06 +0200 Subject: beamformer source localization for EEG In-Reply-To: <20090708224339.AEY51491@mstore-prod-1.pdc.uis.georgetown.edu> Message-ID: On 9 Jul 2009, at 4:43, Andrei Medvedev wrote: > Q1. Is it a correct sequence of steps to do source reconstruction > for EEG data in Fieldtrip or do I need to do something more different? Hi Andrei You'll also have to ensure that the EEG data that you are analyzing is average referenced over all electrodes that you intend to use during source reconstruction. The averager referencing should be done prior to freqanalysis. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 10 16:08:37 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Fri, 10 Jul 2009 16:08:37 +0200 Subject: sourceinterpolation coordinates. Message-ID: Dear all, I have entered the next step: sourceanalysis. But I have encountered another problem, I think in sourceinterpolation or maybe volumenormalise. After running the script as I have described before (to make the headmodel and the grid) I do the following; load f %load frequency data cfg = []; cfg.grid = grid; cfg.frequency = 10; cfg.vol = hdm; cfg.grad = f.grad; cfg.projectnoise = 'yes'; cfg.lambda = 5e-28; cfg.method = 'dics'; cfg.feedback = 'textbar'; source = sourceanalysis(cfg,f); then: sd = sourcedescriptives([],source); then: load norm %normalized to MNI brain of single subject sdint = sourceinterpolate([], sd , norm); clear norm %plotting the results cfg.funparameter = 'avg.nai'; cfg.anaparameter = 'anatomy'; cfg.funcolormap = 'jet'; cfg.method = 'ortho'; cfg.projmethod = 'nearest'; cfg.sphereradius = 20; cfg.surffile = 'surface_l4_both'; figure; sourceplot(cfg,sdint) The result is attached to this email, the gird seems to have moved upwards and somewhat to the front relative to the normalised mri. But it seems to have the right size. I have been playing around with sourceunits mriunits x-y coordinates but nothing helps, or it makes it even worse. Does anybody have an idea what's happening? Yours, Hanneke www.linkedin.com/in/hannekevandijk tel. +49 (0)211 81 13074 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 10 16:23:32 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke van Dijk) Date: Fri, 10 Jul 2009 16:23:32 +0200 Subject: sourceinterpolation coordinates. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F3486@Mail2-UKD.VMED.UKD> Message-ID: Now there is an attachment too! sorry On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > Dear all, > > I have entered the next step: sourceanalysis. But I have encountered > another problem, I think in sourceinterpolation or maybe volumenormalise. > > After running the script as I have described before (to make the headmodel > and the grid) I do the following; > > load f %load frequency data > cfg = []; > cfg.grid = grid; > cfg.frequency = 10; > cfg.vol = hdm; > cfg.grad = f.grad; > cfg.projectnoise = 'yes'; > cfg.lambda = 5e-28; > cfg.method = 'dics'; > cfg.feedback = 'textbar'; > > source = sourceanalysis(cfg,f); > > then: > > sd = sourcedescriptives([],source); > > then: > > load norm %normalized to MNI brain of single subject > sdint = sourceinterpolate([], sd , norm); > clear norm > %plotting the results > cfg.funparameter = 'avg.nai'; > cfg.anaparameter = 'anatomy'; > cfg.funcolormap = 'jet'; > cfg.method = 'ortho'; > cfg.projmethod = 'nearest'; > cfg.sphereradius = 20; > cfg.surffile = 'surface_l4_both'; > figure; > sourceplot(cfg,sdint) > > The result is attached to this email, the gird seems to have moved upwards > and somewhat to the front relative to the normalised mri. But it seems to > have the right size. I have been playing around with sourceunits mriunits > x-y coordinates but nothing helps, or it makes it even worse. > > Does anybody have an idea what's happening? > > Yours, > Hanneke > > www.linkedin.com/in/hannekevandijk > tel. +49 (0)211 81 13074 > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source.jpg Type: image/jpeg Size: 21500 bytes Desc: not available URL: From chintan_student at YAHOO.CO.IN Sat Jul 11 00:33:12 2009 From: chintan_student at YAHOO.CO.IN (shah chintan) Date: Sat, 11 Jul 2009 04:03:12 +0530 Subject: time frequency analysis In-Reply-To: <20358EAF-D21B-4F0C-AF51-6CD647ABF0A1@fcdonders.ru.nl> Message-ID: HI,   I have very simple problem. Actually I got time frequency data in excel sheet.  Its a data of 81 channels.   Now how can I plot the graphs and load the data in fieldtrip.  The final result I want is to plot the data on scalp.    Thanking you   Chintan Looking for local information? Find it on Yahoo! Local http://in.local.yahoo.com/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.m.bartlett at GMAIL.COM Sat Jul 11 01:09:07 2009 From: adrian.m.bartlett at GMAIL.COM (Adrian Bartlett) Date: Fri, 10 Jul 2009 19:09:07 -0400 Subject: time frequency analysis In-Reply-To: <335136.49897.qm@web95411.mail.in2.yahoo.com> Message-ID: Chintan: To read in your data to MATLAB from an excel spread sheet; you'll need to use the xlsread function. The rest should follow from the basic tutorial on the site. Hope that helps. On Fri, Jul 10, 2009 at 6:33 PM, shah chintan wrote: > HI, > > I have very simple problem. Actually I got time frequency data in excel > sheet. Its a data of 81 channels. Now how can I plot the graphs and load > the data in fieldtrip. The final result I want is to plot the data on > scalp. > > Thanking you > > Chintan > > ------------------------------ > Love Cricket? Check out live scores, photos, video highlights and more. Click > here . > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > -- Adrian M. Bartlett, BA Neuroscience Graduate Diploma Program Graduate Program in Psychology Perception & Plasticity Laboratory Centre for Vision Research York University, Toronto, ON, Canada -- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Mon Jul 13 10:42:02 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 13 Jul 2009 09:42:02 +0100 Subject: sourceinterpolation coordinates. In-Reply-To: Message-ID: Hi Hanneke, This looks like a difference in origin to me. Note that the MNI coordinate system has the cardinal axes pointing in the same directions as the neuromag headcoordinate system, but that the origin is different. The origin of the NM-headcoordinate system is on the interauricular line, the point where the y-axis hits it. This is approximately somewhere close or in the pons. The MNI origin is the AC, which is somewhere 'higher' in the volume. I suspect that the preparation of the grids did not work out without flaws. Alternatively, which I think is the most likely explanation, is that you should use the MNI-template as an MRI for the interpolation, rather than a normalized single subject MRI. I don't know about the single subject MRIs, but at least the MNI-template is explicitly in MNI-space, whereas the normalized MRI could be in head-space. This could explain the shift. Anyway, if the latter hunch is the explanation, then the sourceanalysis results might be trusted, if the first hunch was the one, the sourceanalysis results are most certainly wrong. As a matter of fact the whole swapping around with coordinates should not be necessary if the basic fieldtrip-code is adjusted such that it can handle neuromag-based headcoordinate systems in an appropriate way. This relates to an earlier remark on the list, which rightfully states that the approach you (we) have been taken so far seems a bit tedious. Ideally, in other words, the middle man has to be taken out, which in this case is the intermediate transformation to a ctf-based coordinate system. Hope this helps, JM Quoting Hanneke van Dijk : > Now there is an attachment too! sorry > > On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < > Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > >> Dear all, >> >> I have entered the next step: sourceanalysis. But I have encountered >> another problem, I think in sourceinterpolation or maybe volumenormalise. >> >> After running the script as I have described before (to make the headmodel >> and the grid) I do the following; >> >> load f %load frequency data >> cfg = []; >> cfg.grid = grid; >> cfg.frequency = 10; >> cfg.vol = hdm; >> cfg.grad = f.grad; >> cfg.projectnoise = 'yes'; >> cfg.lambda = 5e-28; >> cfg.method = 'dics'; >> cfg.feedback = 'textbar'; >> >> source = sourceanalysis(cfg,f); >> >> then: >> >> sd = sourcedescriptives([],source); >> >> then: >> >> load norm %normalized to MNI brain of single subject >> sdint = sourceinterpolate([], sd , norm); >> clear norm >> %plotting the results >> cfg.funparameter = 'avg.nai'; >> cfg.anaparameter = 'anatomy'; >> cfg.funcolormap = 'jet'; >> cfg.method = 'ortho'; >> cfg.projmethod = 'nearest'; >> cfg.sphereradius = 20; >> cfg.surffile = 'surface_l4_both'; >> figure; >> sourceplot(cfg,sdint) >> >> The result is attached to this email, the gird seems to have moved upwards >> and somewhat to the front relative to the normalised mri. But it seems to >> have the right size. I have been playing around with sourceunits mriunits >> x-y coordinates but nothing helps, or it makes it even worse. >> >> Does anybody have an idea what's happening? >> >> Yours, >> Hanneke >> >> www.linkedin.com/in/hannekevandijk >> tel. +49 (0)211 81 13074 >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ------------------------------------------------------------------ The University of Glasgow, Department of Psychology WebMail system ------------------------------------------------------------------ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From chintan_student at YAHOO.CO.IN Mon Jul 13 16:25:50 2009 From: chintan_student at YAHOO.CO.IN (shah chintan) Date: Mon, 13 Jul 2009 19:55:50 +0530 Subject: time frequency analysis. Message-ID: Hi,   I am not a regular user of fieldtrip.  I have a very simple problem to solve.  I have got a data of time frequency analysis in excel data.  Now my goal is to plot the 3d figure on scalp with this data.  Now I know the following steps to be done.   1.  As I got the data in excel sheet,  I need to load this excel data in matlab along with their channel names.  Given the range on both the axis.   2.  Now I need to load the channel locations   3.  Finally I need to tell matlab to plot this data on 3d scalp using those channel locations.   Now Please help me with this.   Best Regards,   Chintan   Yahoo! recommends that you upgrade to the new and safer Internet Explorer 8. http://downloads.yahoo.com/in/internetexplorer/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Thu Jul 16 16:21:55 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Thu, 16 Jul 2009 16:21:55 +0200 Subject: AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. Message-ID: Hi Jan-Mathijs, Thanks for your suggestions and your time, but I haven't been able to fix it.... I agree that this work-around shouldn't be neccesary but I guess we first have to know what to fix.... You suggested to use the template_mri in MNI coordinates to interpolate to that seemed simple so I tried it immediately, however it didn't help. It didn't change a thing. So your other suggestion about the origin being different should be looked at, but this raised a few questions.. First, I thought because I had realigned the mri to ctf coordinates using volumerealign, the NM coordinates wouldn't matter anymore. Second, the headmodel I have created using the realigned, segmented and flipped mri looks very good to me relative to the gradiometer locations and the grid as well. (see http://fieldtrip.fcdonders.nl/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space). Additionally, the alpha source that I found using this headmodel and looking at the grid only (without the interpolation) looked believable as well. I have also segmentated the volumenormalised mri, which actually makes the later produced single_shell headmodel go downward and posterior as well. While the grid stays the same and 'goodlooking' ;-). So I am inclined to think that something strange is happening during the volumenormalise or sourceinterpolation procedure moving the mri slightly downward and more posterior. I would fix it myself but I don't know where I should look... it also puzzles me why this only happens 'for from NM- to ctf coordinates realigned' mri's. It seems that fieldtrip remembers that the mri was originally a NM... Hope you or someone else can help me further... Groetjes Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen Gesendet: Mo 13.07.2009 10:42 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. Hi Hanneke, This looks like a difference in origin to me. Note that the MNI coordinate system has the cardinal axes pointing in the same directions as the neuromag headcoordinate system, but that the origin is different. The origin of the NM-headcoordinate system is on the interauricular line, the point where the y-axis hits it. This is approximately somewhere close or in the pons. The MNI origin is the AC, which is somewhere 'higher' in the volume. I suspect that the preparation of the grids did not work out without flaws. Alternatively, which I think is the most likely explanation, is that you should use the MNI-template as an MRI for the interpolation, rather than a normalized single subject MRI. I don't know about the single subject MRIs, but at least the MNI-template is explicitly in MNI-space, whereas the normalized MRI could be in head-space. This could explain the shift. Anyway, if the latter hunch is the explanation, then the sourceanalysis results might be trusted, if the first hunch was the one, the sourceanalysis results are most certainly wrong. As a matter of fact the whole swapping around with coordinates should not be necessary if the basic fieldtrip-code is adjusted such that it can handle neuromag-based headcoordinate systems in an appropriate way. This relates to an earlier remark on the list, which rightfully states that the approach you (we) have been taken so far seems a bit tedious. Ideally, in other words, the middle man has to be taken out, which in this case is the intermediate transformation to a ctf-based coordinate system. Hope this helps, JM Quoting Hanneke van Dijk : > Now there is an attachment too! sorry > > On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < > Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > >> Dear all, >> >> I have entered the next step: sourceanalysis. But I have encountered >> another problem, I think in sourceinterpolation or maybe volumenormalise. >> >> After running the script as I have described before (to make the headmodel >> and the grid) I do the following; >> >> load f %load frequency data >> cfg = []; >> cfg.grid = grid; >> cfg.frequency = 10; >> cfg.vol = hdm; >> cfg.grad = f.grad; >> cfg.projectnoise = 'yes'; >> cfg.lambda = 5e-28; >> cfg.method = 'dics'; >> cfg.feedback = 'textbar'; >> >> source = sourceanalysis(cfg,f); >> >> then: >> >> sd = sourcedescriptives([],source); >> >> then: >> >> load norm %normalized to MNI brain of single subject >> sdint = sourceinterpolate([], sd , norm); >> clear norm >> %plotting the results >> cfg.funparameter = 'avg.nai'; >> cfg.anaparameter = 'anatomy'; >> cfg.funcolormap = 'jet'; >> cfg.method = 'ortho'; >> cfg.projmethod = 'nearest'; >> cfg.sphereradius = 20; >> cfg.surffile = 'surface_l4_both'; >> figure; >> sourceplot(cfg,sdint) >> >> The result is attached to this email, the gird seems to have moved upwards >> and somewhat to the front relative to the normalised mri. But it seems to >> have the right size. I have been playing around with sourceunits mriunits >> x-y coordinates but nothing helps, or it makes it even worse. >> >> Does anybody have an idea what's happening? >> >> Yours, >> Hanneke >> >> www.linkedin.com/in/hannekevandijk >> tel. +49 (0)211 81 13074 >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ------------------------------------------------------------------ The University of Glasgow, Department of Psychology WebMail system ------------------------------------------------------------------ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jul 16 17:04:14 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 16 Jul 2009 16:04:14 +0100 Subject: AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F3490@Mail2-UKD.VMED.UKD> Message-ID: Hi Hanneke, source.pos should contain the MNI-based coordinates before calling sourceinterpolate; I suspect that your single subject source data contains the original (neuromag-space) positions. This is of course how it should be for the sourceanalysis, because there the grid points have to be defined in neuromag space. Yet, for the interpolation this is wrong, because sourceinterpolate assumes that the coordinate frames of both mri and functional volume are the same. Because the neuromag coordinates are shifted with respect to the MNI- coordinates, this still could explain the discrepancy. I suggest to replace sd.pos with template_grid.pos before calling sourceinterpolate. Best, Jan-Mathijs On Jul 16, 2009, at 3:21 PM, Hanneke Van Dijk wrote: > Hi Jan-Mathijs, > > Thanks for your suggestions and your time, but I haven't been able > to fix it.... > > I agree that this work-around shouldn't be neccesary but I guess we > first have to know what to fix.... > > You suggested to use the template_mri in MNI coordinates to > interpolate to that seemed simple so I tried it immediately, > however it didn't help. It didn't change a thing. > > So your other suggestion about the origin being different should be > looked at, but this raised a few questions.. > First, I thought because I had realigned the mri to ctf coordinates > using volumerealign, the NM coordinates wouldn't matter anymore. > Second, the headmodel I have created using the realigned, segmented > and flipped mri looks very good to me relative to the gradiometer > locations and the grid as well. > (see http://fieldtrip.fcdonders.nl/example/ > read_neuromag_mri_and_create_single- > subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_spa > ce). Additionally, the alpha source that I found using this > headmodel and looking at the grid only (without the interpolation) > looked believable as well. > > I have also segmentated the volumenormalised mri, which actually > makes the later produced single_shell headmodel go downward and > posterior as well. While the grid stays the same and > 'goodlooking' ;-). > So I am inclined to think that something strange is happening > during the volumenormalise or sourceinterpolation procedure moving > the mri slightly downward and more posterior. I would fix it myself > but I don't know where I should look... it also puzzles me why this > only happens 'for from NM- to ctf coordinates realigned' mri's. It > seems that fieldtrip remembers that the mri was originally a NM... > > Hope you or someone else can help me further... > > Groetjes Hanneke > > > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen > Gesendet: Mo 13.07.2009 10:42 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. > > Hi Hanneke, > > This looks like a difference in origin to me. Note that the MNI > coordinate system has the cardinal axes pointing in the same > directions as the neuromag headcoordinate system, but that the origin > is different. The origin of the NM-headcoordinate system is on the > interauricular line, the point where the y-axis hits it. This is > approximately somewhere close or in the pons. The MNI origin is the > AC, which is somewhere 'higher' in the volume. I suspect that the > preparation of the grids did not work out without flaws. > Alternatively, which I think is the most likely explanation, is that > you should use the MNI-template as an MRI for the interpolation, > rather than a normalized single subject MRI. I don't know about the > single subject MRIs, but at least the MNI-template is explicitly in > MNI-space, whereas the normalized MRI could be in head-space. This > could explain the shift. > Anyway, if the latter hunch is the explanation, then the > sourceanalysis results might be trusted, if the first hunch was the > one, the sourceanalysis results are most certainly wrong. > > As a matter of fact the whole swapping around with coordinates should > not be necessary if the basic fieldtrip-code is adjusted such that it > can handle neuromag-based headcoordinate systems in an appropriate > way. This relates to an earlier remark on the list, which rightfully > states that the approach you (we) have been taken so far seems a bit > tedious. Ideally, in other words, the middle man has to be taken out, > which in this case is the intermediate transformation to a ctf-based > coordinate system. > > Hope this helps, > > JM > > > Quoting Hanneke van Dijk : > >> Now there is an attachment too! sorry >> >> On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < >> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >> >>> Dear all, >>> >>> I have entered the next step: sourceanalysis. But I have encountered >>> another problem, I think in sourceinterpolation or maybe >>> volumenormalise. >>> >>> After running the script as I have described before (to make the >>> headmodel >>> and the grid) I do the following; >>> >>> load f %load frequency data >>> cfg = []; >>> cfg.grid = grid; >>> cfg.frequency = 10; >>> cfg.vol = hdm; >>> cfg.grad = f.grad; >>> cfg.projectnoise = 'yes'; >>> cfg.lambda = 5e-28; >>> cfg.method = 'dics'; >>> cfg.feedback = 'textbar'; >>> >>> source = sourceanalysis(cfg,f); >>> >>> then: >>> >>> sd = sourcedescriptives([],source); >>> >>> then: >>> >>> load norm %normalized to MNI brain of single subject >>> sdint = sourceinterpolate([], sd , norm); >>> clear norm >>> %plotting the results >>> cfg.funparameter = 'avg.nai'; >>> cfg.anaparameter = 'anatomy'; >>> cfg.funcolormap = 'jet'; >>> cfg.method = 'ortho'; >>> cfg.projmethod = 'nearest'; >>> cfg.sphereradius = 20; >>> cfg.surffile = 'surface_l4_both'; >>> figure; >>> sourceplot(cfg,sdint) >>> >>> The result is attached to this email, the gird seems to have >>> moved upwards >>> and somewhat to the front relative to the normalised mri. But it >>> seems to >>> have the right size. I have been playing around with sourceunits >>> mriunits >>> x-y coordinates but nothing helps, or it makes it even worse. >>> >>> Does anybody have an idea what's happening? >>> >>> Yours, >>> Hanneke >>> >>> www.linkedin.com/in/hannekevandijk >>> tel. +49 (0)211 81 13074 >>> >>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of the >>> FieldTrip toolbox, to share experiences and to discuss new ideas >>> for MEG >>> and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>> http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > > > ------------------------------------------------------------------ > The University of Glasgow, Department of Psychology WebMail system > ------------------------------------------------------------------ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jrkerlin at UCDAVIS.EDU Thu Jul 16 19:57:58 2009 From: jrkerlin at UCDAVIS.EDU (Jess R. Kerlin) Date: Thu, 16 Jul 2009 10:57:58 -0700 Subject: beamformer source localization for EEG In-Reply-To: <20358EAF-D21B-4F0C-AF51-6CD647ABF0A1@fcdonders.ru.nl> Message-ID: Hi FTers, I'm using a 128 electrode Biosemi EEG system, attempting to perform beam-former source analysis. I had go all the way back to Matlab 6.5 and SPM 2, as well as some trial and error to get through it, but I finally managed to get a nolte BEM using mostly the same code as in the example script "BEM head model for EEG" script". However, prepare_leadfield throws the error "unsupported volume conductor model for EEG", which is clearly the case looking at the prepare_leadfield code. A few questions on this topic: Does fieldtrip actually support beamforming source localization on BEM models for EEG? Or, given the coarser spatial resolution of EEG, is it better to use a simpler spherical model? Either way, does anyone have successful sample code for beamformer localization EEG data, start to finish? And for the developers: I love your work. I notice the move from SPM 2 to SPM 8 is in the development cue. Is there any release coming soon which will use SPM 8 to make this process smoother? Many thanks, Jess Kerlin Robert Oostenveld wrote: > On 9 Jul 2009, at 4:43, Andrei Medvedev wrote: >> Q1. Is it a correct sequence of steps to do source reconstruction for >> EEG data in Fieldtrip or do I need to do something more different? > > Hi Andrei > > You'll also have to ensure that the EEG data that you are analyzing is > average referenced over all electrodes that you intend to use during > source reconstruction. The averager referencing should be done prior > to freqanalysis. > > best regards, > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From v.litvak at ION.UCL.AC.UK Thu Jul 16 20:37:40 2009 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Thu, 16 Jul 2009 19:37:40 +0100 Subject: beamformer source localization for EEG In-Reply-To: <4A5F6A26.9060404@ucdavis.edu> Message-ID: Dear Jess and others, SPM8 and Fieldtrip share infrastructure for forward modelling and leadfield computation. Therefore, you can use SPM8 to prepare head model and sensor definition that you can later use for FT beamforming. This works for both EEG and MEG. MEEGTools toolbox in SPM8 contains some functions that you can use as examples for where to find vol and sens in SPM8 dataset. You'll need to go through SPM8 processing stream (at least with some sample data). Look at the manual for additional instructions. Best, Vladimir On Thu, Jul 16, 2009 at 6:57 PM, Jess R. Kerlin wrote: > Hi FTers, > > I'm using a 128 electrode Biosemi EEG system, attempting to perform > beam-former source analysis. I had go all the way back to Matlab 6.5 and SPM > 2, as well as some trial and error to get through it,  but I finally managed > to get a nolte BEM  using mostly the same code as in the example script "BEM > head model for EEG" script". However, prepare_leadfield throws the error > "unsupported volume conductor model for EEG", which is clearly the case > looking at the prepare_leadfield code. > > A few questions on this topic: > > Does fieldtrip actually support beamforming source localization on BEM > models for EEG? Or, given the coarser spatial resolution of EEG, is it > better to use a simpler spherical model?  Either way, does anyone have > successful sample code for beamformer localization EEG data, start to > finish? > > And for the developers: > I love your work. > I notice the move from SPM 2 to SPM 8 is in the development cue.  Is there > any release coming soon which will use SPM 8 to make this process smoother? > > Many thanks, > > Jess Kerlin > > Robert Oostenveld wrote: >> >> On 9 Jul 2009, at 4:43, Andrei Medvedev wrote: >>> >>> Q1. Is it a correct sequence of steps to do source reconstruction for EEG >>> data in Fieldtrip or do I need to do something more different? >> >> Hi Andrei >> >> You'll also have to ensure that the EEG data that you are analyzing is >> average referenced over all electrodes that you intend to use during source >> reconstruction. The averager referencing should be done prior to >> freqanalysis. >> >> best regards, >> Robert >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From hungptit at GMAIL.COM Fri Jul 17 07:09:56 2009 From: hungptit at GMAIL.COM (Hung Dang) Date: Thu, 16 Jul 2009 23:09:56 -0600 Subject: beamformer source localization for EEG In-Reply-To: Message-ID: Dear all, We have known that beamformers and other good source localization techniques have zero localization error for single source. However, in real applications there are many sources inside the brain then we will have non-zero localization error. How can we justify which inverse solutions is better? Thanks a lot Hung ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 17 08:50:31 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Fri, 17 Jul 2009 08:50:31 +0200 Subject: AW: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. Message-ID: Dear Jan-Matijs, It worked!!! Thanks so much! We should think of a way to fix the differences between handeling CTF and NM data. I will have a look at it! Yours, Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen Gesendet: Do 16.07.2009 17:04 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. Hi Hanneke, source.pos should contain the MNI-based coordinates before calling sourceinterpolate; I suspect that your single subject source data contains the original (neuromag-space) positions. This is of course how it should be for the sourceanalysis, because there the grid points have to be defined in neuromag space. Yet, for the interpolation this is wrong, because sourceinterpolate assumes that the coordinate frames of both mri and functional volume are the same. Because the neuromag coordinates are shifted with respect to the MNI- coordinates, this still could explain the discrepancy. I suggest to replace sd.pos with template_grid.pos before calling sourceinterpolate. Best, Jan-Mathijs On Jul 16, 2009, at 3:21 PM, Hanneke Van Dijk wrote: > Hi Jan-Mathijs, > > Thanks for your suggestions and your time, but I haven't been able > to fix it.... > > I agree that this work-around shouldn't be neccesary but I guess we > first have to know what to fix.... > > You suggested to use the template_mri in MNI coordinates to > interpolate to that seemed simple so I tried it immediately, > however it didn't help. It didn't change a thing. > > So your other suggestion about the origin being different should be > looked at, but this raised a few questions.. > First, I thought because I had realigned the mri to ctf coordinates > using volumerealign, the NM coordinates wouldn't matter anymore. > Second, the headmodel I have created using the realigned, segmented > and flipped mri looks very good to me relative to the gradiometer > locations and the grid as well. > (see http://fieldtrip.fcdonders.nl/example/ > read_neuromag_mri_and_create_single- > subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_spa > ce). Additionally, the alpha source that I found using this > headmodel and looking at the grid only (without the interpolation) > looked believable as well. > > I have also segmentated the volumenormalised mri, which actually > makes the later produced single_shell headmodel go downward and > posterior as well. While the grid stays the same and > 'goodlooking' ;-). > So I am inclined to think that something strange is happening > during the volumenormalise or sourceinterpolation procedure moving > the mri slightly downward and more posterior. I would fix it myself > but I don't know where I should look... it also puzzles me why this > only happens 'for from NM- to ctf coordinates realigned' mri's. It > seems that fieldtrip remembers that the mri was originally a NM... > > Hope you or someone else can help me further... > > Groetjes Hanneke > > > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen > Gesendet: Mo 13.07.2009 10:42 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. > > Hi Hanneke, > > This looks like a difference in origin to me. Note that the MNI > coordinate system has the cardinal axes pointing in the same > directions as the neuromag headcoordinate system, but that the origin > is different. The origin of the NM-headcoordinate system is on the > interauricular line, the point where the y-axis hits it. This is > approximately somewhere close or in the pons. The MNI origin is the > AC, which is somewhere 'higher' in the volume. I suspect that the > preparation of the grids did not work out without flaws. > Alternatively, which I think is the most likely explanation, is that > you should use the MNI-template as an MRI for the interpolation, > rather than a normalized single subject MRI. I don't know about the > single subject MRIs, but at least the MNI-template is explicitly in > MNI-space, whereas the normalized MRI could be in head-space. This > could explain the shift. > Anyway, if the latter hunch is the explanation, then the > sourceanalysis results might be trusted, if the first hunch was the > one, the sourceanalysis results are most certainly wrong. > > As a matter of fact the whole swapping around with coordinates should > not be necessary if the basic fieldtrip-code is adjusted such that it > can handle neuromag-based headcoordinate systems in an appropriate > way. This relates to an earlier remark on the list, which rightfully > states that the approach you (we) have been taken so far seems a bit > tedious. Ideally, in other words, the middle man has to be taken out, > which in this case is the intermediate transformation to a ctf-based > coordinate system. > > Hope this helps, > > JM > > > Quoting Hanneke van Dijk : > >> Now there is an attachment too! sorry >> >> On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < >> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >> >>> Dear all, >>> >>> I have entered the next step: sourceanalysis. But I have encountered >>> another problem, I think in sourceinterpolation or maybe >>> volumenormalise. >>> >>> After running the script as I have described before (to make the >>> headmodel >>> and the grid) I do the following; >>> >>> load f %load frequency data >>> cfg = []; >>> cfg.grid = grid; >>> cfg.frequency = 10; >>> cfg.vol = hdm; >>> cfg.grad = f.grad; >>> cfg.projectnoise = 'yes'; >>> cfg.lambda = 5e-28; >>> cfg.method = 'dics'; >>> cfg.feedback = 'textbar'; >>> >>> source = sourceanalysis(cfg,f); >>> >>> then: >>> >>> sd = sourcedescriptives([],source); >>> >>> then: >>> >>> load norm %normalized to MNI brain of single subject >>> sdint = sourceinterpolate([], sd , norm); >>> clear norm >>> %plotting the results >>> cfg.funparameter = 'avg.nai'; >>> cfg.anaparameter = 'anatomy'; >>> cfg.funcolormap = 'jet'; >>> cfg.method = 'ortho'; >>> cfg.projmethod = 'nearest'; >>> cfg.sphereradius = 20; >>> cfg.surffile = 'surface_l4_both'; >>> figure; >>> sourceplot(cfg,sdint) >>> >>> The result is attached to this email, the gird seems to have >>> moved upwards >>> and somewhat to the front relative to the normalised mri. But it >>> seems to >>> have the right size. I have been playing around with sourceunits >>> mriunits >>> x-y coordinates but nothing helps, or it makes it even worse. >>> >>> Does anybody have an idea what's happening? >>> >>> Yours, >>> Hanneke >>> >>> www.linkedin.com/in/hannekevandijk >>> tel. +49 (0)211 81 13074 >>> >>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of the >>> FieldTrip toolbox, to share experiences and to discuss new ideas >>> for MEG >>> and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>> http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > > > ------------------------------------------------------------------ > The University of Glasgow, Department of Psychology WebMail system > ------------------------------------------------------------------ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jul 17 09:57:24 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 17 Jul 2009 08:57:24 +0100 Subject: AW: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F3491@Mail2-UKD.VMED.UKD> Message-ID: Dear Hanneke, I am glad it worked out fine now. Note that the particular step which was bugging you is the same for both CTF and neuromag data. Best, JM On Jul 17, 2009, at 7:50 AM, Hanneke Van Dijk wrote: > Dear Jan-Matijs, > > It worked!!! Thanks so much! We should think of a way to fix the > differences between handeling CTF and NM data. I will have a look > at it! > > Yours, > > Hanneke > > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen > Gesendet: Do 16.07.2009 17:04 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise > sourceinterpolation coordinates. > > Hi Hanneke, > > source.pos should contain the MNI-based coordinates before calling > sourceinterpolate; I suspect that your single subject source data > contains the original (neuromag-space) positions. This is of course > how it should be for the sourceanalysis, because there the grid > points have to be defined in neuromag space. Yet, for the > interpolation this is wrong, because sourceinterpolate assumes that > the coordinate frames of both mri and functional volume are the same. > Because the neuromag coordinates are shifted with respect to the MNI- > coordinates, this still could explain the discrepancy. I suggest to > replace sd.pos with template_grid.pos before calling > sourceinterpolate. > > Best, > > Jan-Mathijs > > On Jul 16, 2009, at 3:21 PM, Hanneke Van Dijk wrote: > >> Hi Jan-Mathijs, >> >> Thanks for your suggestions and your time, but I haven't been able >> to fix it.... >> >> I agree that this work-around shouldn't be neccesary but I guess we >> first have to know what to fix.... >> >> You suggested to use the template_mri in MNI coordinates to >> interpolate to that seemed simple so I tried it immediately, >> however it didn't help. It didn't change a thing. >> >> So your other suggestion about the origin being different should be >> looked at, but this raised a few questions.. >> First, I thought because I had realigned the mri to ctf coordinates >> using volumerealign, the NM coordinates wouldn't matter anymore. >> Second, the headmodel I have created using the realigned, segmented >> and flipped mri looks very good to me relative to the gradiometer >> locations and the grid as well. >> (see http://fieldtrip.fcdonders.nl/example/ >> read_neuromag_mri_and_create_single- >> subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_sp >> a >> ce). Additionally, the alpha source that I found using this >> headmodel and looking at the grid only (without the interpolation) >> looked believable as well. >> >> I have also segmentated the volumenormalised mri, which actually >> makes the later produced single_shell headmodel go downward and >> posterior as well. While the grid stays the same and >> 'goodlooking' ;-). >> So I am inclined to think that something strange is happening >> during the volumenormalise or sourceinterpolation procedure moving >> the mri slightly downward and more posterior. I would fix it myself >> but I don't know where I should look... it also puzzles me why this >> only happens 'for from NM- to ctf coordinates realigned' mri's. It >> seems that fieldtrip remembers that the mri was originally a NM... >> >> Hope you or someone else can help me further... >> >> Groetjes Hanneke >> >> >> -----Ursprüngliche Nachricht----- >> Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen >> Gesendet: Mo 13.07.2009 10:42 >> An: FIELDTRIP at NIC.SURFNET.NL >> Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. >> >> Hi Hanneke, >> >> This looks like a difference in origin to me. Note that the MNI >> coordinate system has the cardinal axes pointing in the same >> directions as the neuromag headcoordinate system, but that the origin >> is different. The origin of the NM-headcoordinate system is on the >> interauricular line, the point where the y-axis hits it. This is >> approximately somewhere close or in the pons. The MNI origin is the >> AC, which is somewhere 'higher' in the volume. I suspect that the >> preparation of the grids did not work out without flaws. >> Alternatively, which I think is the most likely explanation, is that >> you should use the MNI-template as an MRI for the interpolation, >> rather than a normalized single subject MRI. I don't know about the >> single subject MRIs, but at least the MNI-template is explicitly in >> MNI-space, whereas the normalized MRI could be in head-space. This >> could explain the shift. >> Anyway, if the latter hunch is the explanation, then the >> sourceanalysis results might be trusted, if the first hunch was the >> one, the sourceanalysis results are most certainly wrong. >> >> As a matter of fact the whole swapping around with coordinates should >> not be necessary if the basic fieldtrip-code is adjusted such that it >> can handle neuromag-based headcoordinate systems in an appropriate >> way. This relates to an earlier remark on the list, which rightfully >> states that the approach you (we) have been taken so far seems a bit >> tedious. Ideally, in other words, the middle man has to be taken out, >> which in this case is the intermediate transformation to a ctf-based >> coordinate system. >> >> Hope this helps, >> >> JM >> >> >> Quoting Hanneke van Dijk : >> >>> Now there is an attachment too! sorry >>> >>> On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < >>> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >>> >>>> Dear all, >>>> >>>> I have entered the next step: sourceanalysis. But I have >>>> encountered >>>> another problem, I think in sourceinterpolation or maybe >>>> volumenormalise. >>>> >>>> After running the script as I have described before (to make the >>>> headmodel >>>> and the grid) I do the following; >>>> >>>> load f %load frequency data >>>> cfg = []; >>>> cfg.grid = grid; >>>> cfg.frequency = 10; >>>> cfg.vol = hdm; >>>> cfg.grad = f.grad; >>>> cfg.projectnoise = 'yes'; >>>> cfg.lambda = 5e-28; >>>> cfg.method = 'dics'; >>>> cfg.feedback = 'textbar'; >>>> >>>> source = sourceanalysis(cfg,f); >>>> >>>> then: >>>> >>>> sd = sourcedescriptives([],source); >>>> >>>> then: >>>> >>>> load norm %normalized to MNI brain of single subject >>>> sdint = sourceinterpolate([], sd , norm); >>>> clear norm >>>> %plotting the results >>>> cfg.funparameter = 'avg.nai'; >>>> cfg.anaparameter = 'anatomy'; >>>> cfg.funcolormap = 'jet'; >>>> cfg.method = 'ortho'; >>>> cfg.projmethod = 'nearest'; >>>> cfg.sphereradius = 20; >>>> cfg.surffile = 'surface_l4_both'; >>>> figure; >>>> sourceplot(cfg,sdint) >>>> >>>> The result is attached to this email, the gird seems to have >>>> moved upwards >>>> and somewhat to the front relative to the normalised mri. But it >>>> seems to >>>> have the right size. I have been playing around with sourceunits >>>> mriunits >>>> x-y coordinates but nothing helps, or it makes it even worse. >>>> >>>> Does anybody have an idea what's happening? >>>> >>>> Yours, >>>> Hanneke >>>> >>>> www.linkedin.com/in/hannekevandijk >>>> tel. +49 (0)211 81 13074 >>>> >>>> >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between >>>> users of the >>>> FieldTrip toolbox, to share experiences and to discuss new ideas >>>> for MEG >>>> and EEG analysis. See also >>>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>>> http://www.ru.nl/neuroimaging/fieldtrip. >>>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>> http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> >> >> ------------------------------------------------------------------ >> The University of Glasgow, Department of Psychology WebMail system >> ------------------------------------------------------------------ >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From hungptit at GMAIL.COM Fri Jul 17 17:56:41 2009 From: hungptit at GMAIL.COM (Hung - Gmail) Date: Fri, 17 Jul 2009 09:56:41 -0600 Subject: beamformer source localization for EEG In-Reply-To: Message-ID: Dear all, We have known that beamformers and other good source localization techniques have zero localization error for single source cases. However, in real applications there are many sources inside the brain then we will have non-zero localization error. How can we justify which inverse solutions is better for multiple source cases? Thanks a lot Hung ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From bleichner.martin at GMAIL.COM Fri Jul 24 11:14:08 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Fri, 24 Jul 2009 11:14:08 +0200 Subject: Common Average reference - excluding channels Message-ID: Hello together, I want to compute the common average reference for an ecog dataset. But I have to exlude some of the channels due to epileptic activity. I am currenlty using the code below. Do I have to specify the channels I would like to include in my CAR in cfg.channels or in cfg.refchannel? Thanks a lot Martin cfg=[]; cfg.trackconfig='cleanup'; %compute common average reference cfg.channels=ch_in_avref; cfg.reref='yes'; cfg.refchannel='all'; %filter out the line noise using bandstop filter cfg.bsfilter='yes'; cfg.bsfiltord=3; cfg.bsfreq=[49.5 50.5; 99.5, 100.5]; data=preprocessing(cfg,data); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bleichner.martin at GMAIL.COM Fri Jul 24 15:14:30 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Fri, 24 Jul 2009 15:14:30 +0200 Subject: Postdoc in BCI signal processing Message-ID: *Postdoc in BCI signal processing* The Rudolf Magnus Institute in Utrecht, The Netherlands is looking for a highly motivated postdoc interested in neural signal processing for Brain Computer Interfacing. The Utrecht BCI group, led by Prof. dr. Nick Ramsey, is part of the Department of Neurology and Neurosurgery at the University Medical Center Utrecht and participates in the nationwide BrainGain Consortium, which is devoted to application of Brain Computer Interfaces for patients and healthy individuals. The main focus of the group is conducting neuroscience research towards an invasive BCI application for paralyzed patients. We perform experiments with both healthy subjects and patients (~10 patients with electrode implants available for research each year). Available techniques: 128-channel EEG systems for extracranial and intracranial (ECoG) recordings, fMRI (1.5, 3 and 7 T human Philips systems), TMS and 64-channel intraoperative recordings in awake neurosurgery. Our highly interdisciplinary group consists of 4 postdocs, 10 PhD students and 6 master students, who have a background in neuroscience, psychology, biology or physics and their own expertise in the research field. The postdoc is expected to investigate new ECoG signal processing techniques for BCI purposes, as well as for cognitive neuroscience research. He/she will work in close collaboration with neuroscientists and needs to have excellent communication skills. The candidate is likely to have a PhD in biomedical engineering, computational neuroscience, electrical engineering or physics, with a record of publications. Solid experience in signal processing of any kind and excellent programming skills in Matlab are required. Experience in neuroscience is not a prerequisite, but we expect the candidate to acquire knowledge of underlying psychological and biological processes. Earliest starting date of the two-year position is July 1st, 2009. Application deadline is September 1st, 2009. Applications and information requests can be sent to Prof. dr. Nick Ramsey, Rudolf Magnus Institute of Neuroscience, Dept. of Neurology and Neurosurgery, Division of Neuroscience, University Medical Center Utrecht, Room G.03.122, Heidelberglaan 100, 3584 CX, Utrecht, Netherlands, n.f.ramsey at umcutrecht.nl. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From akiko at NYU.EDU Wed Jul 29 00:56:37 2009 From: akiko at NYU.EDU (Akiko Ikkai) Date: Wed, 29 Jul 2009 00:56:37 +0200 Subject: prepare_layout #input? Message-ID: Hi, I'm new to Fieldtrip, and am using fieldtrip-20090715 version. I'm making .lay file for our intracranial EEG data, and realized that prepare_layout.m requires 6 entries (chNum,X,Y,Width,Height,Lbl,Rem), whereas on the website ( http://fieldtrip.fcdonders.nl/tutorial/layout ) it says, "The 1st column is the channel number in the layout file, it is not used any more.". prepare_layout.m runs when I add chNum to my .lay, OR change line 743 of prepare_layout.m to [X,Y,Width,Height,Lbl,Rem] = textread(filename,'%f %f %f %f %q %q'); For the future reference, I'm wondering which is more recent way to write .lay files.... with, or without chNum? Thanks in advance! Akiko Akiko Ikkai PhD Candidate Department of Psychology New York University 6 Washington Place New York NY, 10003 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ingrid.nieuwenhuis at DONDERS.RU.NL Wed Jul 29 10:28:38 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Wed, 29 Jul 2009 10:28:38 +0200 Subject: prepare_layout #input? In-Reply-To: Message-ID: Dear Akiko, You're right that it is a bit confusing the way it is stated right now at the wiki. What is meant is that the first column is not used any more during the plotting by the plotting functions. But all FieldTrip functions do expect that that there is a first column present in the layout file containing the channel number. So when you are making a .lay file you should indeed add that column (although what is in there is totally ignored by the plotting functions). So the six columns in the layout file should be: chNum, X, Y, Width, Height, Lbl. I've modified the wiki, hope it is clearer now. All the best, Ingrid ___________________________________ Ingrid Nieuwenhuis PhD student Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging Radboud University Nijmegen, The Netherlands Email: ingrid.nieuwenhuis at donders.ru.nl Tel: 0031 (0)24 - 36 10887 > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Akiko Ikkai > Sent: Wednesday, July 29, 2009 12:57 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] prepare_layout #input? > > Hi, > > I'm new to Fieldtrip, and am using fieldtrip-20090715 version. > > I'm making .lay file for our intracranial EEG data, and realized that > prepare_layout.m requires 6 entries (chNum,X,Y,Width,Height,Lbl,Rem), > whereas on the website ( http://fieldtrip.fcdonders.nl/tutorial/layout ) > it > says, "The 1st column is the channel number in the layout file, it is not > used any more.". prepare_layout.m runs when I add chNum to my .lay, OR > change line 743 of prepare_layout.m to [X,Y,Width,Height,Lbl,Rem] = > textread(filename,'%f %f %f %f %q %q'); > > For the future reference, I'm wondering which is more recent way to write > .lay files.... with, or without chNum? > > Thanks in advance! Akiko > > Akiko Ikkai > PhD Candidate > Department of Psychology > New York University > 6 Washington Place > New York NY, 10003 > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:05:44 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:05:44 +0200 Subject: prepare_layout #input? In-Reply-To: Message-ID: Dear Akiko The ascii layout file has some limitations w.r.t. the layouts that you can make, especially in case of ECoG data. We are using prepare_layout to construct individual ECoG layouts based on a photo that was made during the surgery. I have just updated the documentation at http://fieldtrip.fcdonders.nl/tutorial/layout and http://fieldtrip.fcdonders.nl/faq/what_is_the_format_of_the_layout_file_which_is_used_for_plotting to better reflect the advanced options for making ECog layouts. Please have a look at the layout tutorial with the ECoG example, which includes details and screenshots. best regards, Robert ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen ----------------------------------------------------------- On 29 Jul 2009, at 0:56, Akiko Ikkai wrote: > Hi, > > I'm new to Fieldtrip, and am using fieldtrip-20090715 version. > > I'm making .lay file for our intracranial EEG data, and realized that > prepare_layout.m requires 6 entries (chNum,X,Y,Width,Height,Lbl,Rem), > whereas on the website ( http://fieldtrip.fcdonders.nl/tutorial/ > layout ) it > says, "The 1st column is the channel number in the layout file, it > is not > used any more.". prepare_layout.m runs when I add chNum to my .lay, OR > change line 743 of prepare_layout.m to [X,Y,Width,Height,Lbl,Rem] = > textread(filename,'%f %f %f %f %q %q'); > > For the future reference, I'm wondering which is more recent way to > write > .lay files.... with, or without chNum? > > Thanks in advance! Akiko > > Akiko Ikkai > PhD Candidate > Department of Psychology > New York University > 6 Washington Place > New York NY, 10003 > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:12:12 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:12:12 +0200 Subject: Common Average reference - excluding channels In-Reply-To: Message-ID: Hi Martin On 24 Jul 2009, at 11:14, Martin Bleichner wrote: > I want to compute the common average reference for an ecog dataset. > But I have to exlude some of the channels due to epileptic activity. > I am currenlty using the code below. Do I have to specify the > channels I would like to include in my CAR in cfg.channels or in > cfg.refchannel? You would specify the channels that you want to average over in cfg.refchannel. The average of those channels will subsequently be subtracted from cfg.channel (which defines the channels on which the preprocessing function works). So cfg.channel = {'EEG1020', 'M1', 'M2'} cfg.refchannel = {'M1', 'M2'} would result in a linked ears reference, and cfg.channel = 'EEG1020' cfg.refchannel = 'EEG1020' would result in an average over all EEG1020 channels. Note that the channels to which you want to reference should be included in cfg.channel. For EEG data files the reference channel usually is not included in the file (because it is zero anyway). If the reference used during recording is a mastoid, and you want to refer to both mastoids, you can add the implicit reference as all zeros and define its name with the cfg.implicitref option. The documentation at http://fieldtrip.fcdonders.nl/example/re-referencing and http://fieldtrip.fcdonders.nl/tutorial/continuous contains more examples for rereferencing. best regards, Robert ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen ----------------------------------------------------------- > > Thanks a lot > Martin > > cfg=[]; > cfg.trackconfig='cleanup'; > > %compute common average reference > cfg.channels=ch_in_avref; > cfg.reref='yes'; > cfg.refchannel='all'; > > %filter out the line noise using bandstop filter > cfg.bsfilter='yes'; > cfg.bsfiltord=3; > cfg.bsfreq=[49.5 50.5; 99.5, 100.5]; > > > data=preprocessing(cfg,data); > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:17:29 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:17:29 +0200 Subject: beamformer source localization for EEG In-Reply-To: <4A609F39.60801@gmail.com> Message-ID: Dear Hung The differences between source reconstruction methods, or inverse methods, are in the assumptions that they make on the sources. Some make assumptions on the number of sources (dipole fitting), distribution of activity (minimum norm linear estimation) and some make assumptions on the correlatedness of the timecourses of the sources (beamforming or music). A difference is also in wether and how the noise in the data is incorporated in the estimate of the source acitivity (ignored in plain old dipole fitting, explicitely suppressed in beamforming). The method that works the best is the method whose assumptions on the data (true sources and noise) best corresponds to the data that you have acquired. best regards, Robert On 17 Jul 2009, at 17:56, Hung - Gmail wrote: > Dear all, > We have known that beamformers and other good source localization > techniques have zero localization error for single source cases. > However, in > real applications there are many sources inside the brain then we will > have non-zero localization error. How can we justify which inverse > solutions is better for multiple source cases? > > Thanks a lot > Hung > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:32:11 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:32:11 +0200 Subject: beamformer source localization for EEG In-Reply-To: <4A5F6A26.9060404@ucdavis.edu> Message-ID: Hi Jess, On 16 Jul 2009, at 19:57, Jess R. Kerlin wrote: > I'm using a 128 electrode Biosemi EEG system, attempting to perform > beam-former source analysis. I had go all the way back to Matlab 6.5 > and SPM 2, as well as some trial and error to get through it, but I > finally managed to get a nolte BEM using mostly the same code as in > the example script "BEM head model for EEG" script". However, > prepare_leadfield throws the error "unsupported volume conductor > model for EEG", which is clearly the case looking at the > prepare_leadfield code. The "nolte" model is a single shell realistic model for MEG. It is based on the boundary of the inside of the skull, but is not a BEM model and it is not for EEG. See http://fieldtrip.fcdonders.nl/references_to_implemented_methods and search for Nolte. The boundary element method can be used for EEG volume conduction, using the prepare_bemmodel function. > A few questions on this topic: > > Does fieldtrip actually support beamforming source localization on > BEM models for EEG? Yes, see Schneider TR, Debener S, Oostenveld R, Engel AK, Enhanced EEG gamma-band activity reflects multisensory semantic matching in visual- to-auditory object priming. Neuroimage. 2008 Sep 1;42(3):1244-54 > Or, given the coarser spatial resolution of EEG, is it better to use > a simpler spherical model? The beamformer method is rather sensitive to volume conductor misspecifications. So for a simple dipole fit a concentric spehrical model might be enough, but for beamforming I would recommend to use a BEM model. > Either way, does anyone have successful sample code for beamformer > localization EEG data, start to finish? you can get a template BEM volume conduction model from ftp.fcdonders.nl/pub/fieldtrip/standard_BEM.zip . The geometry is based on the canonical MNI template ("collin27") and it is defined in MNI coordinates (consistent with SPM). > And for the developers: > I love your work. thanks > I notice the move from SPM 2 to SPM 8 is in the development cue. Is > there any release coming soon which will use SPM 8 to make this > process smoother? SPM2 is not supported any more in recent matlab versions, so we have a compatibility problem one way or the other. Fieldtrip does not use that many functions from spm, but some of them are not compatible between spm2 and spm5/spm8. The idea is first to make a fieldtrip/ external/spm2 folder with a subset of the old spm2 functions in it that is enough to keep it running. Those spm2 functions then have to be fixed for compatibility with the most recent matlab (simple: replace finite with "isfinite"). Subsequently, the difference between those functions in their spm2 and spm8 incarnation has to be determined and fieldtrip should be fixed to reflect these differences. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From megjim1 at GMAIL.COM Wed Jul 29 18:10:44 2009 From: megjim1 at GMAIL.COM (Jim Li) Date: Wed, 29 Jul 2009 18:10:44 +0200 Subject: color bar not agreeing with data Message-ID: Dear Fieldtripper: I am puzzled by the output from "multiplotTFR". The colorbar doesn't look right at all! Can anyone help me? Basicly I have a data structure caled "TF" that's calculated from FREQANALYSIS. I ran the following script and got a plot (see attachment) ----------------------------- >> cfg = []; cfg.layout = '4D248.lay'; cfg.interactive = 'yes'; cfg.showlabels = 'yes'; cfg.colorbar = 'yes'; cfg.renderer= 'zbuffer' figure; multiplotTFR(cfg,TF); cfg = layout: '4D248.lay' interactive: 'yes' showlabels: 'yes' colorbar: 'yes' renderer: 'zbuffer' the input is freq data with 248 channels, 141 frequencybins and 77 timebins reading layout from file 4D248.lay >> ------------------------------ Now, when running " max(max(max(max(TF.powspctrm(:,:,:,:)))))" I got : ------------- ans = 2.287227537931770e-023 -------------- This is order of magnitude larger than the colorbar maximum, which is 1.82e- 24 (see attachment) . Why should this discrepency happen? Why the data maximum is not plotted? The same happened to the minimum: when running "min(min(min(min (TF.powspctrm(:,:,:,:)))))" I got 5.393784644607502e-034, which is about 8 orders of magnitude smaller than the colorbar minimum (2.12e-26 according to the attached figure). This I can understand since small numbers should be sacrificed to save bandwidth for more significant numbers. BTW I tried "singleplotTFR" and got the same discrepency between data maximum and plot/colorbar maximum for a channel. They differ by about an order of magnitude, which is huge! FYI, I was working directly before my PC, not through VNC or Remote Desktop connection. Thanks a lot, Jim ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: OutputFigure.TIF Type: image/tiff Size: 94342 bytes Desc: not available URL: From saskia.haegens at DONDERS.RU.NL Wed Jul 29 18:55:48 2009 From: saskia.haegens at DONDERS.RU.NL (Saskia Haegens) Date: Wed, 29 Jul 2009 18:55:48 +0200 Subject: color bar not agreeing with data In-Reply-To: Message-ID: Hi Jim, Does your data contain a repetition dimension (i.e. did you run freqanalysis with cfg.keeptrials='yes')? In that case, when you don't specify which trials to plot, the plotting functions such as multiplotTFR will plot the average over all trials. This could explain the discrepancy you describe. Best, Saskia > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Jim Li > Sent: 29 July 2009 18:11 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] color bar not agreeing with data > > Dear Fieldtripper: > > I am puzzled by the output from "multiplotTFR". The colorbar doesn't look > right > at all! Can anyone help me? > > Basicly I have a data structure caled "TF" that's calculated from > FREQANALYSIS. I ran the following script and got a plot (see attachment) > > ----------------------------- > >> cfg = []; cfg.layout = '4D248.lay'; cfg.interactive = > 'yes'; > cfg.showlabels = 'yes'; > cfg.colorbar = 'yes'; cfg.renderer= 'zbuffer' > figure; > multiplotTFR(cfg,TF); > > cfg = > > layout: '4D248.lay' > interactive: 'yes' > showlabels: 'yes' > colorbar: 'yes' > renderer: 'zbuffer' > > the input is freq data with 248 channels, 141 frequencybins and 77 > timebins > reading layout from file 4D248.lay > >> > ------------------------------ > > Now, when running " max(max(max(max(TF.powspctrm(:,:,:,:)))))" I got : > > ------------- > ans = > > 2.287227537931770e-023 > -------------- > > This is order of magnitude larger than the colorbar maximum, which is > 1.82e- > 24 (see attachment) . Why should this discrepency happen? Why the data > maximum is not plotted? > > > The same happened to the minimum: when running "min(min(min(min > (TF.powspctrm(:,:,:,:)))))" I got 5.393784644607502e-034, which is about > 8 > orders of magnitude smaller than the colorbar minimum (2.12e-26 according > to > the attached figure). This I can understand since small numbers should be > sacrificed to save bandwidth for more significant numbers. > > > BTW I tried "singleplotTFR" and got the same discrepency between data > maximum and plot/colorbar maximum for a channel. They differ by about an > order of magnitude, which is huge! > > FYI, I was working directly before my PC, not through VNC or Remote > Desktop connection. > > Thanks a lot, > > Jim > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From megjim1 at GMAIL.COM Thu Jul 30 01:31:40 2009 From: megjim1 at GMAIL.COM (Jim Li) Date: Thu, 30 Jul 2009 01:31:40 +0200 Subject: color bar not agreeing with data Message-ID: Hi Saskia, You're right on the point! Thanks a lot for your help, :) Jim On Wed, 29 Jul 2009 18:55:48 +0200, Saskia Haegens wrote: >Hi Jim, > >Does your data contain a repetition dimension (i.e. did you run freqanalysis >with cfg.keeptrials='yes')? In that case, when you don't specify which >trials to plot, the plotting functions such as multiplotTFR will plot the >average over all trials. This could explain the discrepancy you describe. > >Best, >Saskia > >> -----Original Message----- >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >> Behalf Of Jim Li >> Sent: 29 July 2009 18:11 >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: [FIELDTRIP] color bar not agreeing with data >> >> Dear Fieldtripper: >> >> I am puzzled by the output from "multiplotTFR". The colorbar doesn't look >> right >> at all! Can anyone help me? >> >> Basicly I have a data structure caled "TF" that's calculated from >> FREQANALYSIS. I ran the following script and got a plot (see attachment) >> >> ----------------------------- >> >> cfg = []; cfg.layout = '4D248.lay'; cfg.interactive = >> 'yes'; >> cfg.showlabels = 'yes'; >> cfg.colorbar = 'yes'; cfg.renderer= 'zbuffer' >> figure; >> multiplotTFR(cfg,TF); >> >> cfg = >> >> layout: '4D248.lay' >> interactive: 'yes' >> showlabels: 'yes' >> colorbar: 'yes' >> renderer: 'zbuffer' >> >> the input is freq data with 248 channels, 141 frequencybins and 77 >> timebins >> reading layout from file 4D248.lay >> >> >> ------------------------------ >> >> Now, when running " max(max(max(max(TF.powspctrm(:,:,:,:)))))" I got : >> >> ------------- >> ans = >> >> 2.287227537931770e-023 >> -------------- >> >> This is order of magnitude larger than the colorbar maximum, which is >> 1.82e- >> 24 (see attachment) . Why should this discrepency happen? Why the data >> maximum is not plotted? >> >> >> The same happened to the minimum: when running "min(min(min(min >> (TF.powspctrm(:,:,:,:)))))" I got 5.393784644607502e-034, which is about >> 8 >> orders of magnitude smaller than the colorbar minimum (2.12e-26 according >> to >> the attached figure). This I can understand since small numbers should be >> sacrificed to save bandwidth for more significant numbers. >> >> >> BTW I tried "singleplotTFR" and got the same discrepency between data >> maximum and plot/colorbar maximum for a channel. They differ by about an >> order of magnitude, which is huge! >> >> FYI, I was working directly before my PC, not through VNC or Remote >> Desktop connection. >> >> Thanks a lot, >> >> Jim >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. > >---------------------------------- >The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From vvw at CALTECH.EDU Thu Jul 30 10:39:55 2009 From: vvw at CALTECH.EDU (Virginie van Wassenhove) Date: Thu, 30 Jul 2009 10:39:55 +0200 Subject: ECG artifact with MEG data Message-ID: Hi everyone, I am testing the ECG artifact removal using the ICA method described here: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts At the stage where freqanalysis is to be computed on the components comp_ecg, I encounter this error, anyone else has experienced such issue? the input is component data with 204 components and 204 original channels ??? Error using ==> checkdata at 388 This function requires raw data as input. Error in ==> freqanalysis at 165 data = checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset', 'yes'); Thanks in advance, Virginie ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ingrid.nieuwenhuis at DONDERS.RU.NL Thu Jul 30 21:52:47 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 30 Jul 2009 21:52:47 +0200 Subject: ECG artifact with MEG data In-Reply-To: Message-ID: Dear Virginie, You're problem was caused by a too strict check of the input data by checkdata. This function only allowed raw data as input, but it also works on component data. I've fixed the bug and the ftp fieldtrip version of tomorrow should not give the problem. You can also fix the problem yourself by changing line 165 in freqanalysis into data = checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hasoffset', 'yes'); Best Ingrid ___________________________________ Ingrid Nieuwenhuis PhD student Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging Radboud University Nijmegen, The Netherlands Email: ingrid.nieuwenhuis at donders.ru.nl Tel: 0031 (0)24 - 36 10887 > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Virginie van Wassenhove > Sent: Thursday, July 30, 2009 10:40 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] ECG artifact with MEG data > > Hi everyone, > > I am testing the ECG artifact removal using the ICA method described here: > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i > ca_to_remove_ecg_artifacts > > At the stage where freqanalysis is to be computed on the components > comp_ecg, I encounter this error, anyone else has experienced such issue? > > the input is component data with 204 components and 204 original channels > ??? Error using ==> checkdata at 388 > This function requires raw data as input. > > Error in ==> freqanalysis at 165 > data = checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset', > 'yes'); > > Thanks in advance, > Virginie > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From christine.gruetzner at GOOGLEMAIL.COM Wed Jul 1 17:19:29 2009 From: christine.gruetzner at GOOGLEMAIL.COM (Christine Gruetzner) Date: Wed, 1 Jul 2009 17:19:29 +0200 Subject: Beamforming - filter dimensions Message-ID: Dear All, I'm using LCMV beamforming and I have a question regarding the dimensions of the filter. We have two different configurations for LCMV (see below) that result in one-dimensional filters (in the first case) and three-dimensional filters (in the second case). It seems that the only difference between the two configurations is the option cfg.projectmom = 'yes' (in the first configuration) vs. cfg.projectmom = 'no' (in the second configuration). Do you have any idea what makes the difference and why I only get one-dimensional filters in the first configuration? Which would be the correct options to use? Best Christine %------------------------------------------------------------------ configuration 1: cfg = []; % replaced by: fullnameGrid = strcat(mripath, DesignLCMVSources{i,2}); cfg = load(fullnameGrid); cfg.vol = cfg.hdm; %General source computation parameters cfg.method = 'lcmv'; cfg.lambda = 0.05; % regularization of 0.5% cfg.powmethod = 'trace'; % compute rms power per dipolelocation over all available directions cfg.feedback = 'text'; % give feedback on the progress of the calculations cfg.keepfilter = 'yes'; % keep the beamformer filters (virtual electrodes) for later use % % cfg.singletrial = 'yes'; cfg.keepmom = 'yes'; cfg.projectmom = 'yes'; cfg.keeptrial = 'yes'; InFilename = strcat(datapath, DesignLCMVSources{i,1}); load(InFilename); % a variable named TLDataOut must exist in the InFile DataLCMVIn = TLDataOutNew; clear TLDataOutNew; % for clarity of code remove if too slow cfg.cov = DataLCMVIn.cov; DataLCMVOut = sourceanalysis(cfg, DataLCMVIn); %---------------------------------------------------------------------------------------- configuration 2: cfgLCMV=[]; % cfgLCMV.frequency = ... % the bandwidth in LCMV comptations is % chosen in preprocessing (aka FreqLimits) cfgLCMV.grid=ForwardModel.grid; cfgLCMV.vol=ForwardModel.hdm; cfgLCMV.method='lcmv'; % cfgLCMV.projectnoise='yes'; % ??? cfgLCMV.keepfilter='yes'; cfgLCMV.lambda = DICSlambda ; % use the same as for DICS here cfgLCMV.powmethod = 'trace'; cfgLCMV.fixedori = 'no'; cfgLCMV.projectnoise = 'no'; % these filters are for computing virtual electrodes later cfgLCMV.projectmom = 'no'; % computation cfgLCMV.dim=[Nx Ny Nz] disp('running LCMV source analysis for common filters/virtual electrodes') CommonLCMVSources=sourceanalysis(cfgLCMV,CombiTimelockCov) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From fredericroux at HOTMAIL.DE Wed Jul 1 21:07:17 2009 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Wed, 1 Jul 2009 21:07:17 +0200 Subject: Beamforming - filter dimensions Message-ID: Hi Christine, I am wondering if this problem could result from the fact that the grids and headmodels were computed in a different way for each analysis. In your code it says: %for config 1 fullnameGrid = strcat(mripath, DesignLCMVSources{i,2}); cfg = load(fullnameGrid); cfg.vol = cfg.hdm; %for config 2 cfgLCMV.grid=ForwardModel.grid; cfgLCMV.vol=ForwardModel.hdm; Cheers, frederic _________________________________________________________________ http://redirect.gimas.net/?n=M0906xWLHM2 Unbegrenzter Speicher bei Windows Live Hotmail! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredericroux at HOTMAIL.DE Wed Jul 1 21:36:15 2009 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Wed, 1 Jul 2009 21:36:15 +0200 Subject: Beamforming - filter dimensions Message-ID: I found the origin of the difference. You have to specify the option: cfg.dim = [Nx Ny Nz] Otherwise your filters will have only one dimension. _________________________________________________________________ http://redirect.gimas.net/?n=M0906xWLHM2 Unbegrenzter Speicher bei Windows Live Hotmail! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.cook at ULETH.CA Thu Jul 2 02:54:59 2009 From: charles.cook at ULETH.CA (Charles Cook) Date: Thu, 2 Jul 2009 02:54:59 +0200 Subject: Update: Freqstatistics Now Yields (Som e) Significant Clusters Message-ID: Hi Michael, We are interested in determining just that, the presence of spatially and temporally contiguous effects that cross a certain threshold between my two groups (males vs. females) and within them (task 1 vs. task 2). After fully completing the analysis, I was able to find significant clusters in my within groups analysis (e.g. TF differences in male participants, task 1 vs. task 2, using dependent t-test) within a few discrete frequency bands. What we're now interested in doing is beamforming those discrete windows and frequencies that we have found with the cluster analysis in FieldTrip. Is this a feasible approach with the BESA exported TFC files? We had considered exporting VMP files from BESA and beamforming using Brain Voyager but thought that it might be simpler to do this all within FieldTrip. Cheers, Charles On Thu, 25 Jun 2009 12:00:31 +0200, Michael Wibral wrote: >Hi Charles, > >thanks for the update. Cluster based statistics is exactly what the name says: A statistics telling you whether you have spatially and temporally contiguous effects that cross a certain threshold - in sum over the cluster. It is sometimes worth considering, whether this is what you want to test after all. e.g. extended effects of small effect size per electrode but large time/frequency extent and effects of large effect size but small time/frequency extent may have similar cluster statistics. The even compete in the sense that randomizations of the larger of the two (in total cluster sum) may still have larger cluster statistics than the smaller of the two, thus effectively rendering in non-significant. Bear in mind that the only thing really tested is the exchangeability of the data (which is the null hypothesis). That may sometimes make your results more difficult to interpret. You could also try cfg.correctm = 'fdr', to get classical FDR correction, but you may loose sensitivity in some cases. > >One last thing: Check carefully that there is no factor that has been balanced over subjects (e.g. response hand) that may be resorted in the randomizations. For example: half of the subjects report match with the right hand and non-match with the left hand, the other half responding with an inverted assignment. This analysis setup: >1. violates the exchangeability hypothesis from the start (and you know!), but not in the way you wanted to test it - this is a serious error in applying randomization testing... >2. Consequently, it renders all other effects insignificant because the sorted response hand effects in the randomizations most likely exceed any other effect in the unrandomized data. > > >Michael ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Thu Jul 2 11:50:33 2009 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Thu, 2 Jul 2009 11:50:33 +0200 Subject: Update: Freqstatistics Now Yields (Som e) Significant Clusters Message-ID: Hi Charles, beamforming relies on the data (sensor) covariance matrix for the case of LCMV and other time domain beamformers and you get the focus on the desired frequency band by prefiltering For frequency domain beamforming - like DICS - computations rely on the cross spectral density matrix - again computed at the frequencies of interest. I do not think that BESA TFC files contain that information. That said, you can - depending on your Version of BESA and the modules included - use BESA's own beamformer (which allows for two bilateral synchronized sources to be present as an extra feature) and export the .dat file for statistics (I haven't done that myself). But using beamforming in Fieldtrip is also straightforward and very flexible. Let me know if you need help with that. Michael > -----Ursprüngliche Nachricht----- > Von: "Charles Cook" > Gesendet: 02.07.09 02:56:36 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Update: Freqstatistics Now Yields (Som e) Significant Clusters > Hi Michael, > > We are interested in determining just that, the presence of spatially and > temporally contiguous effects that cross a certain threshold between my two > groups (males vs. females) and within them (task 1 vs. task 2). After fully > completing the analysis, I was able to find significant clusters in my > within groups analysis (e.g. TF differences in male participants, task 1 vs. > task 2, using dependent t-test) within a few discrete frequency bands. What > we're now interested in doing is beamforming those discrete windows and > frequencies that we have found with the cluster analysis in FieldTrip. Is > this a feasible approach with the BESA exported TFC files? We had considered > exporting VMP files from BESA and beamforming using Brain Voyager but > thought that it might be simpler to do this all within FieldTrip. > > Cheers, > > Charles > > On Thu, 25 Jun 2009 12:00:31 +0200, Michael Wibral > wrote: > > >Hi Charles, > > > >thanks for the update. Cluster based statistics is exactly what the name > says: A statistics telling you whether you have spatially and temporally > contiguous effects that cross a certain threshold - in sum over the cluster. > It is sometimes worth considering, whether this is what you want to test > after all. e.g. extended effects of small effect size per electrode but > large time/frequency extent and effects of large effect size but small > time/frequency extent may have similar cluster statistics. The even compete > in the sense that randomizations of the larger of the two (in total cluster > sum) may still have larger cluster statistics than the smaller of the two, > thus effectively rendering in non-significant. Bear in mind that the only > thing really tested is the exchangeability of the data (which is the null > hypothesis). That may sometimes make your results more difficult to > interpret. You could also try cfg.correctm = 'fdr', to get classical FDR > correction, but you may loose sensitivity in some cases. > > > >One last thing: Check carefully that there is no factor that has been > balanced over subjects (e.g. response hand) that may be resorted in the > randomizations. For example: half of the subjects report match with the > right hand and non-match with the left hand, the other half responding with > an inverted assignment. This analysis setup: > >1. violates the exchangeability hypothesis from the start (and you know!), > but not in the way you wanted to test it - this is a serious error in > applying randomization testing... > >2. Consequently, it renders all other effects insignificant because the > sorted response hand effects in the randomizations most likely exceed any > other effect in the unrandomized data. > > > > > >Michael > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From wibral at BIC.UNI-FRANKFURT.DE Thu Jul 2 12:09:36 2009 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Thu, 2 Jul 2009 12:09:36 +0200 Subject: Beamforming - filter dimensions Message-ID: Dear Christine, dear Frederic, I think Christine's initial guess was right: The option " cfg.projectmom='yes' " seems to not only project the dipole moment timecourse on the direction of maximal power as it says in the beamformer-lcmv function but also compute an effective 1-D filter coefficient for this purpose and export that if you additionally specify cfg.keepfilters='yes'. To explain things in a little more detail: beamformer_lcmv.m could in principle compute 3D (or 2D for MEG) filters, compute the three timecourses, then compute the vector direction with the maximal power and export that power value but still keep all filter coefficients. But what it does (and what I think is more straight forward) is to do this projection by having a effective filter coefficient for that direction. On the other hand, the option cfg.dim = [Nx Ny Nz] is used to give the results of beamforming some regular dimensions when using reverse warped grids for single subjects like Ingrid does. I actually do not know whether the current versions of fieldtrip still need it. It was there to let sourcegrandaverage and sourcestatistics and the source plotting functions know how to handle results over subjects that had different, non-evenly spaced grids in true space but matching grids when transformed to MNI space (see Ingrid's tutorial/wiki page on this at the fieldtrip website . It simply gives the rectangular dimensions of the common grid in MNI space. Michael > -----Ursprüngliche Nachricht----- > Von: "Frederic Roux" > Gesendet: 01.07.09 21:13:25 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Beamforming - filter dimensions Hi Christine, > > I am wondering if this problem could result from the fact that the > grids and headmodels were computed in a different way for each > analysis. > > In your code it says: > > %for config 1 > fullnameGrid = strcat(mripath, DesignLCMVSources{i,2}); > cfg = load(fullnameGrid); > cfg.vol = cfg.hdm; > > %for config 2 > cfgLCMV.grid=ForwardModel.grid; > cfgLCMV.vol=ForwardModel.hdm; > > Cheers, > frederic > > > Kein Werbe-Blabla - hier klicken! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From wibral at BIC.UNI-FRANKFURT.DE Thu Jul 2 12:25:31 2009 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Thu, 2 Jul 2009 12:25:31 +0200 Subject: MEG lunch at HBM2009/minutes Message-ID: Hi Ole, Thanks for putting together the minutes of the HBM meeting and also for the organization of the meeting altogether. Could you also send around the actual name of the yahoo mailing list? That would help many of us to actually subscribe. Michael > -----Ursprüngliche Nachricht----- > Von: "Ole Jensen" > Gesendet: 30.06.09 22:01:05 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: [FIELDTRIP] MEG lunch at HBM2009/minutes > Dear all, > Attached please find the minutes from the MEG lunch at the HBM2009 meeting. > All the best, > Ole > > -- > Ole Jensen > Principal Investigator > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Office : +31 24 36 10884 > MEG lab : +31 24 36 10988 > > Fax : +31 24 36 10989 > > e-mail : ole.jensen at donders.ru.nl > URL : http://ojensen.ruhosting.nl/ > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From Sara.GonzalezAndino at HCUGE.CH Thu Jul 2 12:57:52 2009 From: Sara.GonzalezAndino at HCUGE.CH (Sara GONZALEZ ANDINO) Date: Thu, 2 Jul 2009 12:57:52 +0200 Subject: Paper Announcement Message-ID: Dear Colleagues, We would like to call your attention to the recent publication: http://www.hindawi.com/journals/cin/2009/659247.html The Neuroelectromagnetic Inverse Problem and the Zero Dipole Localization Error by: Rolando Grave de Peralta, Olaf Hauk and Sara L. Gonzalez Abstract: A tomography of neural sources could be constructed from EEG/MEG recordings once the neuroelectromagnetic inverse problem (NIP) is solved. Unfortunately the NIP lacks a unique solution and therefore additional constraints are needed to achieve uniqueness. Researchers are then confronted with the dilemma of choosing one solution on the basis of the advantages publicized by their authors. This study aims to help researchers to better guide their choices by clarifying what is hidden behind inverse solutions oversold by their apparently optimal properties to localize single sources. Here, we introduce an inverse solution (ANA) attaining perfect localization of single sources to illustrate how spurious sources emerge and destroy the reconstruction of simultaneously active sources. Although ANA is probably the simplest and robust alternative for data generated by a single dominant source plus noise, the main contribution of this manuscript is to show that zero localization error of single sources is a trivial and largely uninformative property unable to predict the performance of an inverse solution in presence of simultaneously active sources. We recommend as the most logical strategy for solving the NIP the incorporation of sound additional a priori information about neural generators that supplements the information contained in the data. best regards rolando www.electrical-neuroimaging.ch ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From bleichner.martin at GMAIL.COM Thu Jul 2 15:39:49 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Thu, 2 Jul 2009 15:39:49 +0200 Subject: frequency resolution of the power spectrum Message-ID: Hi there, this might be a stupid question. I probably miss something obvious. I want to compute the power spectrum over a single trial (around 5 minutes). using this piece of code cfg = []; cfg.method = 'mtmfft'; cfg.output = 'pow'; cfg.foilim = [1 100]; cfg.taper = 'hanning'; freq = freqanalysis(cfg, data); as a result I get freq: [1x62534 double] powspctrm: [96x62534 double] that is a frequency resolution of 0.0032Hz!? What determines the frequency resolution here? What can I do to make it less fine grained? Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.b.dijkman at STUDENT.UTWENTE.NL Thu Jul 2 15:53:44 2009 From: t.b.dijkman at STUDENT.UTWENTE.NL (Thomas Dijkman) Date: Thu, 2 Jul 2009 15:53:44 +0200 Subject: frequency resolution of the power spectrum Message-ID: Hi Martin, The frequency resolution is determined by the length of your trial -> 5 minutes = 300 seconds -> 1/300 = 0.0033 Hz. You have to divide your single trial into smaller fragments and then average the resulting spectra (I believe you can do this directly in Fieldtrip). You could for example use Welch's method. Regards, Thomas -----Oorspronkelijk bericht----- Van: FieldTrip discussion list namens Martin Bleichner Verzonden: do 2-7-2009 15:39 Aan: FIELDTRIP at NIC.SURFNET.NL Onderwerp: [FIELDTRIP] frequency resolution of the power spectrum Hi there, this might be a stupid question. I probably miss something obvious. I want to compute the power spectrum over a single trial (around 5 minutes). using this piece of code cfg = []; cfg.method = 'mtmfft'; cfg.output = 'pow'; cfg.foilim = [1 100]; cfg.taper = 'hanning'; freq = freqanalysis(cfg, data); as a result I get freq: [1x62534 double] powspctrm: [96x62534 double] that is a frequency resolution of 0.0032Hz!? What determines the frequency resolution here? What can I do to make it less fine grained? Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From thomas.hartmann at UNI-KONSTANZ.DE Thu Jul 2 15:59:34 2009 From: thomas.hartmann at UNI-KONSTANZ.DE (Thomas Hartmann) Date: Thu, 2 Jul 2009 15:59:34 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: Message-ID: hi martin, the spectral resolution of a fft is determined by the length of the data used to calculate it. e.g. a length of 1 second would give a frequency-resolution of 1Hz, 2 seconds of data would result in a resolution of 0.5Hz and so on.... what you actually missed is that you dont want to calculate one fft on your 5-minutes trial but rather several ffts on (overlapping) windows of your 5 minutes. to do this, refer to the mail by nathan weisz "re: preprocessing without trigger...". he shows some code there to cut long trials into several short ones. calculate the freqanalysis on these and you will get reasonable results. greez, thomas Martin Bleichner schrieb: > Hi there, > > this might be a stupid question. I probably miss something obvious. > > I want to compute the power spectrum over a single trial (around 5 > minutes). > > using this piece of code > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'pow'; > cfg.foilim = [1 100]; > cfg.taper = 'hanning'; > freq = freqanalysis(cfg, data); > > as a result I get > freq: [1x62534 double] > powspctrm: [96x62534 double] > > that is a frequency resolution of 0.0032Hz!? What determines the > frequency resolution here? What can I do to make it less fine grained? > > Thanks > Martin > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > -- Dipl. Psych. Thomas Hartmann OBOB-Lab University of Konstanz Department of Psychology P.O. Box D25 78457 Konstanz Germany Tel.: +49 (0)7531 88 4612 Fax: +49 (0)7531-88 4601 Email: thomas.hartmann at uni-konstanz.de Homepage: http://www.uni-konstanz.de/obob "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan Doyle) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From bleichner.martin at GMAIL.COM Thu Jul 2 16:04:52 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Thu, 2 Jul 2009 16:04:52 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: <4A4CBD46.3060405@uni-konstanz.de> Message-ID: thanks, I thought there might be an option I could hand over in the cfg. that will work 2009/7/2 Thomas Hartmann > hi martin, > the spectral resolution of a fft is determined by the length of the data > used to calculate it. e.g. a length of 1 second would give a > frequency-resolution of 1Hz, 2 seconds of data would result in a resolution > of 0.5Hz and so on.... > > what you actually missed is that you dont want to calculate one fft on your > 5-minutes trial but rather several ffts on (overlapping) windows of your 5 > minutes. to do this, refer to the mail by nathan weisz "re: preprocessing > without trigger...". he shows some code there to cut long trials into > several short ones. calculate the freqanalysis on these and you will get > reasonable results. > > greez, > thomas > > Martin Bleichner schrieb: > >> Hi there, >> >> this might be a stupid question. I probably miss something obvious. >> >> I want to compute the power spectrum over a single trial (around 5 >> minutes). >> >> using this piece of code >> cfg = []; >> cfg.method = 'mtmfft'; >> cfg.output = 'pow'; >> cfg.foilim = [1 100]; >> cfg.taper = 'hanning'; >> freq = freqanalysis(cfg, data); >> >> as a result I get >> freq: [1x62534 double] >> powspctrm: [96x62534 double] >> >> that is a frequency resolution of 0.0032Hz!? What determines the frequency >> resolution here? What can I do to make it less fine grained? >> >> Thanks >> Martin >> >> >> ---------------------------------- >> >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and >> EEG analysis. >> >> http://listserv.surfnet.nl/archives/fieldtrip.html >> >> http://www.ru.nl/fcdonders/fieldtrip/ >> >> > > -- > Dipl. Psych. Thomas Hartmann > > OBOB-Lab > University of Konstanz > Department of Psychology > P.O. Box D25 > 78457 Konstanz > Germany > > Tel.: +49 (0)7531 88 4612 > Fax: +49 (0)7531-88 4601 > Email: thomas.hartmann at uni-konstanz.de > Homepage: http://www.uni-konstanz.de/obob > > "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan > Doyle) > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingrid.nieuwenhuis at DONDERS.RU.NL Thu Jul 2 16:07:34 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 2 Jul 2009 16:07:34 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: <4A4CBD46.3060405@uni-konstanz.de> Message-ID: Hi > your 5 minutes. to do this, refer to the mail by nathan weisz "re: > preprocessing without trigger...". he shows some code there to cut long > trials into several short ones. Or use statfun_general see reply on that "re: > preprocessing without trigger..." Best Ingrid > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Thomas Hartmann > Sent: Thursday, July 02, 2009 4:00 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] frequency resolution of the power spectrum > > hi martin, > the spectral resolution of a fft is determined by the length of the data > used to calculate it. e.g. a length of 1 second would give a > frequency-resolution of 1Hz, 2 seconds of data would result in a > resolution of 0.5Hz and so on.... > > what you actually missed is that you dont want to calculate one fft on > your 5-minutes trial but rather several ffts on (overlapping) windows of > your 5 minutes. to do this, refer to the mail by nathan weisz "re: > preprocessing without trigger...". he shows some code there to cut long > trials into several short ones. calculate the freqanalysis on these and > you will get reasonable results. > > greez, > thomas > > Martin Bleichner schrieb: > > Hi there, > > > > this might be a stupid question. I probably miss something obvious. > > > > I want to compute the power spectrum over a single trial (around 5 > > minutes). > > > > using this piece of code > > cfg = []; > > cfg.method = 'mtmfft'; > > cfg.output = 'pow'; > > cfg.foilim = [1 100]; > > cfg.taper = 'hanning'; > > freq = freqanalysis(cfg, data); > > > > as a result I get > > freq: [1x62534 double] > > powspctrm: [96x62534 double] > > > > that is a frequency resolution of 0.0032Hz!? What determines the > > frequency resolution here? What can I do to make it less fine grained? > > > > Thanks > > Martin > > > > > > ---------------------------------- > > > > The aim of this list is to facilitate the discussion between users of > > the FieldTrip toolbox, to share experiences and to discuss new ideas > > for MEG and EEG analysis. > > > > http://listserv.surfnet.nl/archives/fieldtrip.html > > > > http://www.ru.nl/fcdonders/fieldtrip/ > > > > > -- > Dipl. Psych. Thomas Hartmann > > OBOB-Lab > University of Konstanz > Department of Psychology > P.O. Box D25 > 78457 Konstanz > Germany > > Tel.: +49 (0)7531 88 4612 > Fax: +49 (0)7531-88 4601 > Email: thomas.hartmann at uni-konstanz.de > Homepage: http://www.uni-konstanz.de/obob > > "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan > Doyle) > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Thu Jul 2 16:09:11 2009 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Thu, 2 Jul 2009 16:09:11 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: Message-ID: Hi Martin, take a look at http://fieldtrip.fcdonders.nl/faq/how_can_i_process_continuous_data_without_triggers to know how to preprocess your single trial Marco On 02/lug/09, at 15:39, Martin Bleichner wrote: > Hi there, > > this might be a stupid question. I probably miss something obvious. > > I want to compute the power spectrum over a single trial (around 5 > minutes). > > using this piece of code > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'pow'; > cfg.foilim = [1 100]; > cfg.taper = 'hanning'; > freq = freqanalysis(cfg, data); > > as a result I get > freq: [1x62534 double] > powspctrm: [96x62534 double] > > that is a frequency resolution of 0.0032Hz!? What determines the > frequency resolution here? What can I do to make it less fine grained? > > Thanks > Martin > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 3 16:42:25 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke van Dijk) Date: Fri, 3 Jul 2009 16:42:25 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. Message-ID: Dear all, I am getting started doing analysis on Elekta Neuromag data using fieldtrip, having been used to CTF data at the Donders before... My question regards loading mri data in order to do volumesegment and sourceanalysis in the end. In particular I would like to transform the outcome of the mne toolbox function: 'fif_read_mri.m' to a fieldtrip compatible format. F.Y.I, I'm working with data with recorded with the old 122 sensor system here in Duesseldorf, and with data of the newest 306 vector view system as well. Does anyone have experience with this? And of course maybe have a solution? Best and thanks in advance, Hanneke ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hubert.preissl at UNI-TUEBINGEN.DE Mon Jul 6 12:01:21 2009 From: hubert.preissl at UNI-TUEBINGEN.DE (Hubert Preissl) Date: Mon, 6 Jul 2009 12:01:21 +0200 Subject: MEG lunch at HBM2009/minutes In-Reply-To: <4A4A6DC8.8060406@donders.ru.nl> Message-ID: Dear Ole, during the last autumn school we recorded all lectures, maybe it would be interesting to make other people aware of this. if you want to have a look at this go to http://timms.uni-tuebingen.de/Search/SearchForm01.aspx search for: autumn school 2008 sincerely, hubert -- Dr. Hubert Preissl MEG-Center phone: ++49-(0)7071-2987704 Otfried Mueller Str 47 fax: ++49-(0)7071-295706 72076 Tübingen, Germany email: hubert.preissl at uni-tuebingen.de ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Paul.vandenHurk at FCDONDERS.RU.NL Mon Jul 6 14:28:27 2009 From: Paul.vandenHurk at FCDONDERS.RU.NL (Paul van den Hurk) Date: Mon, 6 Jul 2009 14:28:27 +0200 Subject: Failed to create socket while using the Fieldtrip buffer Message-ID: >>From June 22 until July 10 I'll be away. After that time, I'll respond as soon as possible. With kind regards, Paul van den Hurk PhD student in Mind-Brain-Mindfulness Group Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging Radboud University Nijmegen Postal Address: PO Box 9101 6500 HB NIJMEGEN The Netherlands Visiting address: Kapittelweg 29 room: 1.34 6525 EN NIJMEGEN tel.: +31 (0)243668388 e-mail: p.vandenhurk at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From christophe.grova at MCGILL.CA Mon Jul 6 16:34:52 2009 From: christophe.grova at MCGILL.CA (Christophe Grova) Date: Mon, 6 Jul 2009 09:34:52 -0500 Subject: Workshop "Inverse problems in brain imaging and multimodal data fusion" - Montreal - August 24-29 2009 Message-ID: ********************************************************************************************* CALL FOR ABSTRACT - DEADLINE FOR ABSTRACT SUBMISSION July 15th - REGISTRATION IS OPEN Inverse problems in brain imaging and multimodal data fusion Montreal, CANADA, August 24-29, 2009 Organizers: Christophe Grova(McGill), Sylvain Baillet (Med. College of Wisconsin), Jean-Marc Lina (Ecole de Technologie Superieure, CRM) (http://www.crm.umontreal.ca/Inverse09/index_e.php) ********************************************************************************************* Sylvain Baillet, Jean-MarcLina and myself are organizing a workshop entitled "Inverse problems in brain imagery and multimodal data fusion". This workshop supported by the "Centre de Recherche en Mathématiques" de l'Université de Montréal (http://www.crm.umontreal.ca/) will last 5 days in Montreal from the 24th to the 29th of August 2009 The diversity of non invasive imaging devices (MRI, EEG, MEG, Near Infrared Spectroscopyl) allows one to explore the brain dynamics provided there exists a mathematical framework that encompass this multimodality and the complexity of the inherent sources of the cerebral signals. Despite a general agreement about the source modelling, many mathematical strategies have been elaborated in order to solve the inevitable ill-posed inverse problem.. What are the common features between those approaches? What are the mathematical frameworks the most appropriate for handling simultaneous measurements from different modalities? What are the best approaches for estimating both spatial and temporal brain activities? The workshop will consist in full 3-hours invited lectures followed by more specific presentations and one poster session. Participants interested in presenting a contributed talk or a poster are invited to submit an abstract before the 15th of July 2009. Participants interested in attending, the registration is now open, places are limited Check our website for more information: http://www.crm.umontreal.ca/Inverse09/index_e.php Preliminary program below We hope to see you in Montreal Grova Christophe, Baillet Sylvain, and Lina Jean-Marc ----------------------------- Monday August 24th: Inverse problem (1) - Matti Hamalainen - Martinos Cent. for Biomed. Imag. Boston USA MEG and EEG side by side in terms of neural sources sources, measurement techniques, forward modeling, and source modeling. - Srikantan Nagarajan - Univ. Calif. at San Francisco USA Machine learning advances in electromagnetic imaging. Probabilistic algorithms developed for analyses of MEG and EEG data ------------------------------------------------------------------------------------------------------- Tuesday August 25th: Inverse problem (2) - Jan de Munck - VU Medical Center Amsterdam, Netherlands Computational aspects of forward and inverse modelling of MEG and EEG - Nelson Trujillo Barreto - Cuban Centre for Neurosciences - LaHavana, Cuba Probabilistic and biophysical models for the analysis and integration of functional neuroimages - Round table / discussion: How deep one can see with MEG vs EEG? Moderators: M. Hamalainen, J. de Munck ------------------------------------------------------------------------------------------------------- Wednesday August 26th: Dipole scanning approaches - J Mosher - Cleveland Clinic USA A Beamformer Perspective of MEG and EEG Source Analyses. (non-cerebral noise rejection in MEG/EEG, non linear source localization) - Douglas Cheyne: Toronto Sick Kids Hospital, Canada Application of beamformers in clinical and cognitive neuroimaging - Hermann Stefan - MEG Center, Erlangen, Germany Clinical application of multimodal data (EEG/MEG/MRI//PET/SPECT) in epilepsy - Round table / discussion : model comparison and model selection for EEG/MEG inverse problem Moderators: N. Trujillo-Barreto, J. Daunizeau ------------------------------------------------------------------------------------------------------- Thursday August 27th: Multimodal data fusion - Christophe Grova - McGill University, Biomedical Engineering Dpt, Canada Insights from electrophysiology (MEG/EEG) and hemodynamic processes (fMRI/NIRS) using multimodal imaging to characterize the epilptogenic network - Jean Daunizeau - Functional Imaging Lab., London, UK Stochastic dynamic causal models in EEG/MEG - Jorge Riera - Tohoku University, Japan Modeling the genesis of the primary current density from a mesoscopic viewpoint: the relationship with EEG and MEG data - Sylvain Baillet- The Medical College of Wisconsin, USA Optical flow techniques adapted to the analysis of time-resolved brain imaging data - Round table / discussion : source localization and induced activity Moderators: J.M Lina ------------------------------------------------------------------------------------------------------- Friday August 28th: Clinical and Neuroscience applications - Jean-Marc Lina - Ecole de Technologie Superieure, Montreal, Canada Entropic approaches dedicated to the EEG/MEG inverse problem - Eliane Kobayashi - McGill, Montreal Neurological Institute, Canada Clinical relevance of EEG/MEG and EEG/fMRI in epilepsy - Stephan Grimault MEG center - Université de Montréal, Canada Memory retention and source localization of induced activity in MEG - Round table / discussion : clinical and neuroscience application of the inverse problem,expectations of the users Moderators: P. Jolicoeur (UdM), J. Gotman (McGill) ------------------------------------------------------------------------------- *************************** Christophe Grova, PhD Assistant Professor Biomedical Engineering Dpt Neurology and Neurosurgery Dpt Montreal Neurological Institute Biomedical Engineering Department - Room 304 McGill University 3775 University Street, Montreal, Quebec, Canada, H3A 2B4 email : christophe.grova at mcgill.ca tel : (514) 398 2516 fax : (514) 398 7461 Research Assistant : MEG Center, CERNEC Université de Montréal tel : (514)-343-6111 ext 18878. web: http://www.mni.mcgill.ca/research/gotman/members/christophe.html http://www.bmed.mcgill.ca/ *************************** ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From florisdelange at GMAIL.COM Mon Jul 6 18:48:17 2009 From: florisdelange at GMAIL.COM (Floris de Lange) Date: Mon, 6 Jul 2009 18:48:17 +0200 Subject: dipole time course Message-ID: Dear Fieldtrippers, I have a fairly basic Fieldtrip question; I hope you can point me in the right direction. I'm running a dipole model on the early auditory response (60-90 ms after the click). The dipoloe fit works very well. Just for completeness, these are the lines of code I used: cfg = []; cfg.numdipoles = 2; cfg.symmetry = 'y'; cfg.model = 'regional'; cfg.latency = [-0.44 -0.41]; cfg.vol = vol; cfg.inwardshift = 0; source = dipolefitting(cfg,erf{1}); % visualize where the dipoles are figure(1); clf; headmodelplot(cfg,erf{1}) hold on; plot3([source.dip.pos(1,1)],[source.dip.pos(1,2)],[source.dip.pos(1,3)],'ro'); plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos(2,3)],'bo'); I have fitted the dipole over a 30 msec window. But now, I would like to plot the response of these dipoles for the whole time window sampled. In other words, I would like to use the coordinates obtained from the dipole fitting procedure, and use them as 'virtual sensors' to reduce the dimensionality of my data from 275 channel time courses to 2. I don't want to use the dipole moments, because they're only defined within the 30 ms that I used to calculate my dipole. I suppose I have to project my data through the dipoles, but I'm not sure how. Any help is greatly appreciated! Best wishes, Floris -- Floris de Lange http://www.florisdelange.com ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Mon Jul 6 21:39:53 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 6 Jul 2009 20:39:53 +0100 Subject: dipole time course In-Reply-To: <9fb563140907060948s59eedcbct39e5f92e7330e1d2@mail.gmail.com> Message-ID: Dear Floris, Dipolefitting uses the pseudo-inverse of the leadfield as its inverse operator. Using prepare_leadfield with the right input should give you the leadfields of the two locations of interest, pinv'ing the concatenated leadfields would give you the inverse operator (and multiplying the sensor level evoked field with the inverse operator gives you the dipoles' time courses (each in 3D)). The individual timecourses could be reduced to 1D by a pca. Alternatively, you could multiply each of the individual leadfields with the average reconstructed dipole orientation, so that you end up with a (concatenated across the two dipoles) forward model of 275x2, pinv'ing this one, and multiplying it with your sensor data directly gives you time courses in 1D. Cheers, JM On Jul 6, 2009, at 5:48 PM, Floris de Lange wrote: > Dear Fieldtrippers, > > I have a fairly basic Fieldtrip question; I hope you can point me > in the right direction. > I'm running a dipole model on the early auditory response (60-90 ms > after the click). The dipoloe fit works very well. Just for > completeness, these are the lines of code I used: > > cfg = []; > cfg.numdipoles = 2; > cfg.symmetry = 'y'; > cfg.model = 'regional'; > cfg.latency = [-0.44 -0.41]; > cfg.vol = vol; > cfg.inwardshift = 0; > source = dipolefitting(cfg,erf{1}); > > % visualize where the dipoles are > figure(1); clf; headmodelplot(cfg,erf{1}) > hold on; > plot3([source.dip.pos(1,1)],[source.dip.pos(1,2)],[source.dip.pos > (1,3)],'ro'); > plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos > (2,3)],'bo'); > > I have fitted the dipole over a 30 msec window. But now, I would > like to plot the response of these dipoles for the whole time > window sampled. > In other words, I would like to use the coordinates obtained from > the dipole fitting procedure, and use them as 'virtual sensors' to > reduce the dimensionality of my data from 275 channel time courses > to 2. I don't want to use the dipole moments, because they're only > defined within the 30 ms that I used to calculate my dipole. > I suppose I have to project my data through the dipoles, but I'm > not sure how. Any help is greatly appreciated! > > Best wishes, > Floris > > -- > Floris de Lange > http://www.florisdelange.com > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From florisdelange at GMAIL.COM Tue Jul 7 14:34:12 2009 From: florisdelange at GMAIL.COM (Floris de Lange) Date: Tue, 7 Jul 2009 14:34:12 +0200 Subject: dipole time course Message-ID: Dear Jan-Matthijs and other fieldtrippers, Thanks for your reply. I tried out your first suggestion. Unfortunately, the dipole time courses look considerably worse than what I get from picking the planar sensors that have the strongest signal. I've attached the results for 2 conditions in the left and right auditory cortex, for comparison. On the top left is (one of the 3 matrices of) the relevant leadfield, and on the right is the planar ERF. On the bottom are the time courses of the pinv'ed leadfield * ERF time course, which are then pca'ed. I have pasted the code used below. Any idea why the dipole time course looks so much worse? % calculate leadfields for the two dipole locations cfg = []; cfg.grad = erf{1}.grad; cfg.vol = vol; cfg.channel = {'MEG'}; cfg.grid.pos = source.dip.pos; [grid] = prepare_leadfield(cfg); % multiply pseudo-inverse of leadfield with erf, then do a pca dip{i}{cond} = pinv(grid.leadfield{i}) * erf{cond}.avg; [tmp1 tmp2] = pca(dip{i}{cond}); Any input appreciated, Best wishes, Floris Dear Floris, > > Dipolefitting uses the pseudo-inverse of the leadfield as its inverse > operator. Using prepare_leadfield with the right input should give > you the leadfields of the two locations of interest, pinv'ing the > concatenated leadfields would give you the inverse operator (and > multiplying the sensor level evoked field with the inverse operator > gives you the dipoles' time courses (each in 3D)). The individual > timecourses could be reduced to 1D by a pca. Alternatively, you could > multiply each of the individual leadfields with the average > reconstructed dipole orientation, so that you end up with a > (concatenated across the two dipoles) forward model of 275x2, > pinv'ing this one, and multiplying it with your sensor data directly > gives you time courses in 1D. > > Cheers, > > JM > > On Jul 6, 2009, at 5:48 PM, Floris de Lange wrote: > > > Dear Fieldtrippers, > > > > I have a fairly basic Fieldtrip question; I hope you can point me > > in the right direction. > > I'm running a dipole model on the early auditory response (60-90 ms > > after the click). The dipoloe fit works very well. Just for > > completeness, these are the lines of code I used: > > > > cfg = []; > > cfg.numdipoles = 2; > > cfg.symmetry = 'y'; > > cfg.model = 'regional'; > > cfg.latency = [-0.44 -0.41]; > > cfg.vol = vol; > > cfg.inwardshift = 0; > > source = dipolefitting(cfg,erf{1}); > > > > % visualize where the dipoles are > > figure(1); clf; headmodelplot(cfg,erf{1}) > > hold on; > > plot3([source.dip.pos(1,1)],[source.dip.pos(1,2)],[source.dip.pos > > (1,3)],'ro'); > > plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos > > (2,3)],'bo'); > > > > I have fitted the dipole over a 30 msec window. But now, I would > > like to plot the response of these dipoles for the whole time > > window sampled. > > In other words, I would like to use the coordinates obtained from > > the dipole fitting procedure, and use them as 'virtual sensors' to > > reduce the dimensionality of my data from 275 channel time courses > > to 2. I don't want to use the dipole moments, because they're only > > defined within the 30 ms that I used to calculate my dipole. > > I suppose I have to project my data through the dipoles, but I'm > > not sure how. Any help is greatly appreciated! > > > > Best wishes, > > Floris > -- Floris de Lange http://www.florisdelange.com ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_1_1.tif Type: image/tiff Size: 160706 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_1_2.tif Type: image/tiff Size: 172144 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_2_1.tif Type: image/tiff Size: 171686 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_2_2.tif Type: image/tiff Size: 184488 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Tue Jul 7 14:55:21 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Tue, 7 Jul 2009 13:55:21 +0100 Subject: dipole time course In-Reply-To: <9fb563140907070534x1e24d827r8da78d3d5b47a150@mail.gmail.com> Message-ID: Hi Floris, I suspect that the 'orientation' onto which the pca projects the dipoles is not optimal. Perhaps you might want to try the other way, i.e. compute the leadfields in 1D, either by specifying something in cfg.grid.mom (or ori, I keep forgetting) before calling prepare_leadfield, or by postmultiplying the 3D leadfields with the orientation as estimated by the dipole fit. Cheers, JM On Jul 7, 2009, at 1:34 PM, Floris de Lange wrote: > Dear Jan-Matthijs and other fieldtrippers, > > Thanks for your reply. I tried out your first suggestion. > Unfortunately, the dipole time courses look considerably worse than > what I get from picking the planar sensors that have the strongest > signal. I've attached the results for 2 conditions in the left and > right auditory cortex, for comparison. On the top left is (one of > the 3 matrices of) the relevant leadfield, and on the right is the > planar ERF. On the bottom are the time courses of the pinv'ed > leadfield * ERF time course, which are then pca'ed. I have pasted > the code used below. Any idea why the dipole time course looks so > much worse? > > % calculate leadfields for the two dipole locations > cfg = []; > cfg.grad = erf{1}.grad; > cfg.vol = vol; > cfg.channel = {'MEG'}; > cfg.grid.pos = source.dip.pos; > [grid] = prepare_leadfield(cfg); > > % multiply pseudo-inverse of leadfield with erf, then do a pca > dip{i}{cond} = pinv(grid.leadfield{i}) * erf{cond}.avg; > [tmp1 tmp2] = pca(dip{i}{cond}); > > Any input appreciated, > Best wishes, > Floris > > > > Dear Floris, > > Dipolefitting uses the pseudo-inverse of the leadfield as its inverse > operator. Using prepare_leadfield with the right input should give > you the leadfields of the two locations of interest, pinv'ing the > concatenated leadfields would give you the inverse operator (and > multiplying the sensor level evoked field with the inverse operator > gives you the dipoles' time courses (each in 3D)). The individual > timecourses could be reduced to 1D by a pca. Alternatively, you could > multiply each of the individual leadfields with the average > reconstructed dipole orientation, so that you end up with a > (concatenated across the two dipoles) forward model of 275x2, > pinv'ing this one, and multiplying it with your sensor data directly > gives you time courses in 1D. > > Cheers, > > JM > > On Jul 6, 2009, at 5:48 PM, Floris de Lange wrote: > > > Dear Fieldtrippers, > > > > I have a fairly basic Fieldtrip question; I hope you can point me > > in the right direction. > > I'm running a dipole model on the early auditory response (60-90 ms > > after the click). The dipoloe fit works very well. Just for > > completeness, these are the lines of code I used: > > > > cfg = []; > > cfg.numdipoles = 2; > > cfg.symmetry = 'y'; > > cfg.model = 'regional'; > > cfg.latency = [-0.44 -0.41]; > > cfg.vol = vol; > > cfg.inwardshift = 0; > > source = dipolefitting(cfg,erf{1}); > > > > % visualize where the dipoles are > > figure(1); clf; headmodelplot(cfg,erf{1}) > > hold on; > > plot3([source.dip.pos(1,1)],[ > source.dip.pos(1,2)],[source.dip.pos > > (1,3)],'ro'); > > plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos > > (2,3)],'bo'); > > > > I have fitted the dipole over a 30 msec window. But now, I would > > like to plot the response of these dipoles for the whole time > > window sampled. > > In other words, I would like to use the coordinates obtained from > > the dipole fitting procedure, and use them as 'virtual sensors' to > > reduce the dimensionality of my data from 275 channel time courses > > to 2. I don't want to use the dipole moments, because they're only > > defined within the 30 ms that I used to calculate my dipole. > > I suppose I have to project my data through the dipoles, but I'm > > not sure how. Any help is greatly appreciated! > > > > Best wishes, > > Floris > > > -- > Floris de Lange > http://www.florisdelange.com > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > > sults_2_1.tif> ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Jul 7 18:08:44 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 7 Jul 2009 18:08:44 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: Message-ID: Hi Hanneke, The read_mri function has support for MRIs in fif files using a meg_pd function (i.e. mex file), but not yet for the mne toolbox. Could you send me an example MRI dataset so that I can try it out? Robert PS See http://fieldtrip.fcdonders.nl/contact#how_should_i_send_example_data_to_the_developers On 3 Jul 2009, at 16:42, Hanneke van Dijk wrote: > Dear all, > > I am getting started doing analysis on Elekta Neuromag data using > fieldtrip, having been used to CTF data at the Donders before... > My question regards loading mri data in order to do volumesegment > and sourceanalysis in the end. > > In particular I would like to transform the outcome of the mne > toolbox function: 'fif_read_mri.m' to a fieldtrip compatible format. > > F.Y.I, I'm working with data with recorded with the old 122 sensor > system here in Duesseldorf, and with data of the newest 306 vector > view system as well. > > Does anyone have experience with this? And of course maybe have a > solution? > > Best and thanks in advance, > > Hanneke > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Wed Jul 8 09:01:28 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Wed, 8 Jul 2009 09:01:28 +0200 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Message-ID: Hi Robert, Thanks for your reply. I have tried the meg_pd function loadmri (via read_mri in fieldtrip) but I got the feedback: 'error loading mri-file'. So I have no idea what is going wrong. I will send you the example mri-file right now. It is probably not to difficult to work something out but I want to be sure that the mri head coordinates end up in the right way as device coordinates. Thanks in advance! Viele Gruße aus Düsseldorf ;-) Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von Robert Oostenveld Gesendet: Di 07.07.2009 18:08 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, The read_mri function has support for MRIs in fif files using a meg_pd function (i.e. mex file), but not yet for the mne toolbox. Could you send me an example MRI dataset so that I can try it out? Robert PS See http://fieldtrip.fcdonders.nl/contact#how_should_i_send_example_data_to_the_developers On 3 Jul 2009, at 16:42, Hanneke van Dijk wrote: > Dear all, > > I am getting started doing analysis on Elekta Neuromag data using > fieldtrip, having been used to CTF data at the Donders before... > My question regards loading mri data in order to do volumesegment > and sourceanalysis in the end. > > In particular I would like to transform the outcome of the mne > toolbox function: 'fif_read_mri.m' to a fieldtrip compatible format. > > F.Y.I, I'm working with data with recorded with the old 122 sensor > system here in Duesseldorf, and with data of the newest 306 vector > view system as well. > > Does anyone have experience with this? And of course maybe have a > solution? > > Best and thanks in advance, > > Hanneke > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. Hi ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 8 09:49:02 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 8 Jul 2009 09:49:02 +0200 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F347B@Mail2-UKD.VMED.UKD> Message-ID: Hi Hanneke, The mri.fif file that you sent only contains the header information, but not the slice/image information. >> fiff_read_mri('mri.fif') Reading slice information and pixel data.??? Error using ==> fiff_read_mri at 116 Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 Please also send the corresponding slice data. Robert On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > Hi Robert, > > Thanks for your reply. I have tried the meg_pd function loadmri (via > read_mri in fieldtrip) but I got the feedback: 'error loading mri- > file'. So I have no idea what is going wrong. I will send you the > example mri-file right now. It is probably not to difficult to work > something out but I want to be sure that the mri head coordinates > end up in the right way as device coordinates. > > Thanks in advance! > Viele Gruße aus Düsseldorf ;-) > > Hanneke ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Wed Jul 8 10:03:10 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Wed, 8 Jul 2009 10:03:10 +0200 Subject: AW: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Message-ID: Hi Robert, Done, sorry! Groetjes Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von Robert Oostenveld Gesendet: Mi 08.07.2009 09:49 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, The mri.fif file that you sent only contains the header information, but not the slice/image information. >> fiff_read_mri('mri.fif') Reading slice information and pixel data.??? Error using ==> fiff_read_mri at 116 Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 Please also send the corresponding slice data. Robert On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > Hi Robert, > > Thanks for your reply. I have tried the meg_pd function loadmri (via > read_mri in fieldtrip) but I got the feedback: 'error loading mri- > file'. So I have no idea what is going wrong. I will send you the > example mri-file right now. It is probably not to difficult to work > something out but I want to be sure that the mri head coordinates > end up in the right way as device coordinates. > > Thanks in advance! > Viele Gruße aus Düsseldorf ;-) > > Hanneke ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 8 10:09:08 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 8 Jul 2009 10:09:08 +0200 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <143C4174-C62D-4A08-888C-06A79538F7E5@fcdonders.ru.nl> Message-ID: Hi Hanneke, I have tried importing another MRI fif file which I still had on disk using the following modification of the fieldtrip/fileio/read_mri.m code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%% elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') % use the mne functions to read the Neuromag MRI hdr = fiff_read_mri(filename); img = cat(3, hdr.slices.data); hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data to save memory transform = hdr.trans.trans; and then slightly further down in the code % set up the axes of the volume in voxel coordinates nx = size(img,1); ny = size(img,2); nz = size(img,3); mri.dim = [nx ny nz]; % store the anatomical data mri.anatomy = img; % store the header with all fileformat specific details mri.hdr = hdr; try % if present, store the homogenous transformation matrix mri.transform = transform; end This results in a warning of the MNE fiff_read_mri function >> mri = read_mri('lp_mri_headcoords.fif') Reading slice information and pixel data..50..100..126..[done] The slices are not equally spaced. Voxel transformation will not be included mri = dim: [256 256 126] anatomy: [256x256x126 int16] hdr: [1x1 struct] transform: [4x4 double] and the resulting coordinate transformation matrix is not fully correct. You can check the coordinates by plotting it intreactively in sourceplot (after converting the image data from int16 into double). Perhaps one of the Neuromag experts on the list can help you further. best regards, Robert PS atatched is the latest read_mri function, which includes the call to fiff_read_mri. On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > Hi Hanneke, > > The mri.fif file that you sent only contains the header information, > but not the slice/image information. > > >> fiff_read_mri('mri.fif') > Reading slice information and pixel data.??? Error using ==> > fiff_read_mri at 116 > Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ > MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 > > Please also send the corresponding slice data. > > Robert > > > On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > >> Hi Robert, >> >> Thanks for your reply. I have tried the meg_pd function loadmri >> (via read_mri in fieldtrip) but I got the feedback: 'error loading >> mri-file'. So I have no idea what is going wrong. I will send you >> the example mri-file right now. It is probably not to difficult to >> work something out but I want to be sure that the mri head >> coordinates end up in the right way as device coordinates. >> >> Thanks in advance! >> Viele Gruße aus Düsseldorf ;-) >> >> Hanneke > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: read_mri.m Type: application/octet-stream Size: 11399 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Wed Jul 8 10:22:09 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 8 Jul 2009 09:22:09 +0100 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: Message-ID: Hi Hanneke, Please note that the X and Y axis in the neuromag head-coordinate system are swapped with respect to the CTF and 4D convention; i.e. X axis through the ears, and Y-axis to the nose. What usually works for me is discarding the mri.transform (mri = rmfield(mri, 'transform'), and call volumerealign in the interactive mode. You can then specify the location of the fiducials yourself and the output mri of the function will contain a transformation matrix according to ctf convention. This at least ensures that volumesegment etc kind of work properly. Yet, it is important to know that of course the gradiometer positions in the data are defined in neuromag convention, so after preparing your volume conduction model you probably have to swap the x and y coordinates of the vol.bnd.pnt (assuming you use a singleshell as volume conductor model), before proceeding to visualization (headmodelplot; just to check whether the head fits in the helmet), leadfield computation (only makes sense if the head fits in the helmet), and sourceanalysis (idem). Yours, JM On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > Hi Hanneke, > > I have tried importing another MRI fif file which I still had on > disk using the following modification of the fieldtrip/fileio/ > read_mri.m code > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %%%%%%%%%%%%%% > elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') > % use the mne functions to read the Neuromag MRI > hdr = fiff_read_mri(filename); > img = cat(3, hdr.slices.data); > hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data > to save memory > transform = hdr.trans.trans; > > and then slightly further down in the code > > % set up the axes of the volume in voxel coordinates > nx = size(img,1); > ny = size(img,2); > nz = size(img,3); > mri.dim = [nx ny nz]; > % store the anatomical data > mri.anatomy = img; > % store the header with all fileformat specific details > mri.hdr = hdr; > try > % if present, store the homogenous transformation matrix > mri.transform = transform; > end > > This results in a warning of the MNE fiff_read_mri function > > >> mri = read_mri('lp_mri_headcoords.fif') > Reading slice information and pixel data..50..100..126..[done] > The slices are not equally spaced. Voxel transformation will not > be included > > mri = > dim: [256 256 126] > anatomy: [256x256x126 int16] > hdr: [1x1 struct] > transform: [4x4 double] > > and the resulting coordinate transformation matrix is not fully > correct. You can check the coordinates by plotting it intreactively > in sourceplot (after converting the image data from int16 into > double). > > Perhaps one of the Neuromag experts on the list can help you further. > > best regards, > Robert > > PS atatched is the latest read_mri function, which includes the > call to fiff_read_mri. > > > On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> The mri.fif file that you sent only contains the header >> information, but not the slice/image information. >> >> >> fiff_read_mri('mri.fif') >> Reading slice information and pixel data.??? Error using ==> >> fiff_read_mri at 116 >> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >> >> Please also send the corresponding slice data. >> >> Robert >> >> >> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >> >>> Hi Robert, >>> >>> Thanks for your reply. I have tried the meg_pd function loadmri >>> (via read_mri in fieldtrip) but I got the feedback: 'error >>> loading mri-file'. So I have no idea what is going wrong. I will >>> send you the example mri-file right now. It is probably not to >>> difficult to work something out but I want to be sure that the >>> mri head coordinates end up in the right way as device coordinates. >>> >>> Thanks in advance! >>> Viele Gruße aus Düsseldorf ;-) >>> >>> Hanneke >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Wed Jul 8 10:29:09 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Wed, 8 Jul 2009 10:29:09 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. Message-ID: Hi Robert and Jan-Mathijs, Thanks so much for your quick replies and the script! I will try to work it out and keep you updated! Yours, Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von Robert Oostenveld Gesendet: Mi 08.07.2009 10:09 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, I have tried importing another MRI fif file which I still had on disk using the following modification of the fieldtrip/fileio/read_mri.m code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%% elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') % use the mne functions to read the Neuromag MRI hdr = fiff_read_mri(filename); img = cat(3, hdr.slices.data); hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data to save memory transform = hdr.trans.trans; and then slightly further down in the code % set up the axes of the volume in voxel coordinates nx = size(img,1); ny = size(img,2); nz = size(img,3); mri.dim = [nx ny nz]; % store the anatomical data mri.anatomy = img; % store the header with all fileformat specific details mri.hdr = hdr; try % if present, store the homogenous transformation matrix mri.transform = transform; end This results in a warning of the MNE fiff_read_mri function >> mri = read_mri('lp_mri_headcoords.fif') Reading slice information and pixel data..50..100..126..[done] The slices are not equally spaced. Voxel transformation will not be included mri = dim: [256 256 126] anatomy: [256x256x126 int16] hdr: [1x1 struct] transform: [4x4 double] and the resulting coordinate transformation matrix is not fully correct. You can check the coordinates by plotting it intreactively in sourceplot (after converting the image data from int16 into double). Perhaps one of the Neuromag experts on the list can help you further. best regards, Robert PS atatched is the latest read_mri function, which includes the call to fiff_read_mri. On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > Hi Hanneke, > > The mri.fif file that you sent only contains the header information, > but not the slice/image information. > > >> fiff_read_mri('mri.fif') > Reading slice information and pixel data.??? Error using ==> > fiff_read_mri at 116 > Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ > MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 > > Please also send the corresponding slice data. > > Robert > > > On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > >> Hi Robert, >> >> Thanks for your reply. I have tried the meg_pd function loadmri >> (via read_mri in fieldtrip) but I got the feedback: 'error loading >> mri-file'. So I have no idea what is going wrong. I will send you >> the example mri-file right now. It is probably not to difficult to >> work something out but I want to be sure that the mri head >> coordinates end up in the right way as device coordinates. >> >> Thanks in advance! >> Viele Gruße aus Düsseldorf ;-) >> >> Hanneke > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gsudre at POBOX.COM Wed Jul 8 14:17:09 2009 From: gsudre at POBOX.COM (Gustavo Sudre) Date: Wed, 8 Jul 2009 08:17:09 -0400 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <63C46F40-97E3-4E32-930D-6EC7D32F6A5D@psy.gla.ac.uk> Message-ID: Hi, I've been following this discussion closely because I've been having the same problem. The new read_mri worked fine for me (thanks for that!). Now, the mri I import is already in head coordinates (Neuromag standard: mri.hdr.trans.from=4), and it has been realigned to the data using a separate program, so I would prefer to not re-define the fiducials using volumerealign. In this case, is it enough to just switch the X and Y axes manually (mri.anatomy = permute(mri.anatomy,[2 1 3])) to conform to CTF standards, and use the identity matrix for mri.transform? If I understand it correctly, mri.transform is used to take the mri (or any volume) to head coordinates, right? So, I was wondering what steps the mri.transform matrix is required. Do other common future steps (e.g. plotting, preparing headmodel, leadfield, etc) assume the volume is already in head coordinates, or do they always use vol.transform for that? Also, when I tried removing mri,transform, volumerealign didn't like it because the mri structure wasn't a volume structure anymore (and I imagine other functions will complain about it too, that's why I used the identity). Thanks, Gus On Jul 8, 2009, at 4:22 AM, jan-mathijs schoffelen wrote: > Hi Hanneke, > > Please note that the X and Y axis in the neuromag head-coordinate > system are swapped with respect to the CTF and 4D convention; i.e. X > axis through the ears, and Y-axis to the nose. > What usually works for me is discarding the mri.transform (mri = > rmfield(mri, 'transform'), and call volumerealign in the interactive > mode. You can then specify the location of the fiducials yourself > and the output mri of the function will contain a transformation > matrix according to ctf convention. This at least ensures that > volumesegment etc kind of work properly. Yet, it is important to > know that of course the gradiometer positions in the data are > defined in neuromag convention, so after preparing your volume > conduction model you probably have to swap the x and y coordinates > of the vol.bnd.pnt (assuming you use a singleshell as volume > conductor model), before proceeding to visualization (headmodelplot; > just to check whether the head fits in the helmet), leadfield > computation (only makes sense if the head fits in the helmet), and > sourceanalysis (idem). > > Yours, > > JM > > > > > On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> I have tried importing another MRI fif file which I still had on >> disk using the following modification of the fieldtrip/fileio/ >> read_mri.m code >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %%%%%%%%%%%%% >> elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') >> % use the mne functions to read the Neuromag MRI >> hdr = fiff_read_mri(filename); >> img = cat(3, hdr.slices.data); >> hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data >> to save memory >> transform = hdr.trans.trans; >> >> and then slightly further down in the code >> >> % set up the axes of the volume in voxel coordinates >> nx = size(img,1); >> ny = size(img,2); >> nz = size(img,3); >> mri.dim = [nx ny nz]; >> % store the anatomical data >> mri.anatomy = img; >> % store the header with all fileformat specific details >> mri.hdr = hdr; >> try >> % if present, store the homogenous transformation matrix >> mri.transform = transform; >> end >> >> This results in a warning of the MNE fiff_read_mri function >> >> >> mri = read_mri('lp_mri_headcoords.fif') >> Reading slice information and pixel data..50..100..126..[done] >> The slices are not equally spaced. Voxel transformation will not >> be included >> >> mri = >> dim: [256 256 126] >> anatomy: [256x256x126 int16] >> hdr: [1x1 struct] >> transform: [4x4 double] >> >> and the resulting coordinate transformation matrix is not fully >> correct. You can check the coordinates by plotting it intreactively >> in sourceplot (after converting the image data from int16 into >> double). >> >> Perhaps one of the Neuromag experts on the list can help you further. >> >> best regards, >> Robert >> >> PS atatched is the latest read_mri function, which includes the >> call to fiff_read_mri. >> >> >> On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: >> >>> Hi Hanneke, >>> >>> The mri.fif file that you sent only contains the header >>> information, but not the slice/image information. >>> >>> >> fiff_read_mri('mri.fif') >>> Reading slice information and pixel data.??? Error using ==> >>> fiff_read_mri at 116 >>> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >>> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >>> >>> Please also send the corresponding slice data. >>> >>> Robert >>> >>> >>> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >>> >>>> Hi Robert, >>>> >>>> Thanks for your reply. I have tried the meg_pd function loadmri >>>> (via read_mri in fieldtrip) but I got the feedback: 'error >>>> loading mri-file'. So I have no idea what is going wrong. I will >>>> send you the example mri-file right now. It is probably not to >>>> difficult to work something out but I want to be sure that the >>>> mri head coordinates end up in the right way as device coordinates. >>>> >>>> Thanks in advance! >>>> Viele Gruße aus Düsseldorf ;-) >>>> >>>> Hanneke >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From gsudre at POBOX.COM Wed Jul 8 14:34:35 2009 From: gsudre at POBOX.COM (Gustavo Sudre) Date: Wed, 8 Jul 2009 08:34:35 -0400 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <63C46F40-97E3-4E32-930D-6EC7D32F6A5D@psy.gla.ac.uk> Message-ID: OK, so I just thought of two more questions, so I apologize for not including them in my previous e-mail... 1) If after importing the Neuromag MRI the (head) coordinate system of the mri structure matches the same coordinate system in the data (including conventions such as Y-axis through the nose), why do we need to change it? You mentioned that volumesegment works better with CTF coordinates? So, does the segmentation algorithm make assumptions about where brain regions are based on the axis? Also, what other function in fieldtrip depend on such coordinate system, and would not work just by having the data coordinate system match the volume's? 2) So, let's say I already have segmented MRIs. If I just import that (and assuming volumesegment with the assumptions above), is it possible to go ahead with other steps such as prepare_bem, and prepare_singleshell? Thanks, Gus On Jul 8, 2009, at 4:22 AM, jan-mathijs schoffelen wrote: > Hi Hanneke, > > Please note that the X and Y axis in the neuromag head-coordinate > system are swapped with respect to the CTF and 4D convention; i.e. X > axis through the ears, and Y-axis to the nose. > What usually works for me is discarding the mri.transform (mri = > rmfield(mri, 'transform'), and call volumerealign in the interactive > mode. You can then specify the location of the fiducials yourself > and the output mri of the function will contain a transformation > matrix according to ctf convention. This at least ensures that > volumesegment etc kind of work properly. Yet, it is important to > know that of course the gradiometer positions in the data are > defined in neuromag convention, so after preparing your volume > conduction model you probably have to swap the x and y coordinates > of the vol.bnd.pnt (assuming you use a singleshell as volume > conductor model), before proceeding to visualization (headmodelplot; > just to check whether the head fits in the helmet), leadfield > computation (only makes sense if the head fits in the helmet), and > sourceanalysis (idem). > > Yours, > > JM > > > > > On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> I have tried importing another MRI fif file which I still had on >> disk using the following modification of the fieldtrip/fileio/ >> read_mri.m code >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %%%%%%%%%%%%% >> elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') >> % use the mne functions to read the Neuromag MRI >> hdr = fiff_read_mri(filename); >> img = cat(3, hdr.slices.data); >> hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data >> to save memory >> transform = hdr.trans.trans; >> >> and then slightly further down in the code >> >> % set up the axes of the volume in voxel coordinates >> nx = size(img,1); >> ny = size(img,2); >> nz = size(img,3); >> mri.dim = [nx ny nz]; >> % store the anatomical data >> mri.anatomy = img; >> % store the header with all fileformat specific details >> mri.hdr = hdr; >> try >> % if present, store the homogenous transformation matrix >> mri.transform = transform; >> end >> >> This results in a warning of the MNE fiff_read_mri function >> >> >> mri = read_mri('lp_mri_headcoords.fif') >> Reading slice information and pixel data..50..100..126..[done] >> The slices are not equally spaced. Voxel transformation will not >> be included >> >> mri = >> dim: [256 256 126] >> anatomy: [256x256x126 int16] >> hdr: [1x1 struct] >> transform: [4x4 double] >> >> and the resulting coordinate transformation matrix is not fully >> correct. You can check the coordinates by plotting it intreactively >> in sourceplot (after converting the image data from int16 into >> double). >> >> Perhaps one of the Neuromag experts on the list can help you further. >> >> best regards, >> Robert >> >> PS atatched is the latest read_mri function, which includes the >> call to fiff_read_mri. >> >> >> On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: >> >>> Hi Hanneke, >>> >>> The mri.fif file that you sent only contains the header >>> information, but not the slice/image information. >>> >>> >> fiff_read_mri('mri.fif') >>> Reading slice information and pixel data.??? Error using ==> >>> fiff_read_mri at 116 >>> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >>> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >>> >>> Please also send the corresponding slice data. >>> >>> Robert >>> >>> >>> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >>> >>>> Hi Robert, >>>> >>>> Thanks for your reply. I have tried the meg_pd function loadmri >>>> (via read_mri in fieldtrip) but I got the feedback: 'error >>>> loading mri-file'. So I have no idea what is going wrong. I will >>>> send you the example mri-file right now. It is probably not to >>>> difficult to work something out but I want to be sure that the >>>> mri head coordinates end up in the right way as device coordinates. >>>> >>>> Thanks in advance! >>>> Viele Gruße aus Düsseldorf ;-) >>>> >>>> Hanneke >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ingrid.nieuwenhuis at DONDERS.RU.NL Wed Jul 8 16:15:12 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Wed, 8 Jul 2009 16:15:12 +0200 Subject: Clusterplot not highlighting clusters & average layout file In-Reply-To: Message-ID: Dear Manish, > Thanks for your quick reply. I wanted to run freqstats separately on > each frequency, since I don't have precise temporal resolution in my > data (no events). Hence I need to run stats on Freq-Space > representations and not on TFR. Since clusterplot was not handling > this case, probably because it is made to search across time and space > for a given frequency, I ran freqstats/clusterplot separately for each > frequency. Aha, so you have frequency and channels, no time. Clusterplot can handle both data with and without time dimension (it looks for a .time field in the data). It cannot handle data with multiple frequency dimensions, so therefore you have to avgoverfreq (in revision 1.8 of clusterplot from May 22nd, I added a check for appropriateness of the data, see line 58). So depending on the hypothesis you want to test and your data you can either avgoverfreq and use clusterplot (as I said before usually appropriate for the lower frequencies because of well defined narrow bands, but again it depends on the research questions you have), or use multiplot. But because you have no time dimension you should use multiplotER (not multiplotTFR), with xparam = 'freq', zparam = 'stat', and maskparameter = 'mask'. Then the frequencies that are in the cluster are marked with a box. I don't know if it all works properly, I recall there were some problems with the masking options in multiplotER. Let me know if you need it and you don't get it to work. Hope it's all clear now, Best Ingrid > -----Original Message----- > From: Manish Saggar [mailto:manish.saggar at gmail.com] > Sent: Tuesday, June 30, 2009 6:40 AM > To: ingrid.nieuwenhuis at donders.ru.nl > Cc: FieldTrip discussion list > Subject: Re: [FIELDTRIP] Clusterplot not highlighting clusters & average > layout file > > Thanks for your quick reply. I wanted to run freqstats separately on > each frequency, since I don't have precise temporal resolution in my > data (no events). Hence I need to run stats on Freq-Space > representations and not on TFR. Since clusterplot was not handling > this case, probably because it is made to search across time and space > for a given frequency, I ran freqstats/clusterplot separately for each > frequency. > > So just to make sure I understood correctly, you are saying either I > use 'cfg.avgoverfreq=yes' especially for lower frequencies and then > use clusterplot OR do it separately for each frequency but use > multiplotTFR instead. But it seems like I can also use clusterplot > separately for each frequency, right? It seemed to work fine. May be I > am missing some obvious point here. Please let me know. > > Another thing that might be of interest to other people that I noticed > recently is that neighbourdist measures distance in meters when the > ELP (sensor location) file is created using BESA for EEG data. Thus a > default value of 4 cm is considered as 4 m and hence all the available > channels become neighbors for each channel. Thus I had to use a value > of 0.1 for neighbourdist, which takes 6 neighbour channels into > account. I think that is roughly equivalent to the default value of 4 > cm. > > Regards, > Manish > > On Mon, Jun 29, 2009 at 3:09 PM, Ingrid > Nieuwenhuis wrote: > > Dear Manish, > > > > (I reply to the list again, than everyone can benefit). > > That depends on what you want to test. If you have multiple frequencies > in > > your freq-data, and you just call freqanalysis, and you do not average > over > > specific frequency range, then clusterplot will look for clusters in the > > time-frequency-place domain. This does not always make sense, for > instance > > in the lower frequencies we know that there are different frequency > bands > > that behave totally different (theta and alpha for instance). Then you > can > > better run freqanalysis for these frequencies separately (choose only > 10Hz > > for alpha, or choose 8:12 Hz and cfg.avgoverfreq = 'yes'). In this case > you > > can use clusterplot to visualize. > > > > If you have no idea which frequencies behave the same, or that is > something > > you are actually interested in (for instance you have a broadbanded high > > gamma in your TFR) you can put freq-data with multiple frequencies in > > freqanalysis and look at the cluster that comes out. This is a valid > thing > > to do, but you can only not use clusterplot to visualize then. What you > can > > do is plot with multiplotTFR with mask settings (cfg.zparam = 'stat', > > cfg.maskparam = 'mask'). > > > > Best Ingrid > > > >> -----Original Message----- > >> From: Manish Saggar [mailto:manish.saggar at gmail.com] > >> Sent: Monday, June 29, 2009 7:49 PM > >> To: ingrid.nieuwenhuis at donders.ru.nl > >> Subject: Re: [FIELDTRIP] Clusterplot not highlighting clusters & > average > >> layout file > >> > >> Dear Ingrid, > >> > >> Thanks for your reply. Sorry I was out and didn't get a chance to reply > >> back. > >> > >> Last question regarding your reply, can I simply run freqstats and > >> clusterplot for each frequency separately? > >> > >> Regards, > >> Manish > >> > >> On Fri, May 22, 2009 at 9:39 AM, Ingrid > >> Nieuwenhuis wrote: > >> > Dear Manish, > >> > > >> > If I understand correctly you have multiple frequencies over which > you > >> > cluster. Is that correct? (so cfg.avgoverfreq = 'no' when you called > >> > freqstatistics?) In that case you should not call clusterplot because > >> for > >> > different frequencies there can be different channels part of the > >> cluster. > >> > Instead you can call multiplotER or multiplotTFR and use > >> cfg.maskparameter = > >> > 'mask' to plot the significant cluster. > >> > > >> > Hope this helps, > >> > Ingrid > >> > > >> > > >> >> -----Original Message----- > >> >> From: Manish Saggar [mailto:manish.saggar at gmail.com] > >> >> Sent: Friday, May 15, 2009 8:26 AM > >> >> To: ingrid.nieuwenhuis at donders.ru.nl > >> >> Cc: FIELDTRIP at NIC.SURFNET.NL > >> >> Subject: Re: [FIELDTRIP] Clusterplot not highlighting clusters & > >> average > >> >> layout file > >> >> > >> >> Ingrid, thanks for replying back. > >> >> > >> >> Apologies for lack of information. > >> >> > >> >> Clusterplot is plotting clusters fine most of the times, but in some > >> >> cases it doesn't choose to highlight markers. I have attached two > such > >> >> images with this email. > >> >> > >> >> I do not get any errors or warnings. In fact the command window in > >> >> matlab says, cluster found (with some prob and highlighter sign) and > >> >> then the plot doesn't contain any highlighting. > >> >> Initially I thought that my layout file might be messing it up or > >> >> something, or may be I need to take an average layout file for group > >> >> analysis (since cap size and electrode digitization varies for each > >> >> subject). > >> >> > >> >> Then I put debug points in the code and found out that at line 235 > the > >> >> list cell (used to denote highlighted points) is empty. I am a > novice > >> >> so please forgive if what I am suggesting is dumb here, but I think > >> >> when cluster plot is searching for significant clusters it is only > >> >> looking into first column (which could correspond to first frequency > >> >> in band) if one cluster is found by freqstats. It might be that in > the > >> >> code you guys are sorting columns and I might have missed it. But I > >> >> thought I should clear this with you. > >> >> > >> >> In another thread you have mentioned to someone that their time > limits > >> >> might not be precise enough to get the clusers highlighted > >> >> > >> > (https://listserv.surfnet.nl/scripts/wa.cgi?A2=ind0709&L=FIELDTRIP&P=R680 > >> >> ). But they were doing time-freq analysis and I am just doing freq- > >> >> representations. So should I use freqstats on each freq separately ? > >> >> > >> >> On a side note, when I run freqstats on my data (with 88 channels) > >> >> command line says '89 neighbors per channel found'. I am a little > >> >> confused with this. First since I only have less than 88 channels in > >> >> the data and second since it should only consider a lower number for > >> >> neighbor distance, right? and how can I change it? > >> >> > >> >> Thanks a ton in advance, > >> >> Manish > >> >> > >> >> On May 13, 2009, at 2:10 AM, Ingrid Nieuwenhuis wrote: > >> >> > >> >> > Dear Manish, > >> >> > > >> >> > You give a bit too few information to be able to figure out what > >> >> > could be > >> >> > the problem with clusterplot. After calling clusterplot, > clusterplot > >> >> > gives > >> >> > information on which clusters it finds. Does the function find any > >> >> > clusters? > >> >> > Does the .mask field of the structure that comes out of > >> freqstatistics > >> >> > contain any ones? Is everything else plotted normally? Do you get > >> >> > any errors > >> >> > or warnings? > >> >> > > >> >> > I'm not familiar with BESA layout files, but assuming that all > >> >> > layout files > >> >> > are similar over subjects, I think it is fine to just use an > >> >> > individual > >> >> > subject's layout file. > >> >> > > >> >> > Hope this helps, > >> >> > Best Ingrid > >> >> > > >> >> > > >> >> >>  ---Original Message----- > >> >> >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On > >> >> >> Behalf Of Manish Saggar > >> >> >> Sent: Tuesday, May 12, 2009 10:17 AM > >> >> >> To: FIELDTRIP at NIC.SURFNET.NL > >> >> >> Subject: [FIELDTRIP] Clusterplot not highlighting clusters & > average > >> >> >> layout file > >> >> >> > >> >> >> All, > >> >> >> > >> >> >> I have a question regarding clusterplot function. I am doing a > >> >> >> within-subject analysis. > >> >> >> The experimental design that I have is as follows, there are > three > >> >> >> conditions C1, C2 and C3. Each condition is of 1 min duration > (e.g. > >> >> >> rest with eyes open for 1 min). > >> >> >> > >> >> >> Now I am comparing grandaverage of freq representation of a set > of > >> >> >> subjects for C2 with C1 etc. FreqStatistics is running just fine > >> >> >> creating significant (<0.025 alpha, for 2-tailed test) clusters > >> >> >> (positive). Now the problem is that when I try to plot the > location > >> >> >> of > >> >> >> this cluster using clusterplot it doesn't show any highlighted > >> >> >> channels. Any ideas why that is happening? > >> >> >> > >> >> >> Another question is that since I am using grandaverages of freq > >> >> >> representation, what should I use for layout file (using BESA sfp > >> >> >> file > >> >> >> here). I have individual subject layout files. Currently I am > just > >> >> >> giving any file from one of the subjects. Since, I noticed that > >> >> >> FreqStatistics finds a common minimum set of channels and then > apply > >> >> >> statistics on it. So do I need to average layout files for the > >> >> >> subject > >> >> >> group or is there any other way? > >> >> >> > >> >> >> Any help is much appreciated. > >> >> >> > >> >> >> Regards, > >> >> >> Manish > >> >> >> > >> >> >> ---------------------------------- > >> >> >> The aim of this list is to facilitate the discussion between > users > >> >> >> of the > >> >> >> FieldTrip  toolbox, to share experiences and to discuss new ideas > >> >> >> for MEG > >> >> >> and EEG analysis. See also > >> >> >> http://listserv.surfnet.nl/archives/fieldtrip.html and > >> >> >> http://www.ru.nl/neuroimaging/fieldtrip. > >> >> > > >> >> > ---------------------------------- > >> >> > The aim of this list is to facilitate the discussion between users > >> >> > of the FieldTrip  toolbox, to share experiences and to discuss new > >> >> > ideas for MEG and EEG analysis. See also > >> >> http://listserv.surfnet.nl/archives/fieldtrip.html > >> >> >  and http://www.ru.nl/neuroimaging/fieldtrip. > >> >> > >> > > >> > > >> > > >> > > > > > > > > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From am236 at GEORGETOWN.EDU Thu Jul 9 04:43:39 2009 From: am236 at GEORGETOWN.EDU (Andrei Medvedev) Date: Wed, 8 Jul 2009 22:43:39 -0400 Subject: beamformer source localization for EEG Message-ID: Dear Fieldtrip developers/users I am a relatively recent user of Fieldtrip (and very much appreciative of this software). Having good experience with the analysis of brain oscillations etc, I now want to proceed with source reconstruction and it appeared that I need some help with the beamformer technique for EEG data. I am trying to use it for EEG data collected with a 128-channel EGI system. I also have structural MRI data for my subjects and would like to use realistic head models etc. I was following the Fieldtrip tutorial (1) “Localizing oscillatory sources using beamformer techniques”, which applies this method to MEG data. My understanding is that the only difference I would make when applying this approach to EEG is that, instead of the command vol = prepare_singleshell(cfg, segmentedmriF); which implements Nolte’s approach for MEG data, I need to make a BEM model for EEG data and I thought that I could use an example Matlab script (2) “Create BEM headmodel for EEG” from the Fieldtrip site. This would give me a vol variable which I then use to calculate the grid variable using [grid] = prepare_leadfield(cfg); and the rest is the same as in tutorial (1). Q1. Is it a correct sequence of steps to do source reconstruction for EEG data in Fieldtrip or do I need to do something more different? Q2. My second question is about the function strel_bol() which I am not familiar with (it is used in script (2)). One can see from the script that it is a structural element function used in the Image Processing toolbox but this toolbox has only function strel(). Could you please explain what the strel_bol(5) is? Can it be replaced by something like strel('disk',5)? Your help is very much appreciated! Thank you, Andrei. Andrei Medvedev, PhD Assistant Professor, EEG and Optical Imaging Lab Center for Functional and Molecular Imaging Georgetown University Washington DC, 20057 From mark.drakesmith at POSTGRAD.MANCHESTER.AC.UK Thu Jul 9 16:29:41 2009 From: mark.drakesmith at POSTGRAD.MANCHESTER.AC.UK (Mark Drakesmith) Date: Thu, 9 Jul 2009 15:29:41 +0100 Subject: beamformer source localization for EEG In-Reply-To: <20090708224339.AEY51491@mstore-prod-1.pdc.uis.georgetown.edu> Message-ID: Hi. I ran into the same problem with strel_bol when trying to create a BEM model. It relies on a custom script which implements the strel command in the image processing toolbox. The script can be found in the message archives here: https://listserv.surfnet.nl/scripts/wa.exe?A2=ind0703&L=FIELDTRIP&P=R14835&D=0 Regards, Mark -- Mark Drakesmith PhD Student Neuroscience and Aphasia Research Unit (NARU) University of Manchester Andrei Medvedev wrote: > Dear Fieldtrip developers/users > > I am a relatively recent user of Fieldtrip (and very much appreciative of this software). Having good experience with the analysis of brain oscillations etc, I now want to proceed with source reconstruction and it appeared that I need some help with the beamformer technique for EEG data. I am trying to use it for EEG data collected with a 128-channel EGI system. I also have structural MRI data for my subjects and would like to use realistic head models etc. I was following the Fieldtrip tutorial (1) “Localizing oscillatory sources using beamformer techniques”, which applies this method to MEG data. My understanding is that the only difference I would make when applying this approach to EEG is that, instead of the command > > vol = prepare_singleshell(cfg, segmentedmriF); > > which implements Nolte’s approach for MEG data, I need to make a BEM model for EEG data and I thought that I could use an example Matlab script (2) “Create BEM headmodel for EEG” from the Fieldtrip site. This would give me a vol variable which I then use to calculate the grid variable using > > [grid] = prepare_leadfield(cfg); > > and the rest is the same as in tutorial (1). > > Q1. Is it a correct sequence of steps to do source reconstruction for EEG data in Fieldtrip or do I need to do something more different? > > Q2. My second question is about the function strel_bol() which I am not familiar with (it is used in script (2)). One can see from the script that it is a structural element function used in the Image Processing toolbox but this toolbox has only function strel(). Could you please explain what the strel_bol(5) is? Can it be replaced by something like strel('disk',5)? > > Your help is very much appreciated! > > Thank you, > > Andrei. > > Andrei Medvedev, PhD > Assistant Professor, > EEG and Optical Imaging Lab > Center for Functional and Molecular Imaging > Georgetown University > Washington DC, 20057 > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Thu Jul 9 20:26:58 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Thu, 9 Jul 2009 20:26:58 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. Message-ID: Dear all, An update on my progress reading .fif mri's with fieldtrip (using the mne toolbox). I'm happy to announce it worked! Thanks to Roberts new script and Jan-Mathijs' suggestion to swap the x and y coordinates of the vol.bnd.pnt variable. I used the realignment to mni template which can be found in one of the example scripts (I think that is a creation of Ingrids) and found out that also the x and y coordinates of the normalized-to-mni mri should be swapped. My batch script can now be found at: http://fieldtrip.fcdonders.nl/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space I hope that helps more neuromag-meg-people! Thanks for your help! Yours, Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen Gesendet: Mi 08.07.2009 10:22 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, Please note that the X and Y axis in the neuromag head-coordinate system are swapped with respect to the CTF and 4D convention; i.e. X axis through the ears, and Y-axis to the nose. What usually works for me is discarding the mri.transform (mri = rmfield(mri, 'transform'), and call volumerealign in the interactive mode. You can then specify the location of the fiducials yourself and the output mri of the function will contain a transformation matrix according to ctf convention. This at least ensures that volumesegment etc kind of work properly. Yet, it is important to know that of course the gradiometer positions in the data are defined in neuromag convention, so after preparing your volume conduction model you probably have to swap the x and y coordinates of the vol.bnd.pnt (assuming you use a singleshell as volume conductor model), before proceeding to visualization (headmodelplot; just to check whether the head fits in the helmet), leadfield computation (only makes sense if the head fits in the helmet), and sourceanalysis (idem). Yours, JM On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > Hi Hanneke, > > I have tried importing another MRI fif file which I still had on > disk using the following modification of the fieldtrip/fileio/ > read_mri.m code > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %%%%%%%%%%%%%% > elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') > % use the mne functions to read the Neuromag MRI > hdr = fiff_read_mri(filename); > img = cat(3, hdr.slices.data); > hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data > to save memory > transform = hdr.trans.trans; > > and then slightly further down in the code > > % set up the axes of the volume in voxel coordinates > nx = size(img,1); > ny = size(img,2); > nz = size(img,3); > mri.dim = [nx ny nz]; > % store the anatomical data > mri.anatomy = img; > % store the header with all fileformat specific details > mri.hdr = hdr; > try > % if present, store the homogenous transformation matrix > mri.transform = transform; > end > > This results in a warning of the MNE fiff_read_mri function > > >> mri = read_mri('lp_mri_headcoords.fif') > Reading slice information and pixel data..50..100..126..[done] > The slices are not equally spaced. Voxel transformation will not > be included > > mri = > dim: [256 256 126] > anatomy: [256x256x126 int16] > hdr: [1x1 struct] > transform: [4x4 double] > > and the resulting coordinate transformation matrix is not fully > correct. You can check the coordinates by plotting it intreactively > in sourceplot (after converting the image data from int16 into > double). > > Perhaps one of the Neuromag experts on the list can help you further. > > best regards, > Robert > > PS atatched is the latest read_mri function, which includes the > call to fiff_read_mri. > > > On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> The mri.fif file that you sent only contains the header >> information, but not the slice/image information. >> >> >> fiff_read_mri('mri.fif') >> Reading slice information and pixel data.??? Error using ==> >> fiff_read_mri at 116 >> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >> >> Please also send the corresponding slice data. >> >> Robert >> >> >> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >> >>> Hi Robert, >>> >>> Thanks for your reply. I have tried the meg_pd function loadmri >>> (via read_mri in fieldtrip) but I got the feedback: 'error >>> loading mri-file'. So I have no idea what is going wrong. I will >>> send you the example mri-file right now. It is probably not to >>> difficult to work something out but I want to be sure that the >>> mri head coordinates end up in the right way as device coordinates. >>> >>> Thanks in advance! >>> Viele Gruße aus Düsseldorf ;-) >>> >>> Hanneke >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Fri Jul 10 14:13:06 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 10 Jul 2009 14:13:06 +0200 Subject: beamformer source localization for EEG In-Reply-To: <20090708224339.AEY51491@mstore-prod-1.pdc.uis.georgetown.edu> Message-ID: On 9 Jul 2009, at 4:43, Andrei Medvedev wrote: > Q1. Is it a correct sequence of steps to do source reconstruction > for EEG data in Fieldtrip or do I need to do something more different? Hi Andrei You'll also have to ensure that the EEG data that you are analyzing is average referenced over all electrodes that you intend to use during source reconstruction. The averager referencing should be done prior to freqanalysis. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 10 16:08:37 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Fri, 10 Jul 2009 16:08:37 +0200 Subject: sourceinterpolation coordinates. Message-ID: Dear all, I have entered the next step: sourceanalysis. But I have encountered another problem, I think in sourceinterpolation or maybe volumenormalise. After running the script as I have described before (to make the headmodel and the grid) I do the following; load f %load frequency data cfg = []; cfg.grid = grid; cfg.frequency = 10; cfg.vol = hdm; cfg.grad = f.grad; cfg.projectnoise = 'yes'; cfg.lambda = 5e-28; cfg.method = 'dics'; cfg.feedback = 'textbar'; source = sourceanalysis(cfg,f); then: sd = sourcedescriptives([],source); then: load norm %normalized to MNI brain of single subject sdint = sourceinterpolate([], sd , norm); clear norm %plotting the results cfg.funparameter = 'avg.nai'; cfg.anaparameter = 'anatomy'; cfg.funcolormap = 'jet'; cfg.method = 'ortho'; cfg.projmethod = 'nearest'; cfg.sphereradius = 20; cfg.surffile = 'surface_l4_both'; figure; sourceplot(cfg,sdint) The result is attached to this email, the gird seems to have moved upwards and somewhat to the front relative to the normalised mri. But it seems to have the right size. I have been playing around with sourceunits mriunits x-y coordinates but nothing helps, or it makes it even worse. Does anybody have an idea what's happening? Yours, Hanneke www.linkedin.com/in/hannekevandijk tel. +49 (0)211 81 13074 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 10 16:23:32 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke van Dijk) Date: Fri, 10 Jul 2009 16:23:32 +0200 Subject: sourceinterpolation coordinates. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F3486@Mail2-UKD.VMED.UKD> Message-ID: Now there is an attachment too! sorry On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > Dear all, > > I have entered the next step: sourceanalysis. But I have encountered > another problem, I think in sourceinterpolation or maybe volumenormalise. > > After running the script as I have described before (to make the headmodel > and the grid) I do the following; > > load f %load frequency data > cfg = []; > cfg.grid = grid; > cfg.frequency = 10; > cfg.vol = hdm; > cfg.grad = f.grad; > cfg.projectnoise = 'yes'; > cfg.lambda = 5e-28; > cfg.method = 'dics'; > cfg.feedback = 'textbar'; > > source = sourceanalysis(cfg,f); > > then: > > sd = sourcedescriptives([],source); > > then: > > load norm %normalized to MNI brain of single subject > sdint = sourceinterpolate([], sd , norm); > clear norm > %plotting the results > cfg.funparameter = 'avg.nai'; > cfg.anaparameter = 'anatomy'; > cfg.funcolormap = 'jet'; > cfg.method = 'ortho'; > cfg.projmethod = 'nearest'; > cfg.sphereradius = 20; > cfg.surffile = 'surface_l4_both'; > figure; > sourceplot(cfg,sdint) > > The result is attached to this email, the gird seems to have moved upwards > and somewhat to the front relative to the normalised mri. But it seems to > have the right size. I have been playing around with sourceunits mriunits > x-y coordinates but nothing helps, or it makes it even worse. > > Does anybody have an idea what's happening? > > Yours, > Hanneke > > www.linkedin.com/in/hannekevandijk > tel. +49 (0)211 81 13074 > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source.jpg Type: image/jpeg Size: 21500 bytes Desc: not available URL: From chintan_student at YAHOO.CO.IN Sat Jul 11 00:33:12 2009 From: chintan_student at YAHOO.CO.IN (shah chintan) Date: Sat, 11 Jul 2009 04:03:12 +0530 Subject: time frequency analysis In-Reply-To: <20358EAF-D21B-4F0C-AF51-6CD647ABF0A1@fcdonders.ru.nl> Message-ID: HI,   I have very simple problem. Actually I got time frequency data in excel sheet.  Its a data of 81 channels.   Now how can I plot the graphs and load the data in fieldtrip.  The final result I want is to plot the data on scalp.    Thanking you   Chintan Looking for local information? Find it on Yahoo! Local http://in.local.yahoo.com/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.m.bartlett at GMAIL.COM Sat Jul 11 01:09:07 2009 From: adrian.m.bartlett at GMAIL.COM (Adrian Bartlett) Date: Fri, 10 Jul 2009 19:09:07 -0400 Subject: time frequency analysis In-Reply-To: <335136.49897.qm@web95411.mail.in2.yahoo.com> Message-ID: Chintan: To read in your data to MATLAB from an excel spread sheet; you'll need to use the xlsread function. The rest should follow from the basic tutorial on the site. Hope that helps. On Fri, Jul 10, 2009 at 6:33 PM, shah chintan wrote: > HI, > > I have very simple problem. Actually I got time frequency data in excel > sheet. Its a data of 81 channels. Now how can I plot the graphs and load > the data in fieldtrip. The final result I want is to plot the data on > scalp. > > Thanking you > > Chintan > > ------------------------------ > Love Cricket? Check out live scores, photos, video highlights and more. Click > here . > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > -- Adrian M. Bartlett, BA Neuroscience Graduate Diploma Program Graduate Program in Psychology Perception & Plasticity Laboratory Centre for Vision Research York University, Toronto, ON, Canada -- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Mon Jul 13 10:42:02 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 13 Jul 2009 09:42:02 +0100 Subject: sourceinterpolation coordinates. In-Reply-To: Message-ID: Hi Hanneke, This looks like a difference in origin to me. Note that the MNI coordinate system has the cardinal axes pointing in the same directions as the neuromag headcoordinate system, but that the origin is different. The origin of the NM-headcoordinate system is on the interauricular line, the point where the y-axis hits it. This is approximately somewhere close or in the pons. The MNI origin is the AC, which is somewhere 'higher' in the volume. I suspect that the preparation of the grids did not work out without flaws. Alternatively, which I think is the most likely explanation, is that you should use the MNI-template as an MRI for the interpolation, rather than a normalized single subject MRI. I don't know about the single subject MRIs, but at least the MNI-template is explicitly in MNI-space, whereas the normalized MRI could be in head-space. This could explain the shift. Anyway, if the latter hunch is the explanation, then the sourceanalysis results might be trusted, if the first hunch was the one, the sourceanalysis results are most certainly wrong. As a matter of fact the whole swapping around with coordinates should not be necessary if the basic fieldtrip-code is adjusted such that it can handle neuromag-based headcoordinate systems in an appropriate way. This relates to an earlier remark on the list, which rightfully states that the approach you (we) have been taken so far seems a bit tedious. Ideally, in other words, the middle man has to be taken out, which in this case is the intermediate transformation to a ctf-based coordinate system. Hope this helps, JM Quoting Hanneke van Dijk : > Now there is an attachment too! sorry > > On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < > Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > >> Dear all, >> >> I have entered the next step: sourceanalysis. But I have encountered >> another problem, I think in sourceinterpolation or maybe volumenormalise. >> >> After running the script as I have described before (to make the headmodel >> and the grid) I do the following; >> >> load f %load frequency data >> cfg = []; >> cfg.grid = grid; >> cfg.frequency = 10; >> cfg.vol = hdm; >> cfg.grad = f.grad; >> cfg.projectnoise = 'yes'; >> cfg.lambda = 5e-28; >> cfg.method = 'dics'; >> cfg.feedback = 'textbar'; >> >> source = sourceanalysis(cfg,f); >> >> then: >> >> sd = sourcedescriptives([],source); >> >> then: >> >> load norm %normalized to MNI brain of single subject >> sdint = sourceinterpolate([], sd , norm); >> clear norm >> %plotting the results >> cfg.funparameter = 'avg.nai'; >> cfg.anaparameter = 'anatomy'; >> cfg.funcolormap = 'jet'; >> cfg.method = 'ortho'; >> cfg.projmethod = 'nearest'; >> cfg.sphereradius = 20; >> cfg.surffile = 'surface_l4_both'; >> figure; >> sourceplot(cfg,sdint) >> >> The result is attached to this email, the gird seems to have moved upwards >> and somewhat to the front relative to the normalised mri. But it seems to >> have the right size. I have been playing around with sourceunits mriunits >> x-y coordinates but nothing helps, or it makes it even worse. >> >> Does anybody have an idea what's happening? >> >> Yours, >> Hanneke >> >> www.linkedin.com/in/hannekevandijk >> tel. +49 (0)211 81 13074 >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ------------------------------------------------------------------ The University of Glasgow, Department of Psychology WebMail system ------------------------------------------------------------------ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From chintan_student at YAHOO.CO.IN Mon Jul 13 16:25:50 2009 From: chintan_student at YAHOO.CO.IN (shah chintan) Date: Mon, 13 Jul 2009 19:55:50 +0530 Subject: time frequency analysis. Message-ID: Hi,   I am not a regular user of fieldtrip.  I have a very simple problem to solve.  I have got a data of time frequency analysis in excel data.  Now my goal is to plot the 3d figure on scalp with this data.  Now I know the following steps to be done.   1.  As I got the data in excel sheet,  I need to load this excel data in matlab along with their channel names.  Given the range on both the axis.   2.  Now I need to load the channel locations   3.  Finally I need to tell matlab to plot this data on 3d scalp using those channel locations.   Now Please help me with this.   Best Regards,   Chintan   Yahoo! recommends that you upgrade to the new and safer Internet Explorer 8. http://downloads.yahoo.com/in/internetexplorer/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Thu Jul 16 16:21:55 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Thu, 16 Jul 2009 16:21:55 +0200 Subject: AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. Message-ID: Hi Jan-Mathijs, Thanks for your suggestions and your time, but I haven't been able to fix it.... I agree that this work-around shouldn't be neccesary but I guess we first have to know what to fix.... You suggested to use the template_mri in MNI coordinates to interpolate to that seemed simple so I tried it immediately, however it didn't help. It didn't change a thing. So your other suggestion about the origin being different should be looked at, but this raised a few questions.. First, I thought because I had realigned the mri to ctf coordinates using volumerealign, the NM coordinates wouldn't matter anymore. Second, the headmodel I have created using the realigned, segmented and flipped mri looks very good to me relative to the gradiometer locations and the grid as well. (see http://fieldtrip.fcdonders.nl/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space). Additionally, the alpha source that I found using this headmodel and looking at the grid only (without the interpolation) looked believable as well. I have also segmentated the volumenormalised mri, which actually makes the later produced single_shell headmodel go downward and posterior as well. While the grid stays the same and 'goodlooking' ;-). So I am inclined to think that something strange is happening during the volumenormalise or sourceinterpolation procedure moving the mri slightly downward and more posterior. I would fix it myself but I don't know where I should look... it also puzzles me why this only happens 'for from NM- to ctf coordinates realigned' mri's. It seems that fieldtrip remembers that the mri was originally a NM... Hope you or someone else can help me further... Groetjes Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen Gesendet: Mo 13.07.2009 10:42 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. Hi Hanneke, This looks like a difference in origin to me. Note that the MNI coordinate system has the cardinal axes pointing in the same directions as the neuromag headcoordinate system, but that the origin is different. The origin of the NM-headcoordinate system is on the interauricular line, the point where the y-axis hits it. This is approximately somewhere close or in the pons. The MNI origin is the AC, which is somewhere 'higher' in the volume. I suspect that the preparation of the grids did not work out without flaws. Alternatively, which I think is the most likely explanation, is that you should use the MNI-template as an MRI for the interpolation, rather than a normalized single subject MRI. I don't know about the single subject MRIs, but at least the MNI-template is explicitly in MNI-space, whereas the normalized MRI could be in head-space. This could explain the shift. Anyway, if the latter hunch is the explanation, then the sourceanalysis results might be trusted, if the first hunch was the one, the sourceanalysis results are most certainly wrong. As a matter of fact the whole swapping around with coordinates should not be necessary if the basic fieldtrip-code is adjusted such that it can handle neuromag-based headcoordinate systems in an appropriate way. This relates to an earlier remark on the list, which rightfully states that the approach you (we) have been taken so far seems a bit tedious. Ideally, in other words, the middle man has to be taken out, which in this case is the intermediate transformation to a ctf-based coordinate system. Hope this helps, JM Quoting Hanneke van Dijk : > Now there is an attachment too! sorry > > On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < > Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > >> Dear all, >> >> I have entered the next step: sourceanalysis. But I have encountered >> another problem, I think in sourceinterpolation or maybe volumenormalise. >> >> After running the script as I have described before (to make the headmodel >> and the grid) I do the following; >> >> load f %load frequency data >> cfg = []; >> cfg.grid = grid; >> cfg.frequency = 10; >> cfg.vol = hdm; >> cfg.grad = f.grad; >> cfg.projectnoise = 'yes'; >> cfg.lambda = 5e-28; >> cfg.method = 'dics'; >> cfg.feedback = 'textbar'; >> >> source = sourceanalysis(cfg,f); >> >> then: >> >> sd = sourcedescriptives([],source); >> >> then: >> >> load norm %normalized to MNI brain of single subject >> sdint = sourceinterpolate([], sd , norm); >> clear norm >> %plotting the results >> cfg.funparameter = 'avg.nai'; >> cfg.anaparameter = 'anatomy'; >> cfg.funcolormap = 'jet'; >> cfg.method = 'ortho'; >> cfg.projmethod = 'nearest'; >> cfg.sphereradius = 20; >> cfg.surffile = 'surface_l4_both'; >> figure; >> sourceplot(cfg,sdint) >> >> The result is attached to this email, the gird seems to have moved upwards >> and somewhat to the front relative to the normalised mri. But it seems to >> have the right size. I have been playing around with sourceunits mriunits >> x-y coordinates but nothing helps, or it makes it even worse. >> >> Does anybody have an idea what's happening? >> >> Yours, >> Hanneke >> >> www.linkedin.com/in/hannekevandijk >> tel. +49 (0)211 81 13074 >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ------------------------------------------------------------------ The University of Glasgow, Department of Psychology WebMail system ------------------------------------------------------------------ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jul 16 17:04:14 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 16 Jul 2009 16:04:14 +0100 Subject: AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F3490@Mail2-UKD.VMED.UKD> Message-ID: Hi Hanneke, source.pos should contain the MNI-based coordinates before calling sourceinterpolate; I suspect that your single subject source data contains the original (neuromag-space) positions. This is of course how it should be for the sourceanalysis, because there the grid points have to be defined in neuromag space. Yet, for the interpolation this is wrong, because sourceinterpolate assumes that the coordinate frames of both mri and functional volume are the same. Because the neuromag coordinates are shifted with respect to the MNI- coordinates, this still could explain the discrepancy. I suggest to replace sd.pos with template_grid.pos before calling sourceinterpolate. Best, Jan-Mathijs On Jul 16, 2009, at 3:21 PM, Hanneke Van Dijk wrote: > Hi Jan-Mathijs, > > Thanks for your suggestions and your time, but I haven't been able > to fix it.... > > I agree that this work-around shouldn't be neccesary but I guess we > first have to know what to fix.... > > You suggested to use the template_mri in MNI coordinates to > interpolate to that seemed simple so I tried it immediately, > however it didn't help. It didn't change a thing. > > So your other suggestion about the origin being different should be > looked at, but this raised a few questions.. > First, I thought because I had realigned the mri to ctf coordinates > using volumerealign, the NM coordinates wouldn't matter anymore. > Second, the headmodel I have created using the realigned, segmented > and flipped mri looks very good to me relative to the gradiometer > locations and the grid as well. > (see http://fieldtrip.fcdonders.nl/example/ > read_neuromag_mri_and_create_single- > subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_spa > ce). Additionally, the alpha source that I found using this > headmodel and looking at the grid only (without the interpolation) > looked believable as well. > > I have also segmentated the volumenormalised mri, which actually > makes the later produced single_shell headmodel go downward and > posterior as well. While the grid stays the same and > 'goodlooking' ;-). > So I am inclined to think that something strange is happening > during the volumenormalise or sourceinterpolation procedure moving > the mri slightly downward and more posterior. I would fix it myself > but I don't know where I should look... it also puzzles me why this > only happens 'for from NM- to ctf coordinates realigned' mri's. It > seems that fieldtrip remembers that the mri was originally a NM... > > Hope you or someone else can help me further... > > Groetjes Hanneke > > > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen > Gesendet: Mo 13.07.2009 10:42 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. > > Hi Hanneke, > > This looks like a difference in origin to me. Note that the MNI > coordinate system has the cardinal axes pointing in the same > directions as the neuromag headcoordinate system, but that the origin > is different. The origin of the NM-headcoordinate system is on the > interauricular line, the point where the y-axis hits it. This is > approximately somewhere close or in the pons. The MNI origin is the > AC, which is somewhere 'higher' in the volume. I suspect that the > preparation of the grids did not work out without flaws. > Alternatively, which I think is the most likely explanation, is that > you should use the MNI-template as an MRI for the interpolation, > rather than a normalized single subject MRI. I don't know about the > single subject MRIs, but at least the MNI-template is explicitly in > MNI-space, whereas the normalized MRI could be in head-space. This > could explain the shift. > Anyway, if the latter hunch is the explanation, then the > sourceanalysis results might be trusted, if the first hunch was the > one, the sourceanalysis results are most certainly wrong. > > As a matter of fact the whole swapping around with coordinates should > not be necessary if the basic fieldtrip-code is adjusted such that it > can handle neuromag-based headcoordinate systems in an appropriate > way. This relates to an earlier remark on the list, which rightfully > states that the approach you (we) have been taken so far seems a bit > tedious. Ideally, in other words, the middle man has to be taken out, > which in this case is the intermediate transformation to a ctf-based > coordinate system. > > Hope this helps, > > JM > > > Quoting Hanneke van Dijk : > >> Now there is an attachment too! sorry >> >> On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < >> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >> >>> Dear all, >>> >>> I have entered the next step: sourceanalysis. But I have encountered >>> another problem, I think in sourceinterpolation or maybe >>> volumenormalise. >>> >>> After running the script as I have described before (to make the >>> headmodel >>> and the grid) I do the following; >>> >>> load f %load frequency data >>> cfg = []; >>> cfg.grid = grid; >>> cfg.frequency = 10; >>> cfg.vol = hdm; >>> cfg.grad = f.grad; >>> cfg.projectnoise = 'yes'; >>> cfg.lambda = 5e-28; >>> cfg.method = 'dics'; >>> cfg.feedback = 'textbar'; >>> >>> source = sourceanalysis(cfg,f); >>> >>> then: >>> >>> sd = sourcedescriptives([],source); >>> >>> then: >>> >>> load norm %normalized to MNI brain of single subject >>> sdint = sourceinterpolate([], sd , norm); >>> clear norm >>> %plotting the results >>> cfg.funparameter = 'avg.nai'; >>> cfg.anaparameter = 'anatomy'; >>> cfg.funcolormap = 'jet'; >>> cfg.method = 'ortho'; >>> cfg.projmethod = 'nearest'; >>> cfg.sphereradius = 20; >>> cfg.surffile = 'surface_l4_both'; >>> figure; >>> sourceplot(cfg,sdint) >>> >>> The result is attached to this email, the gird seems to have >>> moved upwards >>> and somewhat to the front relative to the normalised mri. But it >>> seems to >>> have the right size. I have been playing around with sourceunits >>> mriunits >>> x-y coordinates but nothing helps, or it makes it even worse. >>> >>> Does anybody have an idea what's happening? >>> >>> Yours, >>> Hanneke >>> >>> www.linkedin.com/in/hannekevandijk >>> tel. +49 (0)211 81 13074 >>> >>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of the >>> FieldTrip toolbox, to share experiences and to discuss new ideas >>> for MEG >>> and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>> http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > > > ------------------------------------------------------------------ > The University of Glasgow, Department of Psychology WebMail system > ------------------------------------------------------------------ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jrkerlin at UCDAVIS.EDU Thu Jul 16 19:57:58 2009 From: jrkerlin at UCDAVIS.EDU (Jess R. Kerlin) Date: Thu, 16 Jul 2009 10:57:58 -0700 Subject: beamformer source localization for EEG In-Reply-To: <20358EAF-D21B-4F0C-AF51-6CD647ABF0A1@fcdonders.ru.nl> Message-ID: Hi FTers, I'm using a 128 electrode Biosemi EEG system, attempting to perform beam-former source analysis. I had go all the way back to Matlab 6.5 and SPM 2, as well as some trial and error to get through it, but I finally managed to get a nolte BEM using mostly the same code as in the example script "BEM head model for EEG" script". However, prepare_leadfield throws the error "unsupported volume conductor model for EEG", which is clearly the case looking at the prepare_leadfield code. A few questions on this topic: Does fieldtrip actually support beamforming source localization on BEM models for EEG? Or, given the coarser spatial resolution of EEG, is it better to use a simpler spherical model? Either way, does anyone have successful sample code for beamformer localization EEG data, start to finish? And for the developers: I love your work. I notice the move from SPM 2 to SPM 8 is in the development cue. Is there any release coming soon which will use SPM 8 to make this process smoother? Many thanks, Jess Kerlin Robert Oostenveld wrote: > On 9 Jul 2009, at 4:43, Andrei Medvedev wrote: >> Q1. Is it a correct sequence of steps to do source reconstruction for >> EEG data in Fieldtrip or do I need to do something more different? > > Hi Andrei > > You'll also have to ensure that the EEG data that you are analyzing is > average referenced over all electrodes that you intend to use during > source reconstruction. The averager referencing should be done prior > to freqanalysis. > > best regards, > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From v.litvak at ION.UCL.AC.UK Thu Jul 16 20:37:40 2009 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Thu, 16 Jul 2009 19:37:40 +0100 Subject: beamformer source localization for EEG In-Reply-To: <4A5F6A26.9060404@ucdavis.edu> Message-ID: Dear Jess and others, SPM8 and Fieldtrip share infrastructure for forward modelling and leadfield computation. Therefore, you can use SPM8 to prepare head model and sensor definition that you can later use for FT beamforming. This works for both EEG and MEG. MEEGTools toolbox in SPM8 contains some functions that you can use as examples for where to find vol and sens in SPM8 dataset. You'll need to go through SPM8 processing stream (at least with some sample data). Look at the manual for additional instructions. Best, Vladimir On Thu, Jul 16, 2009 at 6:57 PM, Jess R. Kerlin wrote: > Hi FTers, > > I'm using a 128 electrode Biosemi EEG system, attempting to perform > beam-former source analysis. I had go all the way back to Matlab 6.5 and SPM > 2, as well as some trial and error to get through it,  but I finally managed > to get a nolte BEM  using mostly the same code as in the example script "BEM > head model for EEG" script". However, prepare_leadfield throws the error > "unsupported volume conductor model for EEG", which is clearly the case > looking at the prepare_leadfield code. > > A few questions on this topic: > > Does fieldtrip actually support beamforming source localization on BEM > models for EEG? Or, given the coarser spatial resolution of EEG, is it > better to use a simpler spherical model?  Either way, does anyone have > successful sample code for beamformer localization EEG data, start to > finish? > > And for the developers: > I love your work. > I notice the move from SPM 2 to SPM 8 is in the development cue.  Is there > any release coming soon which will use SPM 8 to make this process smoother? > > Many thanks, > > Jess Kerlin > > Robert Oostenveld wrote: >> >> On 9 Jul 2009, at 4:43, Andrei Medvedev wrote: >>> >>> Q1. Is it a correct sequence of steps to do source reconstruction for EEG >>> data in Fieldtrip or do I need to do something more different? >> >> Hi Andrei >> >> You'll also have to ensure that the EEG data that you are analyzing is >> average referenced over all electrodes that you intend to use during source >> reconstruction. The averager referencing should be done prior to >> freqanalysis. >> >> best regards, >> Robert >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From hungptit at GMAIL.COM Fri Jul 17 07:09:56 2009 From: hungptit at GMAIL.COM (Hung Dang) Date: Thu, 16 Jul 2009 23:09:56 -0600 Subject: beamformer source localization for EEG In-Reply-To: Message-ID: Dear all, We have known that beamformers and other good source localization techniques have zero localization error for single source. However, in real applications there are many sources inside the brain then we will have non-zero localization error. How can we justify which inverse solutions is better? Thanks a lot Hung ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 17 08:50:31 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Fri, 17 Jul 2009 08:50:31 +0200 Subject: AW: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. Message-ID: Dear Jan-Matijs, It worked!!! Thanks so much! We should think of a way to fix the differences between handeling CTF and NM data. I will have a look at it! Yours, Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen Gesendet: Do 16.07.2009 17:04 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. Hi Hanneke, source.pos should contain the MNI-based coordinates before calling sourceinterpolate; I suspect that your single subject source data contains the original (neuromag-space) positions. This is of course how it should be for the sourceanalysis, because there the grid points have to be defined in neuromag space. Yet, for the interpolation this is wrong, because sourceinterpolate assumes that the coordinate frames of both mri and functional volume are the same. Because the neuromag coordinates are shifted with respect to the MNI- coordinates, this still could explain the discrepancy. I suggest to replace sd.pos with template_grid.pos before calling sourceinterpolate. Best, Jan-Mathijs On Jul 16, 2009, at 3:21 PM, Hanneke Van Dijk wrote: > Hi Jan-Mathijs, > > Thanks for your suggestions and your time, but I haven't been able > to fix it.... > > I agree that this work-around shouldn't be neccesary but I guess we > first have to know what to fix.... > > You suggested to use the template_mri in MNI coordinates to > interpolate to that seemed simple so I tried it immediately, > however it didn't help. It didn't change a thing. > > So your other suggestion about the origin being different should be > looked at, but this raised a few questions.. > First, I thought because I had realigned the mri to ctf coordinates > using volumerealign, the NM coordinates wouldn't matter anymore. > Second, the headmodel I have created using the realigned, segmented > and flipped mri looks very good to me relative to the gradiometer > locations and the grid as well. > (see http://fieldtrip.fcdonders.nl/example/ > read_neuromag_mri_and_create_single- > subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_spa > ce). Additionally, the alpha source that I found using this > headmodel and looking at the grid only (without the interpolation) > looked believable as well. > > I have also segmentated the volumenormalised mri, which actually > makes the later produced single_shell headmodel go downward and > posterior as well. While the grid stays the same and > 'goodlooking' ;-). > So I am inclined to think that something strange is happening > during the volumenormalise or sourceinterpolation procedure moving > the mri slightly downward and more posterior. I would fix it myself > but I don't know where I should look... it also puzzles me why this > only happens 'for from NM- to ctf coordinates realigned' mri's. It > seems that fieldtrip remembers that the mri was originally a NM... > > Hope you or someone else can help me further... > > Groetjes Hanneke > > > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen > Gesendet: Mo 13.07.2009 10:42 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. > > Hi Hanneke, > > This looks like a difference in origin to me. Note that the MNI > coordinate system has the cardinal axes pointing in the same > directions as the neuromag headcoordinate system, but that the origin > is different. The origin of the NM-headcoordinate system is on the > interauricular line, the point where the y-axis hits it. This is > approximately somewhere close or in the pons. The MNI origin is the > AC, which is somewhere 'higher' in the volume. I suspect that the > preparation of the grids did not work out without flaws. > Alternatively, which I think is the most likely explanation, is that > you should use the MNI-template as an MRI for the interpolation, > rather than a normalized single subject MRI. I don't know about the > single subject MRIs, but at least the MNI-template is explicitly in > MNI-space, whereas the normalized MRI could be in head-space. This > could explain the shift. > Anyway, if the latter hunch is the explanation, then the > sourceanalysis results might be trusted, if the first hunch was the > one, the sourceanalysis results are most certainly wrong. > > As a matter of fact the whole swapping around with coordinates should > not be necessary if the basic fieldtrip-code is adjusted such that it > can handle neuromag-based headcoordinate systems in an appropriate > way. This relates to an earlier remark on the list, which rightfully > states that the approach you (we) have been taken so far seems a bit > tedious. Ideally, in other words, the middle man has to be taken out, > which in this case is the intermediate transformation to a ctf-based > coordinate system. > > Hope this helps, > > JM > > > Quoting Hanneke van Dijk : > >> Now there is an attachment too! sorry >> >> On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < >> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >> >>> Dear all, >>> >>> I have entered the next step: sourceanalysis. But I have encountered >>> another problem, I think in sourceinterpolation or maybe >>> volumenormalise. >>> >>> After running the script as I have described before (to make the >>> headmodel >>> and the grid) I do the following; >>> >>> load f %load frequency data >>> cfg = []; >>> cfg.grid = grid; >>> cfg.frequency = 10; >>> cfg.vol = hdm; >>> cfg.grad = f.grad; >>> cfg.projectnoise = 'yes'; >>> cfg.lambda = 5e-28; >>> cfg.method = 'dics'; >>> cfg.feedback = 'textbar'; >>> >>> source = sourceanalysis(cfg,f); >>> >>> then: >>> >>> sd = sourcedescriptives([],source); >>> >>> then: >>> >>> load norm %normalized to MNI brain of single subject >>> sdint = sourceinterpolate([], sd , norm); >>> clear norm >>> %plotting the results >>> cfg.funparameter = 'avg.nai'; >>> cfg.anaparameter = 'anatomy'; >>> cfg.funcolormap = 'jet'; >>> cfg.method = 'ortho'; >>> cfg.projmethod = 'nearest'; >>> cfg.sphereradius = 20; >>> cfg.surffile = 'surface_l4_both'; >>> figure; >>> sourceplot(cfg,sdint) >>> >>> The result is attached to this email, the gird seems to have >>> moved upwards >>> and somewhat to the front relative to the normalised mri. But it >>> seems to >>> have the right size. I have been playing around with sourceunits >>> mriunits >>> x-y coordinates but nothing helps, or it makes it even worse. >>> >>> Does anybody have an idea what's happening? >>> >>> Yours, >>> Hanneke >>> >>> www.linkedin.com/in/hannekevandijk >>> tel. +49 (0)211 81 13074 >>> >>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of the >>> FieldTrip toolbox, to share experiences and to discuss new ideas >>> for MEG >>> and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>> http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > > > ------------------------------------------------------------------ > The University of Glasgow, Department of Psychology WebMail system > ------------------------------------------------------------------ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jul 17 09:57:24 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 17 Jul 2009 08:57:24 +0100 Subject: AW: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F3491@Mail2-UKD.VMED.UKD> Message-ID: Dear Hanneke, I am glad it worked out fine now. Note that the particular step which was bugging you is the same for both CTF and neuromag data. Best, JM On Jul 17, 2009, at 7:50 AM, Hanneke Van Dijk wrote: > Dear Jan-Matijs, > > It worked!!! Thanks so much! We should think of a way to fix the > differences between handeling CTF and NM data. I will have a look > at it! > > Yours, > > Hanneke > > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen > Gesendet: Do 16.07.2009 17:04 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise > sourceinterpolation coordinates. > > Hi Hanneke, > > source.pos should contain the MNI-based coordinates before calling > sourceinterpolate; I suspect that your single subject source data > contains the original (neuromag-space) positions. This is of course > how it should be for the sourceanalysis, because there the grid > points have to be defined in neuromag space. Yet, for the > interpolation this is wrong, because sourceinterpolate assumes that > the coordinate frames of both mri and functional volume are the same. > Because the neuromag coordinates are shifted with respect to the MNI- > coordinates, this still could explain the discrepancy. I suggest to > replace sd.pos with template_grid.pos before calling > sourceinterpolate. > > Best, > > Jan-Mathijs > > On Jul 16, 2009, at 3:21 PM, Hanneke Van Dijk wrote: > >> Hi Jan-Mathijs, >> >> Thanks for your suggestions and your time, but I haven't been able >> to fix it.... >> >> I agree that this work-around shouldn't be neccesary but I guess we >> first have to know what to fix.... >> >> You suggested to use the template_mri in MNI coordinates to >> interpolate to that seemed simple so I tried it immediately, >> however it didn't help. It didn't change a thing. >> >> So your other suggestion about the origin being different should be >> looked at, but this raised a few questions.. >> First, I thought because I had realigned the mri to ctf coordinates >> using volumerealign, the NM coordinates wouldn't matter anymore. >> Second, the headmodel I have created using the realigned, segmented >> and flipped mri looks very good to me relative to the gradiometer >> locations and the grid as well. >> (see http://fieldtrip.fcdonders.nl/example/ >> read_neuromag_mri_and_create_single- >> subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_sp >> a >> ce). Additionally, the alpha source that I found using this >> headmodel and looking at the grid only (without the interpolation) >> looked believable as well. >> >> I have also segmentated the volumenormalised mri, which actually >> makes the later produced single_shell headmodel go downward and >> posterior as well. While the grid stays the same and >> 'goodlooking' ;-). >> So I am inclined to think that something strange is happening >> during the volumenormalise or sourceinterpolation procedure moving >> the mri slightly downward and more posterior. I would fix it myself >> but I don't know where I should look... it also puzzles me why this >> only happens 'for from NM- to ctf coordinates realigned' mri's. It >> seems that fieldtrip remembers that the mri was originally a NM... >> >> Hope you or someone else can help me further... >> >> Groetjes Hanneke >> >> >> -----Ursprüngliche Nachricht----- >> Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen >> Gesendet: Mo 13.07.2009 10:42 >> An: FIELDTRIP at NIC.SURFNET.NL >> Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. >> >> Hi Hanneke, >> >> This looks like a difference in origin to me. Note that the MNI >> coordinate system has the cardinal axes pointing in the same >> directions as the neuromag headcoordinate system, but that the origin >> is different. The origin of the NM-headcoordinate system is on the >> interauricular line, the point where the y-axis hits it. This is >> approximately somewhere close or in the pons. The MNI origin is the >> AC, which is somewhere 'higher' in the volume. I suspect that the >> preparation of the grids did not work out without flaws. >> Alternatively, which I think is the most likely explanation, is that >> you should use the MNI-template as an MRI for the interpolation, >> rather than a normalized single subject MRI. I don't know about the >> single subject MRIs, but at least the MNI-template is explicitly in >> MNI-space, whereas the normalized MRI could be in head-space. This >> could explain the shift. >> Anyway, if the latter hunch is the explanation, then the >> sourceanalysis results might be trusted, if the first hunch was the >> one, the sourceanalysis results are most certainly wrong. >> >> As a matter of fact the whole swapping around with coordinates should >> not be necessary if the basic fieldtrip-code is adjusted such that it >> can handle neuromag-based headcoordinate systems in an appropriate >> way. This relates to an earlier remark on the list, which rightfully >> states that the approach you (we) have been taken so far seems a bit >> tedious. Ideally, in other words, the middle man has to be taken out, >> which in this case is the intermediate transformation to a ctf-based >> coordinate system. >> >> Hope this helps, >> >> JM >> >> >> Quoting Hanneke van Dijk : >> >>> Now there is an attachment too! sorry >>> >>> On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < >>> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >>> >>>> Dear all, >>>> >>>> I have entered the next step: sourceanalysis. But I have >>>> encountered >>>> another problem, I think in sourceinterpolation or maybe >>>> volumenormalise. >>>> >>>> After running the script as I have described before (to make the >>>> headmodel >>>> and the grid) I do the following; >>>> >>>> load f %load frequency data >>>> cfg = []; >>>> cfg.grid = grid; >>>> cfg.frequency = 10; >>>> cfg.vol = hdm; >>>> cfg.grad = f.grad; >>>> cfg.projectnoise = 'yes'; >>>> cfg.lambda = 5e-28; >>>> cfg.method = 'dics'; >>>> cfg.feedback = 'textbar'; >>>> >>>> source = sourceanalysis(cfg,f); >>>> >>>> then: >>>> >>>> sd = sourcedescriptives([],source); >>>> >>>> then: >>>> >>>> load norm %normalized to MNI brain of single subject >>>> sdint = sourceinterpolate([], sd , norm); >>>> clear norm >>>> %plotting the results >>>> cfg.funparameter = 'avg.nai'; >>>> cfg.anaparameter = 'anatomy'; >>>> cfg.funcolormap = 'jet'; >>>> cfg.method = 'ortho'; >>>> cfg.projmethod = 'nearest'; >>>> cfg.sphereradius = 20; >>>> cfg.surffile = 'surface_l4_both'; >>>> figure; >>>> sourceplot(cfg,sdint) >>>> >>>> The result is attached to this email, the gird seems to have >>>> moved upwards >>>> and somewhat to the front relative to the normalised mri. But it >>>> seems to >>>> have the right size. I have been playing around with sourceunits >>>> mriunits >>>> x-y coordinates but nothing helps, or it makes it even worse. >>>> >>>> Does anybody have an idea what's happening? >>>> >>>> Yours, >>>> Hanneke >>>> >>>> www.linkedin.com/in/hannekevandijk >>>> tel. +49 (0)211 81 13074 >>>> >>>> >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between >>>> users of the >>>> FieldTrip toolbox, to share experiences and to discuss new ideas >>>> for MEG >>>> and EEG analysis. See also >>>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>>> http://www.ru.nl/neuroimaging/fieldtrip. >>>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>> http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> >> >> ------------------------------------------------------------------ >> The University of Glasgow, Department of Psychology WebMail system >> ------------------------------------------------------------------ >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From hungptit at GMAIL.COM Fri Jul 17 17:56:41 2009 From: hungptit at GMAIL.COM (Hung - Gmail) Date: Fri, 17 Jul 2009 09:56:41 -0600 Subject: beamformer source localization for EEG In-Reply-To: Message-ID: Dear all, We have known that beamformers and other good source localization techniques have zero localization error for single source cases. However, in real applications there are many sources inside the brain then we will have non-zero localization error. How can we justify which inverse solutions is better for multiple source cases? Thanks a lot Hung ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From bleichner.martin at GMAIL.COM Fri Jul 24 11:14:08 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Fri, 24 Jul 2009 11:14:08 +0200 Subject: Common Average reference - excluding channels Message-ID: Hello together, I want to compute the common average reference for an ecog dataset. But I have to exlude some of the channels due to epileptic activity. I am currenlty using the code below. Do I have to specify the channels I would like to include in my CAR in cfg.channels or in cfg.refchannel? Thanks a lot Martin cfg=[]; cfg.trackconfig='cleanup'; %compute common average reference cfg.channels=ch_in_avref; cfg.reref='yes'; cfg.refchannel='all'; %filter out the line noise using bandstop filter cfg.bsfilter='yes'; cfg.bsfiltord=3; cfg.bsfreq=[49.5 50.5; 99.5, 100.5]; data=preprocessing(cfg,data); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bleichner.martin at GMAIL.COM Fri Jul 24 15:14:30 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Fri, 24 Jul 2009 15:14:30 +0200 Subject: Postdoc in BCI signal processing Message-ID: *Postdoc in BCI signal processing* The Rudolf Magnus Institute in Utrecht, The Netherlands is looking for a highly motivated postdoc interested in neural signal processing for Brain Computer Interfacing. The Utrecht BCI group, led by Prof. dr. Nick Ramsey, is part of the Department of Neurology and Neurosurgery at the University Medical Center Utrecht and participates in the nationwide BrainGain Consortium, which is devoted to application of Brain Computer Interfaces for patients and healthy individuals. The main focus of the group is conducting neuroscience research towards an invasive BCI application for paralyzed patients. We perform experiments with both healthy subjects and patients (~10 patients with electrode implants available for research each year). Available techniques: 128-channel EEG systems for extracranial and intracranial (ECoG) recordings, fMRI (1.5, 3 and 7 T human Philips systems), TMS and 64-channel intraoperative recordings in awake neurosurgery. Our highly interdisciplinary group consists of 4 postdocs, 10 PhD students and 6 master students, who have a background in neuroscience, psychology, biology or physics and their own expertise in the research field. The postdoc is expected to investigate new ECoG signal processing techniques for BCI purposes, as well as for cognitive neuroscience research. He/she will work in close collaboration with neuroscientists and needs to have excellent communication skills. The candidate is likely to have a PhD in biomedical engineering, computational neuroscience, electrical engineering or physics, with a record of publications. Solid experience in signal processing of any kind and excellent programming skills in Matlab are required. Experience in neuroscience is not a prerequisite, but we expect the candidate to acquire knowledge of underlying psychological and biological processes. Earliest starting date of the two-year position is July 1st, 2009. Application deadline is September 1st, 2009. Applications and information requests can be sent to Prof. dr. Nick Ramsey, Rudolf Magnus Institute of Neuroscience, Dept. of Neurology and Neurosurgery, Division of Neuroscience, University Medical Center Utrecht, Room G.03.122, Heidelberglaan 100, 3584 CX, Utrecht, Netherlands, n.f.ramsey at umcutrecht.nl. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From akiko at NYU.EDU Wed Jul 29 00:56:37 2009 From: akiko at NYU.EDU (Akiko Ikkai) Date: Wed, 29 Jul 2009 00:56:37 +0200 Subject: prepare_layout #input? Message-ID: Hi, I'm new to Fieldtrip, and am using fieldtrip-20090715 version. I'm making .lay file for our intracranial EEG data, and realized that prepare_layout.m requires 6 entries (chNum,X,Y,Width,Height,Lbl,Rem), whereas on the website ( http://fieldtrip.fcdonders.nl/tutorial/layout ) it says, "The 1st column is the channel number in the layout file, it is not used any more.". prepare_layout.m runs when I add chNum to my .lay, OR change line 743 of prepare_layout.m to [X,Y,Width,Height,Lbl,Rem] = textread(filename,'%f %f %f %f %q %q'); For the future reference, I'm wondering which is more recent way to write .lay files.... with, or without chNum? Thanks in advance! Akiko Akiko Ikkai PhD Candidate Department of Psychology New York University 6 Washington Place New York NY, 10003 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ingrid.nieuwenhuis at DONDERS.RU.NL Wed Jul 29 10:28:38 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Wed, 29 Jul 2009 10:28:38 +0200 Subject: prepare_layout #input? In-Reply-To: Message-ID: Dear Akiko, You're right that it is a bit confusing the way it is stated right now at the wiki. What is meant is that the first column is not used any more during the plotting by the plotting functions. But all FieldTrip functions do expect that that there is a first column present in the layout file containing the channel number. So when you are making a .lay file you should indeed add that column (although what is in there is totally ignored by the plotting functions). So the six columns in the layout file should be: chNum, X, Y, Width, Height, Lbl. I've modified the wiki, hope it is clearer now. All the best, Ingrid ___________________________________ Ingrid Nieuwenhuis PhD student Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging Radboud University Nijmegen, The Netherlands Email: ingrid.nieuwenhuis at donders.ru.nl Tel: 0031 (0)24 - 36 10887 > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Akiko Ikkai > Sent: Wednesday, July 29, 2009 12:57 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] prepare_layout #input? > > Hi, > > I'm new to Fieldtrip, and am using fieldtrip-20090715 version. > > I'm making .lay file for our intracranial EEG data, and realized that > prepare_layout.m requires 6 entries (chNum,X,Y,Width,Height,Lbl,Rem), > whereas on the website ( http://fieldtrip.fcdonders.nl/tutorial/layout ) > it > says, "The 1st column is the channel number in the layout file, it is not > used any more.". prepare_layout.m runs when I add chNum to my .lay, OR > change line 743 of prepare_layout.m to [X,Y,Width,Height,Lbl,Rem] = > textread(filename,'%f %f %f %f %q %q'); > > For the future reference, I'm wondering which is more recent way to write > .lay files.... with, or without chNum? > > Thanks in advance! Akiko > > Akiko Ikkai > PhD Candidate > Department of Psychology > New York University > 6 Washington Place > New York NY, 10003 > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:05:44 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:05:44 +0200 Subject: prepare_layout #input? In-Reply-To: Message-ID: Dear Akiko The ascii layout file has some limitations w.r.t. the layouts that you can make, especially in case of ECoG data. We are using prepare_layout to construct individual ECoG layouts based on a photo that was made during the surgery. I have just updated the documentation at http://fieldtrip.fcdonders.nl/tutorial/layout and http://fieldtrip.fcdonders.nl/faq/what_is_the_format_of_the_layout_file_which_is_used_for_plotting to better reflect the advanced options for making ECog layouts. Please have a look at the layout tutorial with the ECoG example, which includes details and screenshots. best regards, Robert ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen ----------------------------------------------------------- On 29 Jul 2009, at 0:56, Akiko Ikkai wrote: > Hi, > > I'm new to Fieldtrip, and am using fieldtrip-20090715 version. > > I'm making .lay file for our intracranial EEG data, and realized that > prepare_layout.m requires 6 entries (chNum,X,Y,Width,Height,Lbl,Rem), > whereas on the website ( http://fieldtrip.fcdonders.nl/tutorial/ > layout ) it > says, "The 1st column is the channel number in the layout file, it > is not > used any more.". prepare_layout.m runs when I add chNum to my .lay, OR > change line 743 of prepare_layout.m to [X,Y,Width,Height,Lbl,Rem] = > textread(filename,'%f %f %f %f %q %q'); > > For the future reference, I'm wondering which is more recent way to > write > .lay files.... with, or without chNum? > > Thanks in advance! Akiko > > Akiko Ikkai > PhD Candidate > Department of Psychology > New York University > 6 Washington Place > New York NY, 10003 > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:12:12 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:12:12 +0200 Subject: Common Average reference - excluding channels In-Reply-To: Message-ID: Hi Martin On 24 Jul 2009, at 11:14, Martin Bleichner wrote: > I want to compute the common average reference for an ecog dataset. > But I have to exlude some of the channels due to epileptic activity. > I am currenlty using the code below. Do I have to specify the > channels I would like to include in my CAR in cfg.channels or in > cfg.refchannel? You would specify the channels that you want to average over in cfg.refchannel. The average of those channels will subsequently be subtracted from cfg.channel (which defines the channels on which the preprocessing function works). So cfg.channel = {'EEG1020', 'M1', 'M2'} cfg.refchannel = {'M1', 'M2'} would result in a linked ears reference, and cfg.channel = 'EEG1020' cfg.refchannel = 'EEG1020' would result in an average over all EEG1020 channels. Note that the channels to which you want to reference should be included in cfg.channel. For EEG data files the reference channel usually is not included in the file (because it is zero anyway). If the reference used during recording is a mastoid, and you want to refer to both mastoids, you can add the implicit reference as all zeros and define its name with the cfg.implicitref option. The documentation at http://fieldtrip.fcdonders.nl/example/re-referencing and http://fieldtrip.fcdonders.nl/tutorial/continuous contains more examples for rereferencing. best regards, Robert ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen ----------------------------------------------------------- > > Thanks a lot > Martin > > cfg=[]; > cfg.trackconfig='cleanup'; > > %compute common average reference > cfg.channels=ch_in_avref; > cfg.reref='yes'; > cfg.refchannel='all'; > > %filter out the line noise using bandstop filter > cfg.bsfilter='yes'; > cfg.bsfiltord=3; > cfg.bsfreq=[49.5 50.5; 99.5, 100.5]; > > > data=preprocessing(cfg,data); > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:17:29 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:17:29 +0200 Subject: beamformer source localization for EEG In-Reply-To: <4A609F39.60801@gmail.com> Message-ID: Dear Hung The differences between source reconstruction methods, or inverse methods, are in the assumptions that they make on the sources. Some make assumptions on the number of sources (dipole fitting), distribution of activity (minimum norm linear estimation) and some make assumptions on the correlatedness of the timecourses of the sources (beamforming or music). A difference is also in wether and how the noise in the data is incorporated in the estimate of the source acitivity (ignored in plain old dipole fitting, explicitely suppressed in beamforming). The method that works the best is the method whose assumptions on the data (true sources and noise) best corresponds to the data that you have acquired. best regards, Robert On 17 Jul 2009, at 17:56, Hung - Gmail wrote: > Dear all, > We have known that beamformers and other good source localization > techniques have zero localization error for single source cases. > However, in > real applications there are many sources inside the brain then we will > have non-zero localization error. How can we justify which inverse > solutions is better for multiple source cases? > > Thanks a lot > Hung > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:32:11 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:32:11 +0200 Subject: beamformer source localization for EEG In-Reply-To: <4A5F6A26.9060404@ucdavis.edu> Message-ID: Hi Jess, On 16 Jul 2009, at 19:57, Jess R. Kerlin wrote: > I'm using a 128 electrode Biosemi EEG system, attempting to perform > beam-former source analysis. I had go all the way back to Matlab 6.5 > and SPM 2, as well as some trial and error to get through it, but I > finally managed to get a nolte BEM using mostly the same code as in > the example script "BEM head model for EEG" script". However, > prepare_leadfield throws the error "unsupported volume conductor > model for EEG", which is clearly the case looking at the > prepare_leadfield code. The "nolte" model is a single shell realistic model for MEG. It is based on the boundary of the inside of the skull, but is not a BEM model and it is not for EEG. See http://fieldtrip.fcdonders.nl/references_to_implemented_methods and search for Nolte. The boundary element method can be used for EEG volume conduction, using the prepare_bemmodel function. > A few questions on this topic: > > Does fieldtrip actually support beamforming source localization on > BEM models for EEG? Yes, see Schneider TR, Debener S, Oostenveld R, Engel AK, Enhanced EEG gamma-band activity reflects multisensory semantic matching in visual- to-auditory object priming. Neuroimage. 2008 Sep 1;42(3):1244-54 > Or, given the coarser spatial resolution of EEG, is it better to use > a simpler spherical model? The beamformer method is rather sensitive to volume conductor misspecifications. So for a simple dipole fit a concentric spehrical model might be enough, but for beamforming I would recommend to use a BEM model. > Either way, does anyone have successful sample code for beamformer > localization EEG data, start to finish? you can get a template BEM volume conduction model from ftp.fcdonders.nl/pub/fieldtrip/standard_BEM.zip . The geometry is based on the canonical MNI template ("collin27") and it is defined in MNI coordinates (consistent with SPM). > And for the developers: > I love your work. thanks > I notice the move from SPM 2 to SPM 8 is in the development cue. Is > there any release coming soon which will use SPM 8 to make this > process smoother? SPM2 is not supported any more in recent matlab versions, so we have a compatibility problem one way or the other. Fieldtrip does not use that many functions from spm, but some of them are not compatible between spm2 and spm5/spm8. The idea is first to make a fieldtrip/ external/spm2 folder with a subset of the old spm2 functions in it that is enough to keep it running. Those spm2 functions then have to be fixed for compatibility with the most recent matlab (simple: replace finite with "isfinite"). Subsequently, the difference between those functions in their spm2 and spm8 incarnation has to be determined and fieldtrip should be fixed to reflect these differences. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From megjim1 at GMAIL.COM Wed Jul 29 18:10:44 2009 From: megjim1 at GMAIL.COM (Jim Li) Date: Wed, 29 Jul 2009 18:10:44 +0200 Subject: color bar not agreeing with data Message-ID: Dear Fieldtripper: I am puzzled by the output from "multiplotTFR". The colorbar doesn't look right at all! Can anyone help me? Basicly I have a data structure caled "TF" that's calculated from FREQANALYSIS. I ran the following script and got a plot (see attachment) ----------------------------- >> cfg = []; cfg.layout = '4D248.lay'; cfg.interactive = 'yes'; cfg.showlabels = 'yes'; cfg.colorbar = 'yes'; cfg.renderer= 'zbuffer' figure; multiplotTFR(cfg,TF); cfg = layout: '4D248.lay' interactive: 'yes' showlabels: 'yes' colorbar: 'yes' renderer: 'zbuffer' the input is freq data with 248 channels, 141 frequencybins and 77 timebins reading layout from file 4D248.lay >> ------------------------------ Now, when running " max(max(max(max(TF.powspctrm(:,:,:,:)))))" I got : ------------- ans = 2.287227537931770e-023 -------------- This is order of magnitude larger than the colorbar maximum, which is 1.82e- 24 (see attachment) . Why should this discrepency happen? Why the data maximum is not plotted? The same happened to the minimum: when running "min(min(min(min (TF.powspctrm(:,:,:,:)))))" I got 5.393784644607502e-034, which is about 8 orders of magnitude smaller than the colorbar minimum (2.12e-26 according to the attached figure). This I can understand since small numbers should be sacrificed to save bandwidth for more significant numbers. BTW I tried "singleplotTFR" and got the same discrepency between data maximum and plot/colorbar maximum for a channel. They differ by about an order of magnitude, which is huge! FYI, I was working directly before my PC, not through VNC or Remote Desktop connection. Thanks a lot, Jim ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: OutputFigure.TIF Type: image/tiff Size: 94342 bytes Desc: not available URL: From saskia.haegens at DONDERS.RU.NL Wed Jul 29 18:55:48 2009 From: saskia.haegens at DONDERS.RU.NL (Saskia Haegens) Date: Wed, 29 Jul 2009 18:55:48 +0200 Subject: color bar not agreeing with data In-Reply-To: Message-ID: Hi Jim, Does your data contain a repetition dimension (i.e. did you run freqanalysis with cfg.keeptrials='yes')? In that case, when you don't specify which trials to plot, the plotting functions such as multiplotTFR will plot the average over all trials. This could explain the discrepancy you describe. Best, Saskia > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Jim Li > Sent: 29 July 2009 18:11 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] color bar not agreeing with data > > Dear Fieldtripper: > > I am puzzled by the output from "multiplotTFR". The colorbar doesn't look > right > at all! Can anyone help me? > > Basicly I have a data structure caled "TF" that's calculated from > FREQANALYSIS. I ran the following script and got a plot (see attachment) > > ----------------------------- > >> cfg = []; cfg.layout = '4D248.lay'; cfg.interactive = > 'yes'; > cfg.showlabels = 'yes'; > cfg.colorbar = 'yes'; cfg.renderer= 'zbuffer' > figure; > multiplotTFR(cfg,TF); > > cfg = > > layout: '4D248.lay' > interactive: 'yes' > showlabels: 'yes' > colorbar: 'yes' > renderer: 'zbuffer' > > the input is freq data with 248 channels, 141 frequencybins and 77 > timebins > reading layout from file 4D248.lay > >> > ------------------------------ > > Now, when running " max(max(max(max(TF.powspctrm(:,:,:,:)))))" I got : > > ------------- > ans = > > 2.287227537931770e-023 > -------------- > > This is order of magnitude larger than the colorbar maximum, which is > 1.82e- > 24 (see attachment) . Why should this discrepency happen? Why the data > maximum is not plotted? > > > The same happened to the minimum: when running "min(min(min(min > (TF.powspctrm(:,:,:,:)))))" I got 5.393784644607502e-034, which is about > 8 > orders of magnitude smaller than the colorbar minimum (2.12e-26 according > to > the attached figure). This I can understand since small numbers should be > sacrificed to save bandwidth for more significant numbers. > > > BTW I tried "singleplotTFR" and got the same discrepency between data > maximum and plot/colorbar maximum for a channel. They differ by about an > order of magnitude, which is huge! > > FYI, I was working directly before my PC, not through VNC or Remote > Desktop connection. > > Thanks a lot, > > Jim > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From megjim1 at GMAIL.COM Thu Jul 30 01:31:40 2009 From: megjim1 at GMAIL.COM (Jim Li) Date: Thu, 30 Jul 2009 01:31:40 +0200 Subject: color bar not agreeing with data Message-ID: Hi Saskia, You're right on the point! Thanks a lot for your help, :) Jim On Wed, 29 Jul 2009 18:55:48 +0200, Saskia Haegens wrote: >Hi Jim, > >Does your data contain a repetition dimension (i.e. did you run freqanalysis >with cfg.keeptrials='yes')? In that case, when you don't specify which >trials to plot, the plotting functions such as multiplotTFR will plot the >average over all trials. This could explain the discrepancy you describe. > >Best, >Saskia > >> -----Original Message----- >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >> Behalf Of Jim Li >> Sent: 29 July 2009 18:11 >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: [FIELDTRIP] color bar not agreeing with data >> >> Dear Fieldtripper: >> >> I am puzzled by the output from "multiplotTFR". The colorbar doesn't look >> right >> at all! Can anyone help me? >> >> Basicly I have a data structure caled "TF" that's calculated from >> FREQANALYSIS. I ran the following script and got a plot (see attachment) >> >> ----------------------------- >> >> cfg = []; cfg.layout = '4D248.lay'; cfg.interactive = >> 'yes'; >> cfg.showlabels = 'yes'; >> cfg.colorbar = 'yes'; cfg.renderer= 'zbuffer' >> figure; >> multiplotTFR(cfg,TF); >> >> cfg = >> >> layout: '4D248.lay' >> interactive: 'yes' >> showlabels: 'yes' >> colorbar: 'yes' >> renderer: 'zbuffer' >> >> the input is freq data with 248 channels, 141 frequencybins and 77 >> timebins >> reading layout from file 4D248.lay >> >> >> ------------------------------ >> >> Now, when running " max(max(max(max(TF.powspctrm(:,:,:,:)))))" I got : >> >> ------------- >> ans = >> >> 2.287227537931770e-023 >> -------------- >> >> This is order of magnitude larger than the colorbar maximum, which is >> 1.82e- >> 24 (see attachment) . Why should this discrepency happen? Why the data >> maximum is not plotted? >> >> >> The same happened to the minimum: when running "min(min(min(min >> (TF.powspctrm(:,:,:,:)))))" I got 5.393784644607502e-034, which is about >> 8 >> orders of magnitude smaller than the colorbar minimum (2.12e-26 according >> to >> the attached figure). This I can understand since small numbers should be >> sacrificed to save bandwidth for more significant numbers. >> >> >> BTW I tried "singleplotTFR" and got the same discrepency between data >> maximum and plot/colorbar maximum for a channel. They differ by about an >> order of magnitude, which is huge! >> >> FYI, I was working directly before my PC, not through VNC or Remote >> Desktop connection. >> >> Thanks a lot, >> >> Jim >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. > >---------------------------------- >The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From vvw at CALTECH.EDU Thu Jul 30 10:39:55 2009 From: vvw at CALTECH.EDU (Virginie van Wassenhove) Date: Thu, 30 Jul 2009 10:39:55 +0200 Subject: ECG artifact with MEG data Message-ID: Hi everyone, I am testing the ECG artifact removal using the ICA method described here: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts At the stage where freqanalysis is to be computed on the components comp_ecg, I encounter this error, anyone else has experienced such issue? the input is component data with 204 components and 204 original channels ??? Error using ==> checkdata at 388 This function requires raw data as input. Error in ==> freqanalysis at 165 data = checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset', 'yes'); Thanks in advance, Virginie ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ingrid.nieuwenhuis at DONDERS.RU.NL Thu Jul 30 21:52:47 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 30 Jul 2009 21:52:47 +0200 Subject: ECG artifact with MEG data In-Reply-To: Message-ID: Dear Virginie, You're problem was caused by a too strict check of the input data by checkdata. This function only allowed raw data as input, but it also works on component data. I've fixed the bug and the ftp fieldtrip version of tomorrow should not give the problem. You can also fix the problem yourself by changing line 165 in freqanalysis into data = checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hasoffset', 'yes'); Best Ingrid ___________________________________ Ingrid Nieuwenhuis PhD student Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging Radboud University Nijmegen, The Netherlands Email: ingrid.nieuwenhuis at donders.ru.nl Tel: 0031 (0)24 - 36 10887 > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Virginie van Wassenhove > Sent: Thursday, July 30, 2009 10:40 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] ECG artifact with MEG data > > Hi everyone, > > I am testing the ECG artifact removal using the ICA method described here: > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i > ca_to_remove_ecg_artifacts > > At the stage where freqanalysis is to be computed on the components > comp_ecg, I encounter this error, anyone else has experienced such issue? > > the input is component data with 204 components and 204 original channels > ??? Error using ==> checkdata at 388 > This function requires raw data as input. > > Error in ==> freqanalysis at 165 > data = checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset', > 'yes'); > > Thanks in advance, > Virginie > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From christine.gruetzner at GOOGLEMAIL.COM Wed Jul 1 17:19:29 2009 From: christine.gruetzner at GOOGLEMAIL.COM (Christine Gruetzner) Date: Wed, 1 Jul 2009 17:19:29 +0200 Subject: Beamforming - filter dimensions Message-ID: Dear All, I'm using LCMV beamforming and I have a question regarding the dimensions of the filter. We have two different configurations for LCMV (see below) that result in one-dimensional filters (in the first case) and three-dimensional filters (in the second case). It seems that the only difference between the two configurations is the option cfg.projectmom = 'yes' (in the first configuration) vs. cfg.projectmom = 'no' (in the second configuration). Do you have any idea what makes the difference and why I only get one-dimensional filters in the first configuration? Which would be the correct options to use? Best Christine %------------------------------------------------------------------ configuration 1: cfg = []; % replaced by: fullnameGrid = strcat(mripath, DesignLCMVSources{i,2}); cfg = load(fullnameGrid); cfg.vol = cfg.hdm; %General source computation parameters cfg.method = 'lcmv'; cfg.lambda = 0.05; % regularization of 0.5% cfg.powmethod = 'trace'; % compute rms power per dipolelocation over all available directions cfg.feedback = 'text'; % give feedback on the progress of the calculations cfg.keepfilter = 'yes'; % keep the beamformer filters (virtual electrodes) for later use % % cfg.singletrial = 'yes'; cfg.keepmom = 'yes'; cfg.projectmom = 'yes'; cfg.keeptrial = 'yes'; InFilename = strcat(datapath, DesignLCMVSources{i,1}); load(InFilename); % a variable named TLDataOut must exist in the InFile DataLCMVIn = TLDataOutNew; clear TLDataOutNew; % for clarity of code remove if too slow cfg.cov = DataLCMVIn.cov; DataLCMVOut = sourceanalysis(cfg, DataLCMVIn); %---------------------------------------------------------------------------------------- configuration 2: cfgLCMV=[]; % cfgLCMV.frequency = ... % the bandwidth in LCMV comptations is % chosen in preprocessing (aka FreqLimits) cfgLCMV.grid=ForwardModel.grid; cfgLCMV.vol=ForwardModel.hdm; cfgLCMV.method='lcmv'; % cfgLCMV.projectnoise='yes'; % ??? cfgLCMV.keepfilter='yes'; cfgLCMV.lambda = DICSlambda ; % use the same as for DICS here cfgLCMV.powmethod = 'trace'; cfgLCMV.fixedori = 'no'; cfgLCMV.projectnoise = 'no'; % these filters are for computing virtual electrodes later cfgLCMV.projectmom = 'no'; % computation cfgLCMV.dim=[Nx Ny Nz] disp('running LCMV source analysis for common filters/virtual electrodes') CommonLCMVSources=sourceanalysis(cfgLCMV,CombiTimelockCov) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From fredericroux at HOTMAIL.DE Wed Jul 1 21:07:17 2009 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Wed, 1 Jul 2009 21:07:17 +0200 Subject: Beamforming - filter dimensions Message-ID: Hi Christine, I am wondering if this problem could result from the fact that the grids and headmodels were computed in a different way for each analysis. In your code it says: %for config 1 fullnameGrid = strcat(mripath, DesignLCMVSources{i,2}); cfg = load(fullnameGrid); cfg.vol = cfg.hdm; %for config 2 cfgLCMV.grid=ForwardModel.grid; cfgLCMV.vol=ForwardModel.hdm; Cheers, frederic _________________________________________________________________ http://redirect.gimas.net/?n=M0906xWLHM2 Unbegrenzter Speicher bei Windows Live Hotmail! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredericroux at HOTMAIL.DE Wed Jul 1 21:36:15 2009 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Wed, 1 Jul 2009 21:36:15 +0200 Subject: Beamforming - filter dimensions Message-ID: I found the origin of the difference. You have to specify the option: cfg.dim = [Nx Ny Nz] Otherwise your filters will have only one dimension. _________________________________________________________________ http://redirect.gimas.net/?n=M0906xWLHM2 Unbegrenzter Speicher bei Windows Live Hotmail! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From charles.cook at ULETH.CA Thu Jul 2 02:54:59 2009 From: charles.cook at ULETH.CA (Charles Cook) Date: Thu, 2 Jul 2009 02:54:59 +0200 Subject: Update: Freqstatistics Now Yields (Som e) Significant Clusters Message-ID: Hi Michael, We are interested in determining just that, the presence of spatially and temporally contiguous effects that cross a certain threshold between my two groups (males vs. females) and within them (task 1 vs. task 2). After fully completing the analysis, I was able to find significant clusters in my within groups analysis (e.g. TF differences in male participants, task 1 vs. task 2, using dependent t-test) within a few discrete frequency bands. What we're now interested in doing is beamforming those discrete windows and frequencies that we have found with the cluster analysis in FieldTrip. Is this a feasible approach with the BESA exported TFC files? We had considered exporting VMP files from BESA and beamforming using Brain Voyager but thought that it might be simpler to do this all within FieldTrip. Cheers, Charles On Thu, 25 Jun 2009 12:00:31 +0200, Michael Wibral wrote: >Hi Charles, > >thanks for the update. Cluster based statistics is exactly what the name says: A statistics telling you whether you have spatially and temporally contiguous effects that cross a certain threshold - in sum over the cluster. It is sometimes worth considering, whether this is what you want to test after all. e.g. extended effects of small effect size per electrode but large time/frequency extent and effects of large effect size but small time/frequency extent may have similar cluster statistics. The even compete in the sense that randomizations of the larger of the two (in total cluster sum) may still have larger cluster statistics than the smaller of the two, thus effectively rendering in non-significant. Bear in mind that the only thing really tested is the exchangeability of the data (which is the null hypothesis). That may sometimes make your results more difficult to interpret. You could also try cfg.correctm = 'fdr', to get classical FDR correction, but you may loose sensitivity in some cases. > >One last thing: Check carefully that there is no factor that has been balanced over subjects (e.g. response hand) that may be resorted in the randomizations. For example: half of the subjects report match with the right hand and non-match with the left hand, the other half responding with an inverted assignment. This analysis setup: >1. violates the exchangeability hypothesis from the start (and you know!), but not in the way you wanted to test it - this is a serious error in applying randomization testing... >2. Consequently, it renders all other effects insignificant because the sorted response hand effects in the randomizations most likely exceed any other effect in the unrandomized data. > > >Michael ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Thu Jul 2 11:50:33 2009 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Thu, 2 Jul 2009 11:50:33 +0200 Subject: Update: Freqstatistics Now Yields (Som e) Significant Clusters Message-ID: Hi Charles, beamforming relies on the data (sensor) covariance matrix for the case of LCMV and other time domain beamformers and you get the focus on the desired frequency band by prefiltering For frequency domain beamforming - like DICS - computations rely on the cross spectral density matrix - again computed at the frequencies of interest. I do not think that BESA TFC files contain that information. That said, you can - depending on your Version of BESA and the modules included - use BESA's own beamformer (which allows for two bilateral synchronized sources to be present as an extra feature) and export the .dat file for statistics (I haven't done that myself). But using beamforming in Fieldtrip is also straightforward and very flexible. Let me know if you need help with that. Michael > -----Ursprüngliche Nachricht----- > Von: "Charles Cook" > Gesendet: 02.07.09 02:56:36 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Update: Freqstatistics Now Yields (Som e) Significant Clusters > Hi Michael, > > We are interested in determining just that, the presence of spatially and > temporally contiguous effects that cross a certain threshold between my two > groups (males vs. females) and within them (task 1 vs. task 2). After fully > completing the analysis, I was able to find significant clusters in my > within groups analysis (e.g. TF differences in male participants, task 1 vs. > task 2, using dependent t-test) within a few discrete frequency bands. What > we're now interested in doing is beamforming those discrete windows and > frequencies that we have found with the cluster analysis in FieldTrip. Is > this a feasible approach with the BESA exported TFC files? We had considered > exporting VMP files from BESA and beamforming using Brain Voyager but > thought that it might be simpler to do this all within FieldTrip. > > Cheers, > > Charles > > On Thu, 25 Jun 2009 12:00:31 +0200, Michael Wibral > wrote: > > >Hi Charles, > > > >thanks for the update. Cluster based statistics is exactly what the name > says: A statistics telling you whether you have spatially and temporally > contiguous effects that cross a certain threshold - in sum over the cluster. > It is sometimes worth considering, whether this is what you want to test > after all. e.g. extended effects of small effect size per electrode but > large time/frequency extent and effects of large effect size but small > time/frequency extent may have similar cluster statistics. The even compete > in the sense that randomizations of the larger of the two (in total cluster > sum) may still have larger cluster statistics than the smaller of the two, > thus effectively rendering in non-significant. Bear in mind that the only > thing really tested is the exchangeability of the data (which is the null > hypothesis). That may sometimes make your results more difficult to > interpret. You could also try cfg.correctm = 'fdr', to get classical FDR > correction, but you may loose sensitivity in some cases. > > > >One last thing: Check carefully that there is no factor that has been > balanced over subjects (e.g. response hand) that may be resorted in the > randomizations. For example: half of the subjects report match with the > right hand and non-match with the left hand, the other half responding with > an inverted assignment. This analysis setup: > >1. violates the exchangeability hypothesis from the start (and you know!), > but not in the way you wanted to test it - this is a serious error in > applying randomization testing... > >2. Consequently, it renders all other effects insignificant because the > sorted response hand effects in the randomizations most likely exceed any > other effect in the unrandomized data. > > > > > >Michael > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From wibral at BIC.UNI-FRANKFURT.DE Thu Jul 2 12:09:36 2009 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Thu, 2 Jul 2009 12:09:36 +0200 Subject: Beamforming - filter dimensions Message-ID: Dear Christine, dear Frederic, I think Christine's initial guess was right: The option " cfg.projectmom='yes' " seems to not only project the dipole moment timecourse on the direction of maximal power as it says in the beamformer-lcmv function but also compute an effective 1-D filter coefficient for this purpose and export that if you additionally specify cfg.keepfilters='yes'. To explain things in a little more detail: beamformer_lcmv.m could in principle compute 3D (or 2D for MEG) filters, compute the three timecourses, then compute the vector direction with the maximal power and export that power value but still keep all filter coefficients. But what it does (and what I think is more straight forward) is to do this projection by having a effective filter coefficient for that direction. On the other hand, the option cfg.dim = [Nx Ny Nz] is used to give the results of beamforming some regular dimensions when using reverse warped grids for single subjects like Ingrid does. I actually do not know whether the current versions of fieldtrip still need it. It was there to let sourcegrandaverage and sourcestatistics and the source plotting functions know how to handle results over subjects that had different, non-evenly spaced grids in true space but matching grids when transformed to MNI space (see Ingrid's tutorial/wiki page on this at the fieldtrip website . It simply gives the rectangular dimensions of the common grid in MNI space. Michael > -----Ursprüngliche Nachricht----- > Von: "Frederic Roux" > Gesendet: 01.07.09 21:13:25 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Beamforming - filter dimensions Hi Christine, > > I am wondering if this problem could result from the fact that the > grids and headmodels were computed in a different way for each > analysis. > > In your code it says: > > %for config 1 > fullnameGrid = strcat(mripath, DesignLCMVSources{i,2}); > cfg = load(fullnameGrid); > cfg.vol = cfg.hdm; > > %for config 2 > cfgLCMV.grid=ForwardModel.grid; > cfgLCMV.vol=ForwardModel.hdm; > > Cheers, > frederic > > > Kein Werbe-Blabla - hier klicken! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From wibral at BIC.UNI-FRANKFURT.DE Thu Jul 2 12:25:31 2009 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Thu, 2 Jul 2009 12:25:31 +0200 Subject: MEG lunch at HBM2009/minutes Message-ID: Hi Ole, Thanks for putting together the minutes of the HBM meeting and also for the organization of the meeting altogether. Could you also send around the actual name of the yahoo mailing list? That would help many of us to actually subscribe. Michael > -----Ursprüngliche Nachricht----- > Von: "Ole Jensen" > Gesendet: 30.06.09 22:01:05 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: [FIELDTRIP] MEG lunch at HBM2009/minutes > Dear all, > Attached please find the minutes from the MEG lunch at the HBM2009 meeting. > All the best, > Ole > > -- > Ole Jensen > Principal Investigator > Neuronal Oscillations Group > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognitive Neuroimaging > P.O. Box 9101 > NL-6500 HB Nijmegen > The Netherlands > > Office : +31 24 36 10884 > MEG lab : +31 24 36 10988 > > Fax : +31 24 36 10989 > > e-mail : ole.jensen at donders.ru.nl > URL : http://ojensen.ruhosting.nl/ > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From Sara.GonzalezAndino at HCUGE.CH Thu Jul 2 12:57:52 2009 From: Sara.GonzalezAndino at HCUGE.CH (Sara GONZALEZ ANDINO) Date: Thu, 2 Jul 2009 12:57:52 +0200 Subject: Paper Announcement Message-ID: Dear Colleagues, We would like to call your attention to the recent publication: http://www.hindawi.com/journals/cin/2009/659247.html The Neuroelectromagnetic Inverse Problem and the Zero Dipole Localization Error by: Rolando Grave de Peralta, Olaf Hauk and Sara L. Gonzalez Abstract: A tomography of neural sources could be constructed from EEG/MEG recordings once the neuroelectromagnetic inverse problem (NIP) is solved. Unfortunately the NIP lacks a unique solution and therefore additional constraints are needed to achieve uniqueness. Researchers are then confronted with the dilemma of choosing one solution on the basis of the advantages publicized by their authors. This study aims to help researchers to better guide their choices by clarifying what is hidden behind inverse solutions oversold by their apparently optimal properties to localize single sources. Here, we introduce an inverse solution (ANA) attaining perfect localization of single sources to illustrate how spurious sources emerge and destroy the reconstruction of simultaneously active sources. Although ANA is probably the simplest and robust alternative for data generated by a single dominant source plus noise, the main contribution of this manuscript is to show that zero localization error of single sources is a trivial and largely uninformative property unable to predict the performance of an inverse solution in presence of simultaneously active sources. We recommend as the most logical strategy for solving the NIP the incorporation of sound additional a priori information about neural generators that supplements the information contained in the data. best regards rolando www.electrical-neuroimaging.ch ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From bleichner.martin at GMAIL.COM Thu Jul 2 15:39:49 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Thu, 2 Jul 2009 15:39:49 +0200 Subject: frequency resolution of the power spectrum Message-ID: Hi there, this might be a stupid question. I probably miss something obvious. I want to compute the power spectrum over a single trial (around 5 minutes). using this piece of code cfg = []; cfg.method = 'mtmfft'; cfg.output = 'pow'; cfg.foilim = [1 100]; cfg.taper = 'hanning'; freq = freqanalysis(cfg, data); as a result I get freq: [1x62534 double] powspctrm: [96x62534 double] that is a frequency resolution of 0.0032Hz!? What determines the frequency resolution here? What can I do to make it less fine grained? Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.b.dijkman at STUDENT.UTWENTE.NL Thu Jul 2 15:53:44 2009 From: t.b.dijkman at STUDENT.UTWENTE.NL (Thomas Dijkman) Date: Thu, 2 Jul 2009 15:53:44 +0200 Subject: frequency resolution of the power spectrum Message-ID: Hi Martin, The frequency resolution is determined by the length of your trial -> 5 minutes = 300 seconds -> 1/300 = 0.0033 Hz. You have to divide your single trial into smaller fragments and then average the resulting spectra (I believe you can do this directly in Fieldtrip). You could for example use Welch's method. Regards, Thomas -----Oorspronkelijk bericht----- Van: FieldTrip discussion list namens Martin Bleichner Verzonden: do 2-7-2009 15:39 Aan: FIELDTRIP at NIC.SURFNET.NL Onderwerp: [FIELDTRIP] frequency resolution of the power spectrum Hi there, this might be a stupid question. I probably miss something obvious. I want to compute the power spectrum over a single trial (around 5 minutes). using this piece of code cfg = []; cfg.method = 'mtmfft'; cfg.output = 'pow'; cfg.foilim = [1 100]; cfg.taper = 'hanning'; freq = freqanalysis(cfg, data); as a result I get freq: [1x62534 double] powspctrm: [96x62534 double] that is a frequency resolution of 0.0032Hz!? What determines the frequency resolution here? What can I do to make it less fine grained? Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From thomas.hartmann at UNI-KONSTANZ.DE Thu Jul 2 15:59:34 2009 From: thomas.hartmann at UNI-KONSTANZ.DE (Thomas Hartmann) Date: Thu, 2 Jul 2009 15:59:34 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: Message-ID: hi martin, the spectral resolution of a fft is determined by the length of the data used to calculate it. e.g. a length of 1 second would give a frequency-resolution of 1Hz, 2 seconds of data would result in a resolution of 0.5Hz and so on.... what you actually missed is that you dont want to calculate one fft on your 5-minutes trial but rather several ffts on (overlapping) windows of your 5 minutes. to do this, refer to the mail by nathan weisz "re: preprocessing without trigger...". he shows some code there to cut long trials into several short ones. calculate the freqanalysis on these and you will get reasonable results. greez, thomas Martin Bleichner schrieb: > Hi there, > > this might be a stupid question. I probably miss something obvious. > > I want to compute the power spectrum over a single trial (around 5 > minutes). > > using this piece of code > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'pow'; > cfg.foilim = [1 100]; > cfg.taper = 'hanning'; > freq = freqanalysis(cfg, data); > > as a result I get > freq: [1x62534 double] > powspctrm: [96x62534 double] > > that is a frequency resolution of 0.0032Hz!? What determines the > frequency resolution here? What can I do to make it less fine grained? > > Thanks > Martin > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > -- Dipl. Psych. Thomas Hartmann OBOB-Lab University of Konstanz Department of Psychology P.O. Box D25 78457 Konstanz Germany Tel.: +49 (0)7531 88 4612 Fax: +49 (0)7531-88 4601 Email: thomas.hartmann at uni-konstanz.de Homepage: http://www.uni-konstanz.de/obob "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan Doyle) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From bleichner.martin at GMAIL.COM Thu Jul 2 16:04:52 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Thu, 2 Jul 2009 16:04:52 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: <4A4CBD46.3060405@uni-konstanz.de> Message-ID: thanks, I thought there might be an option I could hand over in the cfg. that will work 2009/7/2 Thomas Hartmann > hi martin, > the spectral resolution of a fft is determined by the length of the data > used to calculate it. e.g. a length of 1 second would give a > frequency-resolution of 1Hz, 2 seconds of data would result in a resolution > of 0.5Hz and so on.... > > what you actually missed is that you dont want to calculate one fft on your > 5-minutes trial but rather several ffts on (overlapping) windows of your 5 > minutes. to do this, refer to the mail by nathan weisz "re: preprocessing > without trigger...". he shows some code there to cut long trials into > several short ones. calculate the freqanalysis on these and you will get > reasonable results. > > greez, > thomas > > Martin Bleichner schrieb: > >> Hi there, >> >> this might be a stupid question. I probably miss something obvious. >> >> I want to compute the power spectrum over a single trial (around 5 >> minutes). >> >> using this piece of code >> cfg = []; >> cfg.method = 'mtmfft'; >> cfg.output = 'pow'; >> cfg.foilim = [1 100]; >> cfg.taper = 'hanning'; >> freq = freqanalysis(cfg, data); >> >> as a result I get >> freq: [1x62534 double] >> powspctrm: [96x62534 double] >> >> that is a frequency resolution of 0.0032Hz!? What determines the frequency >> resolution here? What can I do to make it less fine grained? >> >> Thanks >> Martin >> >> >> ---------------------------------- >> >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and >> EEG analysis. >> >> http://listserv.surfnet.nl/archives/fieldtrip.html >> >> http://www.ru.nl/fcdonders/fieldtrip/ >> >> > > -- > Dipl. Psych. Thomas Hartmann > > OBOB-Lab > University of Konstanz > Department of Psychology > P.O. Box D25 > 78457 Konstanz > Germany > > Tel.: +49 (0)7531 88 4612 > Fax: +49 (0)7531-88 4601 > Email: thomas.hartmann at uni-konstanz.de > Homepage: http://www.uni-konstanz.de/obob > > "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan > Doyle) > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingrid.nieuwenhuis at DONDERS.RU.NL Thu Jul 2 16:07:34 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 2 Jul 2009 16:07:34 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: <4A4CBD46.3060405@uni-konstanz.de> Message-ID: Hi > your 5 minutes. to do this, refer to the mail by nathan weisz "re: > preprocessing without trigger...". he shows some code there to cut long > trials into several short ones. Or use statfun_general see reply on that "re: > preprocessing without trigger..." Best Ingrid > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Thomas Hartmann > Sent: Thursday, July 02, 2009 4:00 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] frequency resolution of the power spectrum > > hi martin, > the spectral resolution of a fft is determined by the length of the data > used to calculate it. e.g. a length of 1 second would give a > frequency-resolution of 1Hz, 2 seconds of data would result in a > resolution of 0.5Hz and so on.... > > what you actually missed is that you dont want to calculate one fft on > your 5-minutes trial but rather several ffts on (overlapping) windows of > your 5 minutes. to do this, refer to the mail by nathan weisz "re: > preprocessing without trigger...". he shows some code there to cut long > trials into several short ones. calculate the freqanalysis on these and > you will get reasonable results. > > greez, > thomas > > Martin Bleichner schrieb: > > Hi there, > > > > this might be a stupid question. I probably miss something obvious. > > > > I want to compute the power spectrum over a single trial (around 5 > > minutes). > > > > using this piece of code > > cfg = []; > > cfg.method = 'mtmfft'; > > cfg.output = 'pow'; > > cfg.foilim = [1 100]; > > cfg.taper = 'hanning'; > > freq = freqanalysis(cfg, data); > > > > as a result I get > > freq: [1x62534 double] > > powspctrm: [96x62534 double] > > > > that is a frequency resolution of 0.0032Hz!? What determines the > > frequency resolution here? What can I do to make it less fine grained? > > > > Thanks > > Martin > > > > > > ---------------------------------- > > > > The aim of this list is to facilitate the discussion between users of > > the FieldTrip toolbox, to share experiences and to discuss new ideas > > for MEG and EEG analysis. > > > > http://listserv.surfnet.nl/archives/fieldtrip.html > > > > http://www.ru.nl/fcdonders/fieldtrip/ > > > > > -- > Dipl. Psych. Thomas Hartmann > > OBOB-Lab > University of Konstanz > Department of Psychology > P.O. Box D25 > 78457 Konstanz > Germany > > Tel.: +49 (0)7531 88 4612 > Fax: +49 (0)7531-88 4601 > Email: thomas.hartmann at uni-konstanz.de > Homepage: http://www.uni-konstanz.de/obob > > "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan > Doyle) > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Thu Jul 2 16:09:11 2009 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Thu, 2 Jul 2009 16:09:11 +0200 Subject: frequency resolution of the power spectrum In-Reply-To: Message-ID: Hi Martin, take a look at http://fieldtrip.fcdonders.nl/faq/how_can_i_process_continuous_data_without_triggers to know how to preprocess your single trial Marco On 02/lug/09, at 15:39, Martin Bleichner wrote: > Hi there, > > this might be a stupid question. I probably miss something obvious. > > I want to compute the power spectrum over a single trial (around 5 > minutes). > > using this piece of code > cfg = []; > cfg.method = 'mtmfft'; > cfg.output = 'pow'; > cfg.foilim = [1 100]; > cfg.taper = 'hanning'; > freq = freqanalysis(cfg, data); > > as a result I get > freq: [1x62534 double] > powspctrm: [96x62534 double] > > that is a frequency resolution of 0.0032Hz!? What determines the > frequency resolution here? What can I do to make it less fine grained? > > Thanks > Martin > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 3 16:42:25 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke van Dijk) Date: Fri, 3 Jul 2009 16:42:25 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. Message-ID: Dear all, I am getting started doing analysis on Elekta Neuromag data using fieldtrip, having been used to CTF data at the Donders before... My question regards loading mri data in order to do volumesegment and sourceanalysis in the end. In particular I would like to transform the outcome of the mne toolbox function: 'fif_read_mri.m' to a fieldtrip compatible format. F.Y.I, I'm working with data with recorded with the old 122 sensor system here in Duesseldorf, and with data of the newest 306 vector view system as well. Does anyone have experience with this? And of course maybe have a solution? Best and thanks in advance, Hanneke ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hubert.preissl at UNI-TUEBINGEN.DE Mon Jul 6 12:01:21 2009 From: hubert.preissl at UNI-TUEBINGEN.DE (Hubert Preissl) Date: Mon, 6 Jul 2009 12:01:21 +0200 Subject: MEG lunch at HBM2009/minutes In-Reply-To: <4A4A6DC8.8060406@donders.ru.nl> Message-ID: Dear Ole, during the last autumn school we recorded all lectures, maybe it would be interesting to make other people aware of this. if you want to have a look at this go to http://timms.uni-tuebingen.de/Search/SearchForm01.aspx search for: autumn school 2008 sincerely, hubert -- Dr. Hubert Preissl MEG-Center phone: ++49-(0)7071-2987704 Otfried Mueller Str 47 fax: ++49-(0)7071-295706 72076 Tübingen, Germany email: hubert.preissl at uni-tuebingen.de ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Paul.vandenHurk at FCDONDERS.RU.NL Mon Jul 6 14:28:27 2009 From: Paul.vandenHurk at FCDONDERS.RU.NL (Paul van den Hurk) Date: Mon, 6 Jul 2009 14:28:27 +0200 Subject: Failed to create socket while using the Fieldtrip buffer Message-ID: >>From June 22 until July 10 I'll be away. After that time, I'll respond as soon as possible. With kind regards, Paul van den Hurk PhD student in Mind-Brain-Mindfulness Group Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging Radboud University Nijmegen Postal Address: PO Box 9101 6500 HB NIJMEGEN The Netherlands Visiting address: Kapittelweg 29 room: 1.34 6525 EN NIJMEGEN tel.: +31 (0)243668388 e-mail: p.vandenhurk at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From christophe.grova at MCGILL.CA Mon Jul 6 16:34:52 2009 From: christophe.grova at MCGILL.CA (Christophe Grova) Date: Mon, 6 Jul 2009 09:34:52 -0500 Subject: Workshop "Inverse problems in brain imaging and multimodal data fusion" - Montreal - August 24-29 2009 Message-ID: ********************************************************************************************* CALL FOR ABSTRACT - DEADLINE FOR ABSTRACT SUBMISSION July 15th - REGISTRATION IS OPEN Inverse problems in brain imaging and multimodal data fusion Montreal, CANADA, August 24-29, 2009 Organizers: Christophe Grova(McGill), Sylvain Baillet (Med. College of Wisconsin), Jean-Marc Lina (Ecole de Technologie Superieure, CRM) (http://www.crm.umontreal.ca/Inverse09/index_e.php) ********************************************************************************************* Sylvain Baillet, Jean-MarcLina and myself are organizing a workshop entitled "Inverse problems in brain imagery and multimodal data fusion". This workshop supported by the "Centre de Recherche en Mathématiques" de l'Université de Montréal (http://www.crm.umontreal.ca/) will last 5 days in Montreal from the 24th to the 29th of August 2009 The diversity of non invasive imaging devices (MRI, EEG, MEG, Near Infrared Spectroscopyl) allows one to explore the brain dynamics provided there exists a mathematical framework that encompass this multimodality and the complexity of the inherent sources of the cerebral signals. Despite a general agreement about the source modelling, many mathematical strategies have been elaborated in order to solve the inevitable ill-posed inverse problem.. What are the common features between those approaches? What are the mathematical frameworks the most appropriate for handling simultaneous measurements from different modalities? What are the best approaches for estimating both spatial and temporal brain activities? The workshop will consist in full 3-hours invited lectures followed by more specific presentations and one poster session. Participants interested in presenting a contributed talk or a poster are invited to submit an abstract before the 15th of July 2009. Participants interested in attending, the registration is now open, places are limited Check our website for more information: http://www.crm.umontreal.ca/Inverse09/index_e.php Preliminary program below We hope to see you in Montreal Grova Christophe, Baillet Sylvain, and Lina Jean-Marc ----------------------------- Monday August 24th: Inverse problem (1) - Matti Hamalainen - Martinos Cent. for Biomed. Imag. Boston USA MEG and EEG side by side in terms of neural sources sources, measurement techniques, forward modeling, and source modeling. - Srikantan Nagarajan - Univ. Calif. at San Francisco USA Machine learning advances in electromagnetic imaging. Probabilistic algorithms developed for analyses of MEG and EEG data ------------------------------------------------------------------------------------------------------- Tuesday August 25th: Inverse problem (2) - Jan de Munck - VU Medical Center Amsterdam, Netherlands Computational aspects of forward and inverse modelling of MEG and EEG - Nelson Trujillo Barreto - Cuban Centre for Neurosciences - LaHavana, Cuba Probabilistic and biophysical models for the analysis and integration of functional neuroimages - Round table / discussion: How deep one can see with MEG vs EEG? Moderators: M. Hamalainen, J. de Munck ------------------------------------------------------------------------------------------------------- Wednesday August 26th: Dipole scanning approaches - J Mosher - Cleveland Clinic USA A Beamformer Perspective of MEG and EEG Source Analyses. (non-cerebral noise rejection in MEG/EEG, non linear source localization) - Douglas Cheyne: Toronto Sick Kids Hospital, Canada Application of beamformers in clinical and cognitive neuroimaging - Hermann Stefan - MEG Center, Erlangen, Germany Clinical application of multimodal data (EEG/MEG/MRI//PET/SPECT) in epilepsy - Round table / discussion : model comparison and model selection for EEG/MEG inverse problem Moderators: N. Trujillo-Barreto, J. Daunizeau ------------------------------------------------------------------------------------------------------- Thursday August 27th: Multimodal data fusion - Christophe Grova - McGill University, Biomedical Engineering Dpt, Canada Insights from electrophysiology (MEG/EEG) and hemodynamic processes (fMRI/NIRS) using multimodal imaging to characterize the epilptogenic network - Jean Daunizeau - Functional Imaging Lab., London, UK Stochastic dynamic causal models in EEG/MEG - Jorge Riera - Tohoku University, Japan Modeling the genesis of the primary current density from a mesoscopic viewpoint: the relationship with EEG and MEG data - Sylvain Baillet- The Medical College of Wisconsin, USA Optical flow techniques adapted to the analysis of time-resolved brain imaging data - Round table / discussion : source localization and induced activity Moderators: J.M Lina ------------------------------------------------------------------------------------------------------- Friday August 28th: Clinical and Neuroscience applications - Jean-Marc Lina - Ecole de Technologie Superieure, Montreal, Canada Entropic approaches dedicated to the EEG/MEG inverse problem - Eliane Kobayashi - McGill, Montreal Neurological Institute, Canada Clinical relevance of EEG/MEG and EEG/fMRI in epilepsy - Stephan Grimault MEG center - Université de Montréal, Canada Memory retention and source localization of induced activity in MEG - Round table / discussion : clinical and neuroscience application of the inverse problem,expectations of the users Moderators: P. Jolicoeur (UdM), J. Gotman (McGill) ------------------------------------------------------------------------------- *************************** Christophe Grova, PhD Assistant Professor Biomedical Engineering Dpt Neurology and Neurosurgery Dpt Montreal Neurological Institute Biomedical Engineering Department - Room 304 McGill University 3775 University Street, Montreal, Quebec, Canada, H3A 2B4 email : christophe.grova at mcgill.ca tel : (514) 398 2516 fax : (514) 398 7461 Research Assistant : MEG Center, CERNEC Université de Montréal tel : (514)-343-6111 ext 18878. web: http://www.mni.mcgill.ca/research/gotman/members/christophe.html http://www.bmed.mcgill.ca/ *************************** ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From florisdelange at GMAIL.COM Mon Jul 6 18:48:17 2009 From: florisdelange at GMAIL.COM (Floris de Lange) Date: Mon, 6 Jul 2009 18:48:17 +0200 Subject: dipole time course Message-ID: Dear Fieldtrippers, I have a fairly basic Fieldtrip question; I hope you can point me in the right direction. I'm running a dipole model on the early auditory response (60-90 ms after the click). The dipoloe fit works very well. Just for completeness, these are the lines of code I used: cfg = []; cfg.numdipoles = 2; cfg.symmetry = 'y'; cfg.model = 'regional'; cfg.latency = [-0.44 -0.41]; cfg.vol = vol; cfg.inwardshift = 0; source = dipolefitting(cfg,erf{1}); % visualize where the dipoles are figure(1); clf; headmodelplot(cfg,erf{1}) hold on; plot3([source.dip.pos(1,1)],[source.dip.pos(1,2)],[source.dip.pos(1,3)],'ro'); plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos(2,3)],'bo'); I have fitted the dipole over a 30 msec window. But now, I would like to plot the response of these dipoles for the whole time window sampled. In other words, I would like to use the coordinates obtained from the dipole fitting procedure, and use them as 'virtual sensors' to reduce the dimensionality of my data from 275 channel time courses to 2. I don't want to use the dipole moments, because they're only defined within the 30 ms that I used to calculate my dipole. I suppose I have to project my data through the dipoles, but I'm not sure how. Any help is greatly appreciated! Best wishes, Floris -- Floris de Lange http://www.florisdelange.com ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Mon Jul 6 21:39:53 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 6 Jul 2009 20:39:53 +0100 Subject: dipole time course In-Reply-To: <9fb563140907060948s59eedcbct39e5f92e7330e1d2@mail.gmail.com> Message-ID: Dear Floris, Dipolefitting uses the pseudo-inverse of the leadfield as its inverse operator. Using prepare_leadfield with the right input should give you the leadfields of the two locations of interest, pinv'ing the concatenated leadfields would give you the inverse operator (and multiplying the sensor level evoked field with the inverse operator gives you the dipoles' time courses (each in 3D)). The individual timecourses could be reduced to 1D by a pca. Alternatively, you could multiply each of the individual leadfields with the average reconstructed dipole orientation, so that you end up with a (concatenated across the two dipoles) forward model of 275x2, pinv'ing this one, and multiplying it with your sensor data directly gives you time courses in 1D. Cheers, JM On Jul 6, 2009, at 5:48 PM, Floris de Lange wrote: > Dear Fieldtrippers, > > I have a fairly basic Fieldtrip question; I hope you can point me > in the right direction. > I'm running a dipole model on the early auditory response (60-90 ms > after the click). The dipoloe fit works very well. Just for > completeness, these are the lines of code I used: > > cfg = []; > cfg.numdipoles = 2; > cfg.symmetry = 'y'; > cfg.model = 'regional'; > cfg.latency = [-0.44 -0.41]; > cfg.vol = vol; > cfg.inwardshift = 0; > source = dipolefitting(cfg,erf{1}); > > % visualize where the dipoles are > figure(1); clf; headmodelplot(cfg,erf{1}) > hold on; > plot3([source.dip.pos(1,1)],[source.dip.pos(1,2)],[source.dip.pos > (1,3)],'ro'); > plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos > (2,3)],'bo'); > > I have fitted the dipole over a 30 msec window. But now, I would > like to plot the response of these dipoles for the whole time > window sampled. > In other words, I would like to use the coordinates obtained from > the dipole fitting procedure, and use them as 'virtual sensors' to > reduce the dimensionality of my data from 275 channel time courses > to 2. I don't want to use the dipole moments, because they're only > defined within the 30 ms that I used to calculate my dipole. > I suppose I have to project my data through the dipoles, but I'm > not sure how. Any help is greatly appreciated! > > Best wishes, > Floris > > -- > Floris de Lange > http://www.florisdelange.com > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From florisdelange at GMAIL.COM Tue Jul 7 14:34:12 2009 From: florisdelange at GMAIL.COM (Floris de Lange) Date: Tue, 7 Jul 2009 14:34:12 +0200 Subject: dipole time course Message-ID: Dear Jan-Matthijs and other fieldtrippers, Thanks for your reply. I tried out your first suggestion. Unfortunately, the dipole time courses look considerably worse than what I get from picking the planar sensors that have the strongest signal. I've attached the results for 2 conditions in the left and right auditory cortex, for comparison. On the top left is (one of the 3 matrices of) the relevant leadfield, and on the right is the planar ERF. On the bottom are the time courses of the pinv'ed leadfield * ERF time course, which are then pca'ed. I have pasted the code used below. Any idea why the dipole time course looks so much worse? % calculate leadfields for the two dipole locations cfg = []; cfg.grad = erf{1}.grad; cfg.vol = vol; cfg.channel = {'MEG'}; cfg.grid.pos = source.dip.pos; [grid] = prepare_leadfield(cfg); % multiply pseudo-inverse of leadfield with erf, then do a pca dip{i}{cond} = pinv(grid.leadfield{i}) * erf{cond}.avg; [tmp1 tmp2] = pca(dip{i}{cond}); Any input appreciated, Best wishes, Floris Dear Floris, > > Dipolefitting uses the pseudo-inverse of the leadfield as its inverse > operator. Using prepare_leadfield with the right input should give > you the leadfields of the two locations of interest, pinv'ing the > concatenated leadfields would give you the inverse operator (and > multiplying the sensor level evoked field with the inverse operator > gives you the dipoles' time courses (each in 3D)). The individual > timecourses could be reduced to 1D by a pca. Alternatively, you could > multiply each of the individual leadfields with the average > reconstructed dipole orientation, so that you end up with a > (concatenated across the two dipoles) forward model of 275x2, > pinv'ing this one, and multiplying it with your sensor data directly > gives you time courses in 1D. > > Cheers, > > JM > > On Jul 6, 2009, at 5:48 PM, Floris de Lange wrote: > > > Dear Fieldtrippers, > > > > I have a fairly basic Fieldtrip question; I hope you can point me > > in the right direction. > > I'm running a dipole model on the early auditory response (60-90 ms > > after the click). The dipoloe fit works very well. Just for > > completeness, these are the lines of code I used: > > > > cfg = []; > > cfg.numdipoles = 2; > > cfg.symmetry = 'y'; > > cfg.model = 'regional'; > > cfg.latency = [-0.44 -0.41]; > > cfg.vol = vol; > > cfg.inwardshift = 0; > > source = dipolefitting(cfg,erf{1}); > > > > % visualize where the dipoles are > > figure(1); clf; headmodelplot(cfg,erf{1}) > > hold on; > > plot3([source.dip.pos(1,1)],[source.dip.pos(1,2)],[source.dip.pos > > (1,3)],'ro'); > > plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos > > (2,3)],'bo'); > > > > I have fitted the dipole over a 30 msec window. But now, I would > > like to plot the response of these dipoles for the whole time > > window sampled. > > In other words, I would like to use the coordinates obtained from > > the dipole fitting procedure, and use them as 'virtual sensors' to > > reduce the dimensionality of my data from 275 channel time courses > > to 2. I don't want to use the dipole moments, because they're only > > defined within the 30 ms that I used to calculate my dipole. > > I suppose I have to project my data through the dipoles, but I'm > > not sure how. Any help is greatly appreciated! > > > > Best wishes, > > Floris > -- Floris de Lange http://www.florisdelange.com ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_1_1.tif Type: image/tiff Size: 160706 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_1_2.tif Type: image/tiff Size: 172144 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_2_1.tif Type: image/tiff Size: 171686 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: flodlan_dipresults_2_2.tif Type: image/tiff Size: 184488 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Tue Jul 7 14:55:21 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Tue, 7 Jul 2009 13:55:21 +0100 Subject: dipole time course In-Reply-To: <9fb563140907070534x1e24d827r8da78d3d5b47a150@mail.gmail.com> Message-ID: Hi Floris, I suspect that the 'orientation' onto which the pca projects the dipoles is not optimal. Perhaps you might want to try the other way, i.e. compute the leadfields in 1D, either by specifying something in cfg.grid.mom (or ori, I keep forgetting) before calling prepare_leadfield, or by postmultiplying the 3D leadfields with the orientation as estimated by the dipole fit. Cheers, JM On Jul 7, 2009, at 1:34 PM, Floris de Lange wrote: > Dear Jan-Matthijs and other fieldtrippers, > > Thanks for your reply. I tried out your first suggestion. > Unfortunately, the dipole time courses look considerably worse than > what I get from picking the planar sensors that have the strongest > signal. I've attached the results for 2 conditions in the left and > right auditory cortex, for comparison. On the top left is (one of > the 3 matrices of) the relevant leadfield, and on the right is the > planar ERF. On the bottom are the time courses of the pinv'ed > leadfield * ERF time course, which are then pca'ed. I have pasted > the code used below. Any idea why the dipole time course looks so > much worse? > > % calculate leadfields for the two dipole locations > cfg = []; > cfg.grad = erf{1}.grad; > cfg.vol = vol; > cfg.channel = {'MEG'}; > cfg.grid.pos = source.dip.pos; > [grid] = prepare_leadfield(cfg); > > % multiply pseudo-inverse of leadfield with erf, then do a pca > dip{i}{cond} = pinv(grid.leadfield{i}) * erf{cond}.avg; > [tmp1 tmp2] = pca(dip{i}{cond}); > > Any input appreciated, > Best wishes, > Floris > > > > Dear Floris, > > Dipolefitting uses the pseudo-inverse of the leadfield as its inverse > operator. Using prepare_leadfield with the right input should give > you the leadfields of the two locations of interest, pinv'ing the > concatenated leadfields would give you the inverse operator (and > multiplying the sensor level evoked field with the inverse operator > gives you the dipoles' time courses (each in 3D)). The individual > timecourses could be reduced to 1D by a pca. Alternatively, you could > multiply each of the individual leadfields with the average > reconstructed dipole orientation, so that you end up with a > (concatenated across the two dipoles) forward model of 275x2, > pinv'ing this one, and multiplying it with your sensor data directly > gives you time courses in 1D. > > Cheers, > > JM > > On Jul 6, 2009, at 5:48 PM, Floris de Lange wrote: > > > Dear Fieldtrippers, > > > > I have a fairly basic Fieldtrip question; I hope you can point me > > in the right direction. > > I'm running a dipole model on the early auditory response (60-90 ms > > after the click). The dipoloe fit works very well. Just for > > completeness, these are the lines of code I used: > > > > cfg = []; > > cfg.numdipoles = 2; > > cfg.symmetry = 'y'; > > cfg.model = 'regional'; > > cfg.latency = [-0.44 -0.41]; > > cfg.vol = vol; > > cfg.inwardshift = 0; > > source = dipolefitting(cfg,erf{1}); > > > > % visualize where the dipoles are > > figure(1); clf; headmodelplot(cfg,erf{1}) > > hold on; > > plot3([source.dip.pos(1,1)],[ > source.dip.pos(1,2)],[source.dip.pos > > (1,3)],'ro'); > > plot3([source.dip.pos(2,1)],[source.dip.pos(2,2)],[source.dip.pos > > (2,3)],'bo'); > > > > I have fitted the dipole over a 30 msec window. But now, I would > > like to plot the response of these dipoles for the whole time > > window sampled. > > In other words, I would like to use the coordinates obtained from > > the dipole fitting procedure, and use them as 'virtual sensors' to > > reduce the dimensionality of my data from 275 channel time courses > > to 2. I don't want to use the dipole moments, because they're only > > defined within the 30 ms that I used to calculate my dipole. > > I suppose I have to project my data through the dipoles, but I'm > > not sure how. Any help is greatly appreciated! > > > > Best wishes, > > Floris > > > -- > Floris de Lange > http://www.florisdelange.com > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > > sults_2_1.tif> ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue Jul 7 18:08:44 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 7 Jul 2009 18:08:44 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: Message-ID: Hi Hanneke, The read_mri function has support for MRIs in fif files using a meg_pd function (i.e. mex file), but not yet for the mne toolbox. Could you send me an example MRI dataset so that I can try it out? Robert PS See http://fieldtrip.fcdonders.nl/contact#how_should_i_send_example_data_to_the_developers On 3 Jul 2009, at 16:42, Hanneke van Dijk wrote: > Dear all, > > I am getting started doing analysis on Elekta Neuromag data using > fieldtrip, having been used to CTF data at the Donders before... > My question regards loading mri data in order to do volumesegment > and sourceanalysis in the end. > > In particular I would like to transform the outcome of the mne > toolbox function: 'fif_read_mri.m' to a fieldtrip compatible format. > > F.Y.I, I'm working with data with recorded with the old 122 sensor > system here in Duesseldorf, and with data of the newest 306 vector > view system as well. > > Does anyone have experience with this? And of course maybe have a > solution? > > Best and thanks in advance, > > Hanneke > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Wed Jul 8 09:01:28 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Wed, 8 Jul 2009 09:01:28 +0200 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Message-ID: Hi Robert, Thanks for your reply. I have tried the meg_pd function loadmri (via read_mri in fieldtrip) but I got the feedback: 'error loading mri-file'. So I have no idea what is going wrong. I will send you the example mri-file right now. It is probably not to difficult to work something out but I want to be sure that the mri head coordinates end up in the right way as device coordinates. Thanks in advance! Viele Gruße aus Düsseldorf ;-) Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von Robert Oostenveld Gesendet: Di 07.07.2009 18:08 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, The read_mri function has support for MRIs in fif files using a meg_pd function (i.e. mex file), but not yet for the mne toolbox. Could you send me an example MRI dataset so that I can try it out? Robert PS See http://fieldtrip.fcdonders.nl/contact#how_should_i_send_example_data_to_the_developers On 3 Jul 2009, at 16:42, Hanneke van Dijk wrote: > Dear all, > > I am getting started doing analysis on Elekta Neuromag data using > fieldtrip, having been used to CTF data at the Donders before... > My question regards loading mri data in order to do volumesegment > and sourceanalysis in the end. > > In particular I would like to transform the outcome of the mne > toolbox function: 'fif_read_mri.m' to a fieldtrip compatible format. > > F.Y.I, I'm working with data with recorded with the old 122 sensor > system here in Duesseldorf, and with data of the newest 306 vector > view system as well. > > Does anyone have experience with this? And of course maybe have a > solution? > > Best and thanks in advance, > > Hanneke > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. Hi ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 8 09:49:02 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 8 Jul 2009 09:49:02 +0200 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F347B@Mail2-UKD.VMED.UKD> Message-ID: Hi Hanneke, The mri.fif file that you sent only contains the header information, but not the slice/image information. >> fiff_read_mri('mri.fif') Reading slice information and pixel data.??? Error using ==> fiff_read_mri at 116 Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 Please also send the corresponding slice data. Robert On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > Hi Robert, > > Thanks for your reply. I have tried the meg_pd function loadmri (via > read_mri in fieldtrip) but I got the feedback: 'error loading mri- > file'. So I have no idea what is going wrong. I will send you the > example mri-file right now. It is probably not to difficult to work > something out but I want to be sure that the mri head coordinates > end up in the right way as device coordinates. > > Thanks in advance! > Viele Gruße aus Düsseldorf ;-) > > Hanneke ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Wed Jul 8 10:03:10 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Wed, 8 Jul 2009 10:03:10 +0200 Subject: AW: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Message-ID: Hi Robert, Done, sorry! Groetjes Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von Robert Oostenveld Gesendet: Mi 08.07.2009 09:49 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, The mri.fif file that you sent only contains the header information, but not the slice/image information. >> fiff_read_mri('mri.fif') Reading slice information and pixel data.??? Error using ==> fiff_read_mri at 116 Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 Please also send the corresponding slice data. Robert On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > Hi Robert, > > Thanks for your reply. I have tried the meg_pd function loadmri (via > read_mri in fieldtrip) but I got the feedback: 'error loading mri- > file'. So I have no idea what is going wrong. I will send you the > example mri-file right now. It is probably not to difficult to work > something out but I want to be sure that the mri head coordinates > end up in the right way as device coordinates. > > Thanks in advance! > Viele Gruße aus Düsseldorf ;-) > > Hanneke ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 8 10:09:08 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 8 Jul 2009 10:09:08 +0200 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <143C4174-C62D-4A08-888C-06A79538F7E5@fcdonders.ru.nl> Message-ID: Hi Hanneke, I have tried importing another MRI fif file which I still had on disk using the following modification of the fieldtrip/fileio/read_mri.m code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%% elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') % use the mne functions to read the Neuromag MRI hdr = fiff_read_mri(filename); img = cat(3, hdr.slices.data); hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data to save memory transform = hdr.trans.trans; and then slightly further down in the code % set up the axes of the volume in voxel coordinates nx = size(img,1); ny = size(img,2); nz = size(img,3); mri.dim = [nx ny nz]; % store the anatomical data mri.anatomy = img; % store the header with all fileformat specific details mri.hdr = hdr; try % if present, store the homogenous transformation matrix mri.transform = transform; end This results in a warning of the MNE fiff_read_mri function >> mri = read_mri('lp_mri_headcoords.fif') Reading slice information and pixel data..50..100..126..[done] The slices are not equally spaced. Voxel transformation will not be included mri = dim: [256 256 126] anatomy: [256x256x126 int16] hdr: [1x1 struct] transform: [4x4 double] and the resulting coordinate transformation matrix is not fully correct. You can check the coordinates by plotting it intreactively in sourceplot (after converting the image data from int16 into double). Perhaps one of the Neuromag experts on the list can help you further. best regards, Robert PS atatched is the latest read_mri function, which includes the call to fiff_read_mri. On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > Hi Hanneke, > > The mri.fif file that you sent only contains the header information, > but not the slice/image information. > > >> fiff_read_mri('mri.fif') > Reading slice information and pixel data.??? Error using ==> > fiff_read_mri at 116 > Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ > MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 > > Please also send the corresponding slice data. > > Robert > > > On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > >> Hi Robert, >> >> Thanks for your reply. I have tried the meg_pd function loadmri >> (via read_mri in fieldtrip) but I got the feedback: 'error loading >> mri-file'. So I have no idea what is going wrong. I will send you >> the example mri-file right now. It is probably not to difficult to >> work something out but I want to be sure that the mri head >> coordinates end up in the right way as device coordinates. >> >> Thanks in advance! >> Viele Gruße aus Düsseldorf ;-) >> >> Hanneke > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: read_mri.m Type: application/octet-stream Size: 11399 bytes Desc: not available URL: From j.schoffelen at PSY.GLA.AC.UK Wed Jul 8 10:22:09 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 8 Jul 2009 09:22:09 +0100 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: Message-ID: Hi Hanneke, Please note that the X and Y axis in the neuromag head-coordinate system are swapped with respect to the CTF and 4D convention; i.e. X axis through the ears, and Y-axis to the nose. What usually works for me is discarding the mri.transform (mri = rmfield(mri, 'transform'), and call volumerealign in the interactive mode. You can then specify the location of the fiducials yourself and the output mri of the function will contain a transformation matrix according to ctf convention. This at least ensures that volumesegment etc kind of work properly. Yet, it is important to know that of course the gradiometer positions in the data are defined in neuromag convention, so after preparing your volume conduction model you probably have to swap the x and y coordinates of the vol.bnd.pnt (assuming you use a singleshell as volume conductor model), before proceeding to visualization (headmodelplot; just to check whether the head fits in the helmet), leadfield computation (only makes sense if the head fits in the helmet), and sourceanalysis (idem). Yours, JM On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > Hi Hanneke, > > I have tried importing another MRI fif file which I still had on > disk using the following modification of the fieldtrip/fileio/ > read_mri.m code > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %%%%%%%%%%%%%% > elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') > % use the mne functions to read the Neuromag MRI > hdr = fiff_read_mri(filename); > img = cat(3, hdr.slices.data); > hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data > to save memory > transform = hdr.trans.trans; > > and then slightly further down in the code > > % set up the axes of the volume in voxel coordinates > nx = size(img,1); > ny = size(img,2); > nz = size(img,3); > mri.dim = [nx ny nz]; > % store the anatomical data > mri.anatomy = img; > % store the header with all fileformat specific details > mri.hdr = hdr; > try > % if present, store the homogenous transformation matrix > mri.transform = transform; > end > > This results in a warning of the MNE fiff_read_mri function > > >> mri = read_mri('lp_mri_headcoords.fif') > Reading slice information and pixel data..50..100..126..[done] > The slices are not equally spaced. Voxel transformation will not > be included > > mri = > dim: [256 256 126] > anatomy: [256x256x126 int16] > hdr: [1x1 struct] > transform: [4x4 double] > > and the resulting coordinate transformation matrix is not fully > correct. You can check the coordinates by plotting it intreactively > in sourceplot (after converting the image data from int16 into > double). > > Perhaps one of the Neuromag experts on the list can help you further. > > best regards, > Robert > > PS atatched is the latest read_mri function, which includes the > call to fiff_read_mri. > > > On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> The mri.fif file that you sent only contains the header >> information, but not the slice/image information. >> >> >> fiff_read_mri('mri.fif') >> Reading slice information and pixel data.??? Error using ==> >> fiff_read_mri at 116 >> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >> >> Please also send the corresponding slice data. >> >> Robert >> >> >> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >> >>> Hi Robert, >>> >>> Thanks for your reply. I have tried the meg_pd function loadmri >>> (via read_mri in fieldtrip) but I got the feedback: 'error >>> loading mri-file'. So I have no idea what is going wrong. I will >>> send you the example mri-file right now. It is probably not to >>> difficult to work something out but I want to be sure that the >>> mri head coordinates end up in the right way as device coordinates. >>> >>> Thanks in advance! >>> Viele Gruße aus Düsseldorf ;-) >>> >>> Hanneke >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Wed Jul 8 10:29:09 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Wed, 8 Jul 2009 10:29:09 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. Message-ID: Hi Robert and Jan-Mathijs, Thanks so much for your quick replies and the script! I will try to work it out and keep you updated! Yours, Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von Robert Oostenveld Gesendet: Mi 08.07.2009 10:09 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, I have tried importing another MRI fif file which I still had on disk using the following modification of the fieldtrip/fileio/read_mri.m code %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%% elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') % use the mne functions to read the Neuromag MRI hdr = fiff_read_mri(filename); img = cat(3, hdr.slices.data); hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data to save memory transform = hdr.trans.trans; and then slightly further down in the code % set up the axes of the volume in voxel coordinates nx = size(img,1); ny = size(img,2); nz = size(img,3); mri.dim = [nx ny nz]; % store the anatomical data mri.anatomy = img; % store the header with all fileformat specific details mri.hdr = hdr; try % if present, store the homogenous transformation matrix mri.transform = transform; end This results in a warning of the MNE fiff_read_mri function >> mri = read_mri('lp_mri_headcoords.fif') Reading slice information and pixel data..50..100..126..[done] The slices are not equally spaced. Voxel transformation will not be included mri = dim: [256 256 126] anatomy: [256x256x126 int16] hdr: [1x1 struct] transform: [4x4 double] and the resulting coordinate transformation matrix is not fully correct. You can check the coordinates by plotting it intreactively in sourceplot (after converting the image data from int16 into double). Perhaps one of the Neuromag experts on the list can help you further. best regards, Robert PS atatched is the latest read_mri function, which includes the call to fiff_read_mri. On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > Hi Hanneke, > > The mri.fif file that you sent only contains the header information, > but not the slice/image information. > > >> fiff_read_mri('mri.fif') > Reading slice information and pixel data.??? Error using ==> > fiff_read_mri at 116 > Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ > MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 > > Please also send the corresponding slice data. > > Robert > > > On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: > >> Hi Robert, >> >> Thanks for your reply. I have tried the meg_pd function loadmri >> (via read_mri in fieldtrip) but I got the feedback: 'error loading >> mri-file'. So I have no idea what is going wrong. I will send you >> the example mri-file right now. It is probably not to difficult to >> work something out but I want to be sure that the mri head >> coordinates end up in the right way as device coordinates. >> >> Thanks in advance! >> Viele Gruße aus Düsseldorf ;-) >> >> Hanneke > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gsudre at POBOX.COM Wed Jul 8 14:17:09 2009 From: gsudre at POBOX.COM (Gustavo Sudre) Date: Wed, 8 Jul 2009 08:17:09 -0400 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <63C46F40-97E3-4E32-930D-6EC7D32F6A5D@psy.gla.ac.uk> Message-ID: Hi, I've been following this discussion closely because I've been having the same problem. The new read_mri worked fine for me (thanks for that!). Now, the mri I import is already in head coordinates (Neuromag standard: mri.hdr.trans.from=4), and it has been realigned to the data using a separate program, so I would prefer to not re-define the fiducials using volumerealign. In this case, is it enough to just switch the X and Y axes manually (mri.anatomy = permute(mri.anatomy,[2 1 3])) to conform to CTF standards, and use the identity matrix for mri.transform? If I understand it correctly, mri.transform is used to take the mri (or any volume) to head coordinates, right? So, I was wondering what steps the mri.transform matrix is required. Do other common future steps (e.g. plotting, preparing headmodel, leadfield, etc) assume the volume is already in head coordinates, or do they always use vol.transform for that? Also, when I tried removing mri,transform, volumerealign didn't like it because the mri structure wasn't a volume structure anymore (and I imagine other functions will complain about it too, that's why I used the identity). Thanks, Gus On Jul 8, 2009, at 4:22 AM, jan-mathijs schoffelen wrote: > Hi Hanneke, > > Please note that the X and Y axis in the neuromag head-coordinate > system are swapped with respect to the CTF and 4D convention; i.e. X > axis through the ears, and Y-axis to the nose. > What usually works for me is discarding the mri.transform (mri = > rmfield(mri, 'transform'), and call volumerealign in the interactive > mode. You can then specify the location of the fiducials yourself > and the output mri of the function will contain a transformation > matrix according to ctf convention. This at least ensures that > volumesegment etc kind of work properly. Yet, it is important to > know that of course the gradiometer positions in the data are > defined in neuromag convention, so after preparing your volume > conduction model you probably have to swap the x and y coordinates > of the vol.bnd.pnt (assuming you use a singleshell as volume > conductor model), before proceeding to visualization (headmodelplot; > just to check whether the head fits in the helmet), leadfield > computation (only makes sense if the head fits in the helmet), and > sourceanalysis (idem). > > Yours, > > JM > > > > > On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> I have tried importing another MRI fif file which I still had on >> disk using the following modification of the fieldtrip/fileio/ >> read_mri.m code >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %%%%%%%%%%%%% >> elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') >> % use the mne functions to read the Neuromag MRI >> hdr = fiff_read_mri(filename); >> img = cat(3, hdr.slices.data); >> hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data >> to save memory >> transform = hdr.trans.trans; >> >> and then slightly further down in the code >> >> % set up the axes of the volume in voxel coordinates >> nx = size(img,1); >> ny = size(img,2); >> nz = size(img,3); >> mri.dim = [nx ny nz]; >> % store the anatomical data >> mri.anatomy = img; >> % store the header with all fileformat specific details >> mri.hdr = hdr; >> try >> % if present, store the homogenous transformation matrix >> mri.transform = transform; >> end >> >> This results in a warning of the MNE fiff_read_mri function >> >> >> mri = read_mri('lp_mri_headcoords.fif') >> Reading slice information and pixel data..50..100..126..[done] >> The slices are not equally spaced. Voxel transformation will not >> be included >> >> mri = >> dim: [256 256 126] >> anatomy: [256x256x126 int16] >> hdr: [1x1 struct] >> transform: [4x4 double] >> >> and the resulting coordinate transformation matrix is not fully >> correct. You can check the coordinates by plotting it intreactively >> in sourceplot (after converting the image data from int16 into >> double). >> >> Perhaps one of the Neuromag experts on the list can help you further. >> >> best regards, >> Robert >> >> PS atatched is the latest read_mri function, which includes the >> call to fiff_read_mri. >> >> >> On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: >> >>> Hi Hanneke, >>> >>> The mri.fif file that you sent only contains the header >>> information, but not the slice/image information. >>> >>> >> fiff_read_mri('mri.fif') >>> Reading slice information and pixel data.??? Error using ==> >>> fiff_read_mri at 116 >>> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >>> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >>> >>> Please also send the corresponding slice data. >>> >>> Robert >>> >>> >>> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >>> >>>> Hi Robert, >>>> >>>> Thanks for your reply. I have tried the meg_pd function loadmri >>>> (via read_mri in fieldtrip) but I got the feedback: 'error >>>> loading mri-file'. So I have no idea what is going wrong. I will >>>> send you the example mri-file right now. It is probably not to >>>> difficult to work something out but I want to be sure that the >>>> mri head coordinates end up in the right way as device coordinates. >>>> >>>> Thanks in advance! >>>> Viele Gruße aus Düsseldorf ;-) >>>> >>>> Hanneke >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From gsudre at POBOX.COM Wed Jul 8 14:34:35 2009 From: gsudre at POBOX.COM (Gustavo Sudre) Date: Wed, 8 Jul 2009 08:34:35 -0400 Subject: AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. In-Reply-To: <63C46F40-97E3-4E32-930D-6EC7D32F6A5D@psy.gla.ac.uk> Message-ID: OK, so I just thought of two more questions, so I apologize for not including them in my previous e-mail... 1) If after importing the Neuromag MRI the (head) coordinate system of the mri structure matches the same coordinate system in the data (including conventions such as Y-axis through the nose), why do we need to change it? You mentioned that volumesegment works better with CTF coordinates? So, does the segmentation algorithm make assumptions about where brain regions are based on the axis? Also, what other function in fieldtrip depend on such coordinate system, and would not work just by having the data coordinate system match the volume's? 2) So, let's say I already have segmented MRIs. If I just import that (and assuming volumesegment with the assumptions above), is it possible to go ahead with other steps such as prepare_bem, and prepare_singleshell? Thanks, Gus On Jul 8, 2009, at 4:22 AM, jan-mathijs schoffelen wrote: > Hi Hanneke, > > Please note that the X and Y axis in the neuromag head-coordinate > system are swapped with respect to the CTF and 4D convention; i.e. X > axis through the ears, and Y-axis to the nose. > What usually works for me is discarding the mri.transform (mri = > rmfield(mri, 'transform'), and call volumerealign in the interactive > mode. You can then specify the location of the fiducials yourself > and the output mri of the function will contain a transformation > matrix according to ctf convention. This at least ensures that > volumesegment etc kind of work properly. Yet, it is important to > know that of course the gradiometer positions in the data are > defined in neuromag convention, so after preparing your volume > conduction model you probably have to swap the x and y coordinates > of the vol.bnd.pnt (assuming you use a singleshell as volume > conductor model), before proceeding to visualization (headmodelplot; > just to check whether the head fits in the helmet), leadfield > computation (only makes sense if the head fits in the helmet), and > sourceanalysis (idem). > > Yours, > > JM > > > > > On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> I have tried importing another MRI fif file which I still had on >> disk using the following modification of the fieldtrip/fileio/ >> read_mri.m code >> >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %%%%%%%%%%%%% >> elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') >> % use the mne functions to read the Neuromag MRI >> hdr = fiff_read_mri(filename); >> img = cat(3, hdr.slices.data); >> hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data >> to save memory >> transform = hdr.trans.trans; >> >> and then slightly further down in the code >> >> % set up the axes of the volume in voxel coordinates >> nx = size(img,1); >> ny = size(img,2); >> nz = size(img,3); >> mri.dim = [nx ny nz]; >> % store the anatomical data >> mri.anatomy = img; >> % store the header with all fileformat specific details >> mri.hdr = hdr; >> try >> % if present, store the homogenous transformation matrix >> mri.transform = transform; >> end >> >> This results in a warning of the MNE fiff_read_mri function >> >> >> mri = read_mri('lp_mri_headcoords.fif') >> Reading slice information and pixel data..50..100..126..[done] >> The slices are not equally spaced. Voxel transformation will not >> be included >> >> mri = >> dim: [256 256 126] >> anatomy: [256x256x126 int16] >> hdr: [1x1 struct] >> transform: [4x4 double] >> >> and the resulting coordinate transformation matrix is not fully >> correct. You can check the coordinates by plotting it intreactively >> in sourceplot (after converting the image data from int16 into >> double). >> >> Perhaps one of the Neuromag experts on the list can help you further. >> >> best regards, >> Robert >> >> PS atatched is the latest read_mri function, which includes the >> call to fiff_read_mri. >> >> >> On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: >> >>> Hi Hanneke, >>> >>> The mri.fif file that you sent only contains the header >>> information, but not the slice/image information. >>> >>> >> fiff_read_mri('mri.fif') >>> Reading slice information and pixel data.??? Error using ==> >>> fiff_read_mri at 116 >>> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >>> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >>> >>> Please also send the corresponding slice data. >>> >>> Robert >>> >>> >>> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >>> >>>> Hi Robert, >>>> >>>> Thanks for your reply. I have tried the meg_pd function loadmri >>>> (via read_mri in fieldtrip) but I got the feedback: 'error >>>> loading mri-file'. So I have no idea what is going wrong. I will >>>> send you the example mri-file right now. It is probably not to >>>> difficult to work something out but I want to be sure that the >>>> mri head coordinates end up in the right way as device coordinates. >>>> >>>> Thanks in advance! >>>> Viele Gruße aus Düsseldorf ;-) >>>> >>>> Hanneke >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ingrid.nieuwenhuis at DONDERS.RU.NL Wed Jul 8 16:15:12 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Wed, 8 Jul 2009 16:15:12 +0200 Subject: Clusterplot not highlighting clusters & average layout file In-Reply-To: Message-ID: Dear Manish, > Thanks for your quick reply. I wanted to run freqstats separately on > each frequency, since I don't have precise temporal resolution in my > data (no events). Hence I need to run stats on Freq-Space > representations and not on TFR. Since clusterplot was not handling > this case, probably because it is made to search across time and space > for a given frequency, I ran freqstats/clusterplot separately for each > frequency. Aha, so you have frequency and channels, no time. Clusterplot can handle both data with and without time dimension (it looks for a .time field in the data). It cannot handle data with multiple frequency dimensions, so therefore you have to avgoverfreq (in revision 1.8 of clusterplot from May 22nd, I added a check for appropriateness of the data, see line 58). So depending on the hypothesis you want to test and your data you can either avgoverfreq and use clusterplot (as I said before usually appropriate for the lower frequencies because of well defined narrow bands, but again it depends on the research questions you have), or use multiplot. But because you have no time dimension you should use multiplotER (not multiplotTFR), with xparam = 'freq', zparam = 'stat', and maskparameter = 'mask'. Then the frequencies that are in the cluster are marked with a box. I don't know if it all works properly, I recall there were some problems with the masking options in multiplotER. Let me know if you need it and you don't get it to work. Hope it's all clear now, Best Ingrid > -----Original Message----- > From: Manish Saggar [mailto:manish.saggar at gmail.com] > Sent: Tuesday, June 30, 2009 6:40 AM > To: ingrid.nieuwenhuis at donders.ru.nl > Cc: FieldTrip discussion list > Subject: Re: [FIELDTRIP] Clusterplot not highlighting clusters & average > layout file > > Thanks for your quick reply. I wanted to run freqstats separately on > each frequency, since I don't have precise temporal resolution in my > data (no events). Hence I need to run stats on Freq-Space > representations and not on TFR. Since clusterplot was not handling > this case, probably because it is made to search across time and space > for a given frequency, I ran freqstats/clusterplot separately for each > frequency. > > So just to make sure I understood correctly, you are saying either I > use 'cfg.avgoverfreq=yes' especially for lower frequencies and then > use clusterplot OR do it separately for each frequency but use > multiplotTFR instead. But it seems like I can also use clusterplot > separately for each frequency, right? It seemed to work fine. May be I > am missing some obvious point here. Please let me know. > > Another thing that might be of interest to other people that I noticed > recently is that neighbourdist measures distance in meters when the > ELP (sensor location) file is created using BESA for EEG data. Thus a > default value of 4 cm is considered as 4 m and hence all the available > channels become neighbors for each channel. Thus I had to use a value > of 0.1 for neighbourdist, which takes 6 neighbour channels into > account. I think that is roughly equivalent to the default value of 4 > cm. > > Regards, > Manish > > On Mon, Jun 29, 2009 at 3:09 PM, Ingrid > Nieuwenhuis wrote: > > Dear Manish, > > > > (I reply to the list again, than everyone can benefit). > > That depends on what you want to test. If you have multiple frequencies > in > > your freq-data, and you just call freqanalysis, and you do not average > over > > specific frequency range, then clusterplot will look for clusters in the > > time-frequency-place domain. This does not always make sense, for > instance > > in the lower frequencies we know that there are different frequency > bands > > that behave totally different (theta and alpha for instance). Then you > can > > better run freqanalysis for these frequencies separately (choose only > 10Hz > > for alpha, or choose 8:12 Hz and cfg.avgoverfreq = 'yes'). In this case > you > > can use clusterplot to visualize. > > > > If you have no idea which frequencies behave the same, or that is > something > > you are actually interested in (for instance you have a broadbanded high > > gamma in your TFR) you can put freq-data with multiple frequencies in > > freqanalysis and look at the cluster that comes out. This is a valid > thing > > to do, but you can only not use clusterplot to visualize then. What you > can > > do is plot with multiplotTFR with mask settings (cfg.zparam = 'stat', > > cfg.maskparam = 'mask'). > > > > Best Ingrid > > > >> -----Original Message----- > >> From: Manish Saggar [mailto:manish.saggar at gmail.com] > >> Sent: Monday, June 29, 2009 7:49 PM > >> To: ingrid.nieuwenhuis at donders.ru.nl > >> Subject: Re: [FIELDTRIP] Clusterplot not highlighting clusters & > average > >> layout file > >> > >> Dear Ingrid, > >> > >> Thanks for your reply. Sorry I was out and didn't get a chance to reply > >> back. > >> > >> Last question regarding your reply, can I simply run freqstats and > >> clusterplot for each frequency separately? > >> > >> Regards, > >> Manish > >> > >> On Fri, May 22, 2009 at 9:39 AM, Ingrid > >> Nieuwenhuis wrote: > >> > Dear Manish, > >> > > >> > If I understand correctly you have multiple frequencies over which > you > >> > cluster. Is that correct? (so cfg.avgoverfreq = 'no' when you called > >> > freqstatistics?) In that case you should not call clusterplot because > >> for > >> > different frequencies there can be different channels part of the > >> cluster. > >> > Instead you can call multiplotER or multiplotTFR and use > >> cfg.maskparameter = > >> > 'mask' to plot the significant cluster. > >> > > >> > Hope this helps, > >> > Ingrid > >> > > >> > > >> >> -----Original Message----- > >> >> From: Manish Saggar [mailto:manish.saggar at gmail.com] > >> >> Sent: Friday, May 15, 2009 8:26 AM > >> >> To: ingrid.nieuwenhuis at donders.ru.nl > >> >> Cc: FIELDTRIP at NIC.SURFNET.NL > >> >> Subject: Re: [FIELDTRIP] Clusterplot not highlighting clusters & > >> average > >> >> layout file > >> >> > >> >> Ingrid, thanks for replying back. > >> >> > >> >> Apologies for lack of information. > >> >> > >> >> Clusterplot is plotting clusters fine most of the times, but in some > >> >> cases it doesn't choose to highlight markers. I have attached two > such > >> >> images with this email. > >> >> > >> >> I do not get any errors or warnings. In fact the command window in > >> >> matlab says, cluster found (with some prob and highlighter sign) and > >> >> then the plot doesn't contain any highlighting. > >> >> Initially I thought that my layout file might be messing it up or > >> >> something, or may be I need to take an average layout file for group > >> >> analysis (since cap size and electrode digitization varies for each > >> >> subject). > >> >> > >> >> Then I put debug points in the code and found out that at line 235 > the > >> >> list cell (used to denote highlighted points) is empty. I am a > novice > >> >> so please forgive if what I am suggesting is dumb here, but I think > >> >> when cluster plot is searching for significant clusters it is only > >> >> looking into first column (which could correspond to first frequency > >> >> in band) if one cluster is found by freqstats. It might be that in > the > >> >> code you guys are sorting columns and I might have missed it. But I > >> >> thought I should clear this with you. > >> >> > >> >> In another thread you have mentioned to someone that their time > limits > >> >> might not be precise enough to get the clusers highlighted > >> >> > >> > (https://listserv.surfnet.nl/scripts/wa.cgi?A2=ind0709&L=FIELDTRIP&P=R680 > >> >> ). But they were doing time-freq analysis and I am just doing freq- > >> >> representations. So should I use freqstats on each freq separately ? > >> >> > >> >> On a side note, when I run freqstats on my data (with 88 channels) > >> >> command line says '89 neighbors per channel found'. I am a little > >> >> confused with this. First since I only have less than 88 channels in > >> >> the data and second since it should only consider a lower number for > >> >> neighbor distance, right? and how can I change it? > >> >> > >> >> Thanks a ton in advance, > >> >> Manish > >> >> > >> >> On May 13, 2009, at 2:10 AM, Ingrid Nieuwenhuis wrote: > >> >> > >> >> > Dear Manish, > >> >> > > >> >> > You give a bit too few information to be able to figure out what > >> >> > could be > >> >> > the problem with clusterplot. After calling clusterplot, > clusterplot > >> >> > gives > >> >> > information on which clusters it finds. Does the function find any > >> >> > clusters? > >> >> > Does the .mask field of the structure that comes out of > >> freqstatistics > >> >> > contain any ones? Is everything else plotted normally? Do you get > >> >> > any errors > >> >> > or warnings? > >> >> > > >> >> > I'm not familiar with BESA layout files, but assuming that all > >> >> > layout files > >> >> > are similar over subjects, I think it is fine to just use an > >> >> > individual > >> >> > subject's layout file. > >> >> > > >> >> > Hope this helps, > >> >> > Best Ingrid > >> >> > > >> >> > > >> >> >>  ---Original Message----- > >> >> >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On > >> >> >> Behalf Of Manish Saggar > >> >> >> Sent: Tuesday, May 12, 2009 10:17 AM > >> >> >> To: FIELDTRIP at NIC.SURFNET.NL > >> >> >> Subject: [FIELDTRIP] Clusterplot not highlighting clusters & > average > >> >> >> layout file > >> >> >> > >> >> >> All, > >> >> >> > >> >> >> I have a question regarding clusterplot function. I am doing a > >> >> >> within-subject analysis. > >> >> >> The experimental design that I have is as follows, there are > three > >> >> >> conditions C1, C2 and C3. Each condition is of 1 min duration > (e.g. > >> >> >> rest with eyes open for 1 min). > >> >> >> > >> >> >> Now I am comparing grandaverage of freq representation of a set > of > >> >> >> subjects for C2 with C1 etc. FreqStatistics is running just fine > >> >> >> creating significant (<0.025 alpha, for 2-tailed test) clusters > >> >> >> (positive). Now the problem is that when I try to plot the > location > >> >> >> of > >> >> >> this cluster using clusterplot it doesn't show any highlighted > >> >> >> channels. Any ideas why that is happening? > >> >> >> > >> >> >> Another question is that since I am using grandaverages of freq > >> >> >> representation, what should I use for layout file (using BESA sfp > >> >> >> file > >> >> >> here). I have individual subject layout files. Currently I am > just > >> >> >> giving any file from one of the subjects. Since, I noticed that > >> >> >> FreqStatistics finds a common minimum set of channels and then > apply > >> >> >> statistics on it. So do I need to average layout files for the > >> >> >> subject > >> >> >> group or is there any other way? > >> >> >> > >> >> >> Any help is much appreciated. > >> >> >> > >> >> >> Regards, > >> >> >> Manish > >> >> >> > >> >> >> ---------------------------------- > >> >> >> The aim of this list is to facilitate the discussion between > users > >> >> >> of the > >> >> >> FieldTrip  toolbox, to share experiences and to discuss new ideas > >> >> >> for MEG > >> >> >> and EEG analysis. See also > >> >> >> http://listserv.surfnet.nl/archives/fieldtrip.html and > >> >> >> http://www.ru.nl/neuroimaging/fieldtrip. > >> >> > > >> >> > ---------------------------------- > >> >> > The aim of this list is to facilitate the discussion between users > >> >> > of the FieldTrip  toolbox, to share experiences and to discuss new > >> >> > ideas for MEG and EEG analysis. See also > >> >> http://listserv.surfnet.nl/archives/fieldtrip.html > >> >> >  and http://www.ru.nl/neuroimaging/fieldtrip. > >> >> > >> > > >> > > >> > > >> > > > > > > > > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From am236 at GEORGETOWN.EDU Thu Jul 9 04:43:39 2009 From: am236 at GEORGETOWN.EDU (Andrei Medvedev) Date: Wed, 8 Jul 2009 22:43:39 -0400 Subject: beamformer source localization for EEG Message-ID: Dear Fieldtrip developers/users I am a relatively recent user of Fieldtrip (and very much appreciative of this software). Having good experience with the analysis of brain oscillations etc, I now want to proceed with source reconstruction and it appeared that I need some help with the beamformer technique for EEG data. I am trying to use it for EEG data collected with a 128-channel EGI system. I also have structural MRI data for my subjects and would like to use realistic head models etc. I was following the Fieldtrip tutorial (1) “Localizing oscillatory sources using beamformer techniques”, which applies this method to MEG data. My understanding is that the only difference I would make when applying this approach to EEG is that, instead of the command vol = prepare_singleshell(cfg, segmentedmriF); which implements Nolte’s approach for MEG data, I need to make a BEM model for EEG data and I thought that I could use an example Matlab script (2) “Create BEM headmodel for EEG” from the Fieldtrip site. This would give me a vol variable which I then use to calculate the grid variable using [grid] = prepare_leadfield(cfg); and the rest is the same as in tutorial (1). Q1. Is it a correct sequence of steps to do source reconstruction for EEG data in Fieldtrip or do I need to do something more different? Q2. My second question is about the function strel_bol() which I am not familiar with (it is used in script (2)). One can see from the script that it is a structural element function used in the Image Processing toolbox but this toolbox has only function strel(). Could you please explain what the strel_bol(5) is? Can it be replaced by something like strel('disk',5)? Your help is very much appreciated! Thank you, Andrei. Andrei Medvedev, PhD Assistant Professor, EEG and Optical Imaging Lab Center for Functional and Molecular Imaging Georgetown University Washington DC, 20057 From mark.drakesmith at POSTGRAD.MANCHESTER.AC.UK Thu Jul 9 16:29:41 2009 From: mark.drakesmith at POSTGRAD.MANCHESTER.AC.UK (Mark Drakesmith) Date: Thu, 9 Jul 2009 15:29:41 +0100 Subject: beamformer source localization for EEG In-Reply-To: <20090708224339.AEY51491@mstore-prod-1.pdc.uis.georgetown.edu> Message-ID: Hi. I ran into the same problem with strel_bol when trying to create a BEM model. It relies on a custom script which implements the strel command in the image processing toolbox. The script can be found in the message archives here: https://listserv.surfnet.nl/scripts/wa.exe?A2=ind0703&L=FIELDTRIP&P=R14835&D=0 Regards, Mark -- Mark Drakesmith PhD Student Neuroscience and Aphasia Research Unit (NARU) University of Manchester Andrei Medvedev wrote: > Dear Fieldtrip developers/users > > I am a relatively recent user of Fieldtrip (and very much appreciative of this software). Having good experience with the analysis of brain oscillations etc, I now want to proceed with source reconstruction and it appeared that I need some help with the beamformer technique for EEG data. I am trying to use it for EEG data collected with a 128-channel EGI system. I also have structural MRI data for my subjects and would like to use realistic head models etc. I was following the Fieldtrip tutorial (1) “Localizing oscillatory sources using beamformer techniques”, which applies this method to MEG data. My understanding is that the only difference I would make when applying this approach to EEG is that, instead of the command > > vol = prepare_singleshell(cfg, segmentedmriF); > > which implements Nolte’s approach for MEG data, I need to make a BEM model for EEG data and I thought that I could use an example Matlab script (2) “Create BEM headmodel for EEG” from the Fieldtrip site. This would give me a vol variable which I then use to calculate the grid variable using > > [grid] = prepare_leadfield(cfg); > > and the rest is the same as in tutorial (1). > > Q1. Is it a correct sequence of steps to do source reconstruction for EEG data in Fieldtrip or do I need to do something more different? > > Q2. My second question is about the function strel_bol() which I am not familiar with (it is used in script (2)). One can see from the script that it is a structural element function used in the Image Processing toolbox but this toolbox has only function strel(). Could you please explain what the strel_bol(5) is? Can it be replaced by something like strel('disk',5)? > > Your help is very much appreciated! > > Thank you, > > Andrei. > > Andrei Medvedev, PhD > Assistant Professor, > EEG and Optical Imaging Lab > Center for Functional and Molecular Imaging > Georgetown University > Washington DC, 20057 > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Thu Jul 9 20:26:58 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Thu, 9 Jul 2009 20:26:58 +0200 Subject: Neuromag-fif-mri from mne to fieldtrip. Message-ID: Dear all, An update on my progress reading .fif mri's with fieldtrip (using the mne toolbox). I'm happy to announce it worked! Thanks to Roberts new script and Jan-Mathijs' suggestion to swap the x and y coordinates of the vol.bnd.pnt variable. I used the realignment to mni template which can be found in one of the example scripts (I think that is a creation of Ingrids) and found out that also the x and y coordinates of the normalized-to-mni mri should be swapped. My batch script can now be found at: http://fieldtrip.fcdonders.nl/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space I hope that helps more neuromag-meg-people! Thanks for your help! Yours, Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen Gesendet: Mi 08.07.2009 10:22 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] Neuromag-fif-mri from mne to fieldtrip. Hi Hanneke, Please note that the X and Y axis in the neuromag head-coordinate system are swapped with respect to the CTF and 4D convention; i.e. X axis through the ears, and Y-axis to the nose. What usually works for me is discarding the mri.transform (mri = rmfield(mri, 'transform'), and call volumerealign in the interactive mode. You can then specify the location of the fiducials yourself and the output mri of the function will contain a transformation matrix according to ctf convention. This at least ensures that volumesegment etc kind of work properly. Yet, it is important to know that of course the gradiometer positions in the data are defined in neuromag convention, so after preparing your volume conduction model you probably have to swap the x and y coordinates of the vol.bnd.pnt (assuming you use a singleshell as volume conductor model), before proceeding to visualization (headmodelplot; just to check whether the head fits in the helmet), leadfield computation (only makes sense if the head fits in the helmet), and sourceanalysis (idem). Yours, JM On Jul 8, 2009, at 9:09 AM, Robert Oostenveld wrote: > Hi Hanneke, > > I have tried importing another MRI fif file which I still had on > disk using the following modification of the fieldtrip/fileio/ > read_mri.m code > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > %%%%%%%%%%%%%% > elseif filetype(filename, 'neuromag_fif') && hastoolbox('mne') > % use the mne functions to read the Neuromag MRI > hdr = fiff_read_mri(filename); > img = cat(3, hdr.slices.data); > hdr.slices = rmfield(hdr.slices, 'data'); % remove the image data > to save memory > transform = hdr.trans.trans; > > and then slightly further down in the code > > % set up the axes of the volume in voxel coordinates > nx = size(img,1); > ny = size(img,2); > nz = size(img,3); > mri.dim = [nx ny nz]; > % store the anatomical data > mri.anatomy = img; > % store the header with all fileformat specific details > mri.hdr = hdr; > try > % if present, store the homogenous transformation matrix > mri.transform = transform; > end > > This results in a warning of the MNE fiff_read_mri function > > >> mri = read_mri('lp_mri_headcoords.fif') > Reading slice information and pixel data..50..100..126..[done] > The slices are not equally spaced. Voxel transformation will not > be included > > mri = > dim: [256 256 126] > anatomy: [256x256x126 int16] > hdr: [1x1 struct] > transform: [4x4 double] > > and the resulting coordinate transformation matrix is not fully > correct. You can check the coordinates by plotting it intreactively > in sourceplot (after converting the image data from int16 into > double). > > Perhaps one of the Neuromag experts on the list can help you further. > > best regards, > Robert > > PS atatched is the latest read_mri function, which includes the > call to fiff_read_mri. > > > On 8 Jul 2009, at 9:49, Robert Oostenveld wrote: > >> Hi Hanneke, >> >> The mri.fif file that you sent only contains the header >> information, but not the slice/image information. >> >> >> fiff_read_mri('mri.fif') >> Reading slice information and pixel data.??? Error using ==> >> fiff_read_mri at 116 >> Could not locate pixel file /neuro/mri/k/kahlbrock_nina/slices/ >> MR1.3.12.2.1107.5.2.32.35204.2008010817494654069656329 >> >> Please also send the corresponding slice data. >> >> Robert >> >> >> On 8 Jul 2009, at 9:01, Hanneke Van Dijk wrote: >> >>> Hi Robert, >>> >>> Thanks for your reply. I have tried the meg_pd function loadmri >>> (via read_mri in fieldtrip) but I got the feedback: 'error >>> loading mri-file'. So I have no idea what is going wrong. I will >>> send you the example mri-file right now. It is probably not to >>> difficult to work something out but I want to be sure that the >>> mri head coordinates end up in the right way as device coordinates. >>> >>> Thanks in advance! >>> Viele Gruße aus Düsseldorf ;-) >>> >>> Hanneke >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http:// >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ >> neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/ > fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Fri Jul 10 14:13:06 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 10 Jul 2009 14:13:06 +0200 Subject: beamformer source localization for EEG In-Reply-To: <20090708224339.AEY51491@mstore-prod-1.pdc.uis.georgetown.edu> Message-ID: On 9 Jul 2009, at 4:43, Andrei Medvedev wrote: > Q1. Is it a correct sequence of steps to do source reconstruction > for EEG data in Fieldtrip or do I need to do something more different? Hi Andrei You'll also have to ensure that the EEG data that you are analyzing is average referenced over all electrodes that you intend to use during source reconstruction. The averager referencing should be done prior to freqanalysis. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 10 16:08:37 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Fri, 10 Jul 2009 16:08:37 +0200 Subject: sourceinterpolation coordinates. Message-ID: Dear all, I have entered the next step: sourceanalysis. But I have encountered another problem, I think in sourceinterpolation or maybe volumenormalise. After running the script as I have described before (to make the headmodel and the grid) I do the following; load f %load frequency data cfg = []; cfg.grid = grid; cfg.frequency = 10; cfg.vol = hdm; cfg.grad = f.grad; cfg.projectnoise = 'yes'; cfg.lambda = 5e-28; cfg.method = 'dics'; cfg.feedback = 'textbar'; source = sourceanalysis(cfg,f); then: sd = sourcedescriptives([],source); then: load norm %normalized to MNI brain of single subject sdint = sourceinterpolate([], sd , norm); clear norm %plotting the results cfg.funparameter = 'avg.nai'; cfg.anaparameter = 'anatomy'; cfg.funcolormap = 'jet'; cfg.method = 'ortho'; cfg.projmethod = 'nearest'; cfg.sphereradius = 20; cfg.surffile = 'surface_l4_both'; figure; sourceplot(cfg,sdint) The result is attached to this email, the gird seems to have moved upwards and somewhat to the front relative to the normalised mri. But it seems to have the right size. I have been playing around with sourceunits mriunits x-y coordinates but nothing helps, or it makes it even worse. Does anybody have an idea what's happening? Yours, Hanneke www.linkedin.com/in/hannekevandijk tel. +49 (0)211 81 13074 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 10 16:23:32 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke van Dijk) Date: Fri, 10 Jul 2009 16:23:32 +0200 Subject: sourceinterpolation coordinates. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F3486@Mail2-UKD.VMED.UKD> Message-ID: Now there is an attachment too! sorry On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > Dear all, > > I have entered the next step: sourceanalysis. But I have encountered > another problem, I think in sourceinterpolation or maybe volumenormalise. > > After running the script as I have described before (to make the headmodel > and the grid) I do the following; > > load f %load frequency data > cfg = []; > cfg.grid = grid; > cfg.frequency = 10; > cfg.vol = hdm; > cfg.grad = f.grad; > cfg.projectnoise = 'yes'; > cfg.lambda = 5e-28; > cfg.method = 'dics'; > cfg.feedback = 'textbar'; > > source = sourceanalysis(cfg,f); > > then: > > sd = sourcedescriptives([],source); > > then: > > load norm %normalized to MNI brain of single subject > sdint = sourceinterpolate([], sd , norm); > clear norm > %plotting the results > cfg.funparameter = 'avg.nai'; > cfg.anaparameter = 'anatomy'; > cfg.funcolormap = 'jet'; > cfg.method = 'ortho'; > cfg.projmethod = 'nearest'; > cfg.sphereradius = 20; > cfg.surffile = 'surface_l4_both'; > figure; > sourceplot(cfg,sdint) > > The result is attached to this email, the gird seems to have moved upwards > and somewhat to the front relative to the normalised mri. But it seems to > have the right size. I have been playing around with sourceunits mriunits > x-y coordinates but nothing helps, or it makes it even worse. > > Does anybody have an idea what's happening? > > Yours, > Hanneke > > www.linkedin.com/in/hannekevandijk > tel. +49 (0)211 81 13074 > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: source.jpg Type: image/jpeg Size: 21500 bytes Desc: not available URL: From chintan_student at YAHOO.CO.IN Sat Jul 11 00:33:12 2009 From: chintan_student at YAHOO.CO.IN (shah chintan) Date: Sat, 11 Jul 2009 04:03:12 +0530 Subject: time frequency analysis In-Reply-To: <20358EAF-D21B-4F0C-AF51-6CD647ABF0A1@fcdonders.ru.nl> Message-ID: HI,   I have very simple problem. Actually I got time frequency data in excel sheet.  Its a data of 81 channels.   Now how can I plot the graphs and load the data in fieldtrip.  The final result I want is to plot the data on scalp.    Thanking you   Chintan Looking for local information? Find it on Yahoo! Local http://in.local.yahoo.com/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrian.m.bartlett at GMAIL.COM Sat Jul 11 01:09:07 2009 From: adrian.m.bartlett at GMAIL.COM (Adrian Bartlett) Date: Fri, 10 Jul 2009 19:09:07 -0400 Subject: time frequency analysis In-Reply-To: <335136.49897.qm@web95411.mail.in2.yahoo.com> Message-ID: Chintan: To read in your data to MATLAB from an excel spread sheet; you'll need to use the xlsread function. The rest should follow from the basic tutorial on the site. Hope that helps. On Fri, Jul 10, 2009 at 6:33 PM, shah chintan wrote: > HI, > > I have very simple problem. Actually I got time frequency data in excel > sheet. Its a data of 81 channels. Now how can I plot the graphs and load > the data in fieldtrip. The final result I want is to plot the data on > scalp. > > Thanking you > > Chintan > > ------------------------------ > Love Cricket? Check out live scores, photos, video highlights and more. Click > here . > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > -- Adrian M. Bartlett, BA Neuroscience Graduate Diploma Program Graduate Program in Psychology Perception & Plasticity Laboratory Centre for Vision Research York University, Toronto, ON, Canada -- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Mon Jul 13 10:42:02 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 13 Jul 2009 09:42:02 +0100 Subject: sourceinterpolation coordinates. In-Reply-To: Message-ID: Hi Hanneke, This looks like a difference in origin to me. Note that the MNI coordinate system has the cardinal axes pointing in the same directions as the neuromag headcoordinate system, but that the origin is different. The origin of the NM-headcoordinate system is on the interauricular line, the point where the y-axis hits it. This is approximately somewhere close or in the pons. The MNI origin is the AC, which is somewhere 'higher' in the volume. I suspect that the preparation of the grids did not work out without flaws. Alternatively, which I think is the most likely explanation, is that you should use the MNI-template as an MRI for the interpolation, rather than a normalized single subject MRI. I don't know about the single subject MRIs, but at least the MNI-template is explicitly in MNI-space, whereas the normalized MRI could be in head-space. This could explain the shift. Anyway, if the latter hunch is the explanation, then the sourceanalysis results might be trusted, if the first hunch was the one, the sourceanalysis results are most certainly wrong. As a matter of fact the whole swapping around with coordinates should not be necessary if the basic fieldtrip-code is adjusted such that it can handle neuromag-based headcoordinate systems in an appropriate way. This relates to an earlier remark on the list, which rightfully states that the approach you (we) have been taken so far seems a bit tedious. Ideally, in other words, the middle man has to be taken out, which in this case is the intermediate transformation to a ctf-based coordinate system. Hope this helps, JM Quoting Hanneke van Dijk : > Now there is an attachment too! sorry > > On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < > Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > >> Dear all, >> >> I have entered the next step: sourceanalysis. But I have encountered >> another problem, I think in sourceinterpolation or maybe volumenormalise. >> >> After running the script as I have described before (to make the headmodel >> and the grid) I do the following; >> >> load f %load frequency data >> cfg = []; >> cfg.grid = grid; >> cfg.frequency = 10; >> cfg.vol = hdm; >> cfg.grad = f.grad; >> cfg.projectnoise = 'yes'; >> cfg.lambda = 5e-28; >> cfg.method = 'dics'; >> cfg.feedback = 'textbar'; >> >> source = sourceanalysis(cfg,f); >> >> then: >> >> sd = sourcedescriptives([],source); >> >> then: >> >> load norm %normalized to MNI brain of single subject >> sdint = sourceinterpolate([], sd , norm); >> clear norm >> %plotting the results >> cfg.funparameter = 'avg.nai'; >> cfg.anaparameter = 'anatomy'; >> cfg.funcolormap = 'jet'; >> cfg.method = 'ortho'; >> cfg.projmethod = 'nearest'; >> cfg.sphereradius = 20; >> cfg.surffile = 'surface_l4_both'; >> figure; >> sourceplot(cfg,sdint) >> >> The result is attached to this email, the gird seems to have moved upwards >> and somewhat to the front relative to the normalised mri. But it seems to >> have the right size. I have been playing around with sourceunits mriunits >> x-y coordinates but nothing helps, or it makes it even worse. >> >> Does anybody have an idea what's happening? >> >> Yours, >> Hanneke >> >> www.linkedin.com/in/hannekevandijk >> tel. +49 (0)211 81 13074 >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ------------------------------------------------------------------ The University of Glasgow, Department of Psychology WebMail system ------------------------------------------------------------------ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From chintan_student at YAHOO.CO.IN Mon Jul 13 16:25:50 2009 From: chintan_student at YAHOO.CO.IN (shah chintan) Date: Mon, 13 Jul 2009 19:55:50 +0530 Subject: time frequency analysis. Message-ID: Hi,   I am not a regular user of fieldtrip.  I have a very simple problem to solve.  I have got a data of time frequency analysis in excel data.  Now my goal is to plot the 3d figure on scalp with this data.  Now I know the following steps to be done.   1.  As I got the data in excel sheet,  I need to load this excel data in matlab along with their channel names.  Given the range on both the axis.   2.  Now I need to load the channel locations   3.  Finally I need to tell matlab to plot this data on 3d scalp using those channel locations.   Now Please help me with this.   Best Regards,   Chintan   Yahoo! recommends that you upgrade to the new and safer Internet Explorer 8. http://downloads.yahoo.com/in/internetexplorer/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Thu Jul 16 16:21:55 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Thu, 16 Jul 2009 16:21:55 +0200 Subject: AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. Message-ID: Hi Jan-Mathijs, Thanks for your suggestions and your time, but I haven't been able to fix it.... I agree that this work-around shouldn't be neccesary but I guess we first have to know what to fix.... You suggested to use the template_mri in MNI coordinates to interpolate to that seemed simple so I tried it immediately, however it didn't help. It didn't change a thing. So your other suggestion about the origin being different should be looked at, but this raised a few questions.. First, I thought because I had realigned the mri to ctf coordinates using volumerealign, the NM coordinates wouldn't matter anymore. Second, the headmodel I have created using the realigned, segmented and flipped mri looks very good to me relative to the gradiometer locations and the grid as well. (see http://fieldtrip.fcdonders.nl/example/read_neuromag_mri_and_create_single-subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_space). Additionally, the alpha source that I found using this headmodel and looking at the grid only (without the interpolation) looked believable as well. I have also segmentated the volumenormalised mri, which actually makes the later produced single_shell headmodel go downward and posterior as well. While the grid stays the same and 'goodlooking' ;-). So I am inclined to think that something strange is happening during the volumenormalise or sourceinterpolation procedure moving the mri slightly downward and more posterior. I would fix it myself but I don't know where I should look... it also puzzles me why this only happens 'for from NM- to ctf coordinates realigned' mri's. It seems that fieldtrip remembers that the mri was originally a NM... Hope you or someone else can help me further... Groetjes Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen Gesendet: Mo 13.07.2009 10:42 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. Hi Hanneke, This looks like a difference in origin to me. Note that the MNI coordinate system has the cardinal axes pointing in the same directions as the neuromag headcoordinate system, but that the origin is different. The origin of the NM-headcoordinate system is on the interauricular line, the point where the y-axis hits it. This is approximately somewhere close or in the pons. The MNI origin is the AC, which is somewhere 'higher' in the volume. I suspect that the preparation of the grids did not work out without flaws. Alternatively, which I think is the most likely explanation, is that you should use the MNI-template as an MRI for the interpolation, rather than a normalized single subject MRI. I don't know about the single subject MRIs, but at least the MNI-template is explicitly in MNI-space, whereas the normalized MRI could be in head-space. This could explain the shift. Anyway, if the latter hunch is the explanation, then the sourceanalysis results might be trusted, if the first hunch was the one, the sourceanalysis results are most certainly wrong. As a matter of fact the whole swapping around with coordinates should not be necessary if the basic fieldtrip-code is adjusted such that it can handle neuromag-based headcoordinate systems in an appropriate way. This relates to an earlier remark on the list, which rightfully states that the approach you (we) have been taken so far seems a bit tedious. Ideally, in other words, the middle man has to be taken out, which in this case is the intermediate transformation to a ctf-based coordinate system. Hope this helps, JM Quoting Hanneke van Dijk : > Now there is an attachment too! sorry > > On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < > Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: > >> Dear all, >> >> I have entered the next step: sourceanalysis. But I have encountered >> another problem, I think in sourceinterpolation or maybe volumenormalise. >> >> After running the script as I have described before (to make the headmodel >> and the grid) I do the following; >> >> load f %load frequency data >> cfg = []; >> cfg.grid = grid; >> cfg.frequency = 10; >> cfg.vol = hdm; >> cfg.grad = f.grad; >> cfg.projectnoise = 'yes'; >> cfg.lambda = 5e-28; >> cfg.method = 'dics'; >> cfg.feedback = 'textbar'; >> >> source = sourceanalysis(cfg,f); >> >> then: >> >> sd = sourcedescriptives([],source); >> >> then: >> >> load norm %normalized to MNI brain of single subject >> sdint = sourceinterpolate([], sd , norm); >> clear norm >> %plotting the results >> cfg.funparameter = 'avg.nai'; >> cfg.anaparameter = 'anatomy'; >> cfg.funcolormap = 'jet'; >> cfg.method = 'ortho'; >> cfg.projmethod = 'nearest'; >> cfg.sphereradius = 20; >> cfg.surffile = 'surface_l4_both'; >> figure; >> sourceplot(cfg,sdint) >> >> The result is attached to this email, the gird seems to have moved upwards >> and somewhat to the front relative to the normalised mri. But it seems to >> have the right size. I have been playing around with sourceunits mriunits >> x-y coordinates but nothing helps, or it makes it even worse. >> >> Does anybody have an idea what's happening? >> >> Yours, >> Hanneke >> >> www.linkedin.com/in/hannekevandijk >> tel. +49 (0)211 81 13074 >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ------------------------------------------------------------------ The University of Glasgow, Department of Psychology WebMail system ------------------------------------------------------------------ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Thu Jul 16 17:04:14 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 16 Jul 2009 16:04:14 +0100 Subject: AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F3490@Mail2-UKD.VMED.UKD> Message-ID: Hi Hanneke, source.pos should contain the MNI-based coordinates before calling sourceinterpolate; I suspect that your single subject source data contains the original (neuromag-space) positions. This is of course how it should be for the sourceanalysis, because there the grid points have to be defined in neuromag space. Yet, for the interpolation this is wrong, because sourceinterpolate assumes that the coordinate frames of both mri and functional volume are the same. Because the neuromag coordinates are shifted with respect to the MNI- coordinates, this still could explain the discrepancy. I suggest to replace sd.pos with template_grid.pos before calling sourceinterpolate. Best, Jan-Mathijs On Jul 16, 2009, at 3:21 PM, Hanneke Van Dijk wrote: > Hi Jan-Mathijs, > > Thanks for your suggestions and your time, but I haven't been able > to fix it.... > > I agree that this work-around shouldn't be neccesary but I guess we > first have to know what to fix.... > > You suggested to use the template_mri in MNI coordinates to > interpolate to that seemed simple so I tried it immediately, > however it didn't help. It didn't change a thing. > > So your other suggestion about the origin being different should be > looked at, but this raised a few questions.. > First, I thought because I had realigned the mri to ctf coordinates > using volumerealign, the NM coordinates wouldn't matter anymore. > Second, the headmodel I have created using the realigned, segmented > and flipped mri looks very good to me relative to the gradiometer > locations and the grid as well. > (see http://fieldtrip.fcdonders.nl/example/ > read_neuromag_mri_and_create_single- > subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_spa > ce). Additionally, the alpha source that I found using this > headmodel and looking at the grid only (without the interpolation) > looked believable as well. > > I have also segmentated the volumenormalised mri, which actually > makes the later produced single_shell headmodel go downward and > posterior as well. While the grid stays the same and > 'goodlooking' ;-). > So I am inclined to think that something strange is happening > during the volumenormalise or sourceinterpolation procedure moving > the mri slightly downward and more posterior. I would fix it myself > but I don't know where I should look... it also puzzles me why this > only happens 'for from NM- to ctf coordinates realigned' mri's. It > seems that fieldtrip remembers that the mri was originally a NM... > > Hope you or someone else can help me further... > > Groetjes Hanneke > > > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen > Gesendet: Mo 13.07.2009 10:42 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. > > Hi Hanneke, > > This looks like a difference in origin to me. Note that the MNI > coordinate system has the cardinal axes pointing in the same > directions as the neuromag headcoordinate system, but that the origin > is different. The origin of the NM-headcoordinate system is on the > interauricular line, the point where the y-axis hits it. This is > approximately somewhere close or in the pons. The MNI origin is the > AC, which is somewhere 'higher' in the volume. I suspect that the > preparation of the grids did not work out without flaws. > Alternatively, which I think is the most likely explanation, is that > you should use the MNI-template as an MRI for the interpolation, > rather than a normalized single subject MRI. I don't know about the > single subject MRIs, but at least the MNI-template is explicitly in > MNI-space, whereas the normalized MRI could be in head-space. This > could explain the shift. > Anyway, if the latter hunch is the explanation, then the > sourceanalysis results might be trusted, if the first hunch was the > one, the sourceanalysis results are most certainly wrong. > > As a matter of fact the whole swapping around with coordinates should > not be necessary if the basic fieldtrip-code is adjusted such that it > can handle neuromag-based headcoordinate systems in an appropriate > way. This relates to an earlier remark on the list, which rightfully > states that the approach you (we) have been taken so far seems a bit > tedious. Ideally, in other words, the middle man has to be taken out, > which in this case is the intermediate transformation to a ctf-based > coordinate system. > > Hope this helps, > > JM > > > Quoting Hanneke van Dijk : > >> Now there is an attachment too! sorry >> >> On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < >> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >> >>> Dear all, >>> >>> I have entered the next step: sourceanalysis. But I have encountered >>> another problem, I think in sourceinterpolation or maybe >>> volumenormalise. >>> >>> After running the script as I have described before (to make the >>> headmodel >>> and the grid) I do the following; >>> >>> load f %load frequency data >>> cfg = []; >>> cfg.grid = grid; >>> cfg.frequency = 10; >>> cfg.vol = hdm; >>> cfg.grad = f.grad; >>> cfg.projectnoise = 'yes'; >>> cfg.lambda = 5e-28; >>> cfg.method = 'dics'; >>> cfg.feedback = 'textbar'; >>> >>> source = sourceanalysis(cfg,f); >>> >>> then: >>> >>> sd = sourcedescriptives([],source); >>> >>> then: >>> >>> load norm %normalized to MNI brain of single subject >>> sdint = sourceinterpolate([], sd , norm); >>> clear norm >>> %plotting the results >>> cfg.funparameter = 'avg.nai'; >>> cfg.anaparameter = 'anatomy'; >>> cfg.funcolormap = 'jet'; >>> cfg.method = 'ortho'; >>> cfg.projmethod = 'nearest'; >>> cfg.sphereradius = 20; >>> cfg.surffile = 'surface_l4_both'; >>> figure; >>> sourceplot(cfg,sdint) >>> >>> The result is attached to this email, the gird seems to have >>> moved upwards >>> and somewhat to the front relative to the normalised mri. But it >>> seems to >>> have the right size. I have been playing around with sourceunits >>> mriunits >>> x-y coordinates but nothing helps, or it makes it even worse. >>> >>> Does anybody have an idea what's happening? >>> >>> Yours, >>> Hanneke >>> >>> www.linkedin.com/in/hannekevandijk >>> tel. +49 (0)211 81 13074 >>> >>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of the >>> FieldTrip toolbox, to share experiences and to discuss new ideas >>> for MEG >>> and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>> http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > > > ------------------------------------------------------------------ > The University of Glasgow, Department of Psychology WebMail system > ------------------------------------------------------------------ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jrkerlin at UCDAVIS.EDU Thu Jul 16 19:57:58 2009 From: jrkerlin at UCDAVIS.EDU (Jess R. Kerlin) Date: Thu, 16 Jul 2009 10:57:58 -0700 Subject: beamformer source localization for EEG In-Reply-To: <20358EAF-D21B-4F0C-AF51-6CD647ABF0A1@fcdonders.ru.nl> Message-ID: Hi FTers, I'm using a 128 electrode Biosemi EEG system, attempting to perform beam-former source analysis. I had go all the way back to Matlab 6.5 and SPM 2, as well as some trial and error to get through it, but I finally managed to get a nolte BEM using mostly the same code as in the example script "BEM head model for EEG" script". However, prepare_leadfield throws the error "unsupported volume conductor model for EEG", which is clearly the case looking at the prepare_leadfield code. A few questions on this topic: Does fieldtrip actually support beamforming source localization on BEM models for EEG? Or, given the coarser spatial resolution of EEG, is it better to use a simpler spherical model? Either way, does anyone have successful sample code for beamformer localization EEG data, start to finish? And for the developers: I love your work. I notice the move from SPM 2 to SPM 8 is in the development cue. Is there any release coming soon which will use SPM 8 to make this process smoother? Many thanks, Jess Kerlin Robert Oostenveld wrote: > On 9 Jul 2009, at 4:43, Andrei Medvedev wrote: >> Q1. Is it a correct sequence of steps to do source reconstruction for >> EEG data in Fieldtrip or do I need to do something more different? > > Hi Andrei > > You'll also have to ensure that the EEG data that you are analyzing is > average referenced over all electrodes that you intend to use during > source reconstruction. The averager referencing should be done prior > to freqanalysis. > > best regards, > Robert > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From v.litvak at ION.UCL.AC.UK Thu Jul 16 20:37:40 2009 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Thu, 16 Jul 2009 19:37:40 +0100 Subject: beamformer source localization for EEG In-Reply-To: <4A5F6A26.9060404@ucdavis.edu> Message-ID: Dear Jess and others, SPM8 and Fieldtrip share infrastructure for forward modelling and leadfield computation. Therefore, you can use SPM8 to prepare head model and sensor definition that you can later use for FT beamforming. This works for both EEG and MEG. MEEGTools toolbox in SPM8 contains some functions that you can use as examples for where to find vol and sens in SPM8 dataset. You'll need to go through SPM8 processing stream (at least with some sample data). Look at the manual for additional instructions. Best, Vladimir On Thu, Jul 16, 2009 at 6:57 PM, Jess R. Kerlin wrote: > Hi FTers, > > I'm using a 128 electrode Biosemi EEG system, attempting to perform > beam-former source analysis. I had go all the way back to Matlab 6.5 and SPM > 2, as well as some trial and error to get through it,  but I finally managed > to get a nolte BEM  using mostly the same code as in the example script "BEM > head model for EEG" script". However, prepare_leadfield throws the error > "unsupported volume conductor model for EEG", which is clearly the case > looking at the prepare_leadfield code. > > A few questions on this topic: > > Does fieldtrip actually support beamforming source localization on BEM > models for EEG? Or, given the coarser spatial resolution of EEG, is it > better to use a simpler spherical model?  Either way, does anyone have > successful sample code for beamformer localization EEG data, start to > finish? > > And for the developers: > I love your work. > I notice the move from SPM 2 to SPM 8 is in the development cue.  Is there > any release coming soon which will use SPM 8 to make this process smoother? > > Many thanks, > > Jess Kerlin > > Robert Oostenveld wrote: >> >> On 9 Jul 2009, at 4:43, Andrei Medvedev wrote: >>> >>> Q1. Is it a correct sequence of steps to do source reconstruction for EEG >>> data in Fieldtrip or do I need to do something more different? >> >> Hi Andrei >> >> You'll also have to ensure that the EEG data that you are analyzing is >> average referenced over all electrodes that you intend to use during source >> reconstruction. The averager referencing should be done prior to >> freqanalysis. >> >> best regards, >> Robert >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From hungptit at GMAIL.COM Fri Jul 17 07:09:56 2009 From: hungptit at GMAIL.COM (Hung Dang) Date: Thu, 16 Jul 2009 23:09:56 -0600 Subject: beamformer source localization for EEG In-Reply-To: Message-ID: Dear all, We have known that beamformers and other good source localization techniques have zero localization error for single source. However, in real applications there are many sources inside the brain then we will have non-zero localization error. How can we justify which inverse solutions is better? Thanks a lot Hung ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE Fri Jul 17 08:50:31 2009 From: Hanneke.vanDijk at MED.UNI-DUESSELDORF.DE (Hanneke Van Dijk) Date: Fri, 17 Jul 2009 08:50:31 +0200 Subject: AW: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. Message-ID: Dear Jan-Matijs, It worked!!! Thanks so much! We should think of a way to fix the differences between handeling CTF and NM data. I will have a look at it! Yours, Hanneke -----Ursprüngliche Nachricht----- Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen Gesendet: Do 16.07.2009 17:04 An: FIELDTRIP at NIC.SURFNET.NL Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. Hi Hanneke, source.pos should contain the MNI-based coordinates before calling sourceinterpolate; I suspect that your single subject source data contains the original (neuromag-space) positions. This is of course how it should be for the sourceanalysis, because there the grid points have to be defined in neuromag space. Yet, for the interpolation this is wrong, because sourceinterpolate assumes that the coordinate frames of both mri and functional volume are the same. Because the neuromag coordinates are shifted with respect to the MNI- coordinates, this still could explain the discrepancy. I suggest to replace sd.pos with template_grid.pos before calling sourceinterpolate. Best, Jan-Mathijs On Jul 16, 2009, at 3:21 PM, Hanneke Van Dijk wrote: > Hi Jan-Mathijs, > > Thanks for your suggestions and your time, but I haven't been able > to fix it.... > > I agree that this work-around shouldn't be neccesary but I guess we > first have to know what to fix.... > > You suggested to use the template_mri in MNI coordinates to > interpolate to that seemed simple so I tried it immediately, > however it didn't help. It didn't change a thing. > > So your other suggestion about the origin being different should be > looked at, but this raised a few questions.. > First, I thought because I had realigned the mri to ctf coordinates > using volumerealign, the NM coordinates wouldn't matter anymore. > Second, the headmodel I have created using the realigned, segmented > and flipped mri looks very good to me relative to the gradiometer > locations and the grid as well. > (see http://fieldtrip.fcdonders.nl/example/ > read_neuromag_mri_and_create_single- > subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_spa > ce). Additionally, the alpha source that I found using this > headmodel and looking at the grid only (without the interpolation) > looked believable as well. > > I have also segmentated the volumenormalised mri, which actually > makes the later produced single_shell headmodel go downward and > posterior as well. While the grid stays the same and > 'goodlooking' ;-). > So I am inclined to think that something strange is happening > during the volumenormalise or sourceinterpolation procedure moving > the mri slightly downward and more posterior. I would fix it myself > but I don't know where I should look... it also puzzles me why this > only happens 'for from NM- to ctf coordinates realigned' mri's. It > seems that fieldtrip remembers that the mri was originally a NM... > > Hope you or someone else can help me further... > > Groetjes Hanneke > > > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen > Gesendet: Mo 13.07.2009 10:42 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. > > Hi Hanneke, > > This looks like a difference in origin to me. Note that the MNI > coordinate system has the cardinal axes pointing in the same > directions as the neuromag headcoordinate system, but that the origin > is different. The origin of the NM-headcoordinate system is on the > interauricular line, the point where the y-axis hits it. This is > approximately somewhere close or in the pons. The MNI origin is the > AC, which is somewhere 'higher' in the volume. I suspect that the > preparation of the grids did not work out without flaws. > Alternatively, which I think is the most likely explanation, is that > you should use the MNI-template as an MRI for the interpolation, > rather than a normalized single subject MRI. I don't know about the > single subject MRIs, but at least the MNI-template is explicitly in > MNI-space, whereas the normalized MRI could be in head-space. This > could explain the shift. > Anyway, if the latter hunch is the explanation, then the > sourceanalysis results might be trusted, if the first hunch was the > one, the sourceanalysis results are most certainly wrong. > > As a matter of fact the whole swapping around with coordinates should > not be necessary if the basic fieldtrip-code is adjusted such that it > can handle neuromag-based headcoordinate systems in an appropriate > way. This relates to an earlier remark on the list, which rightfully > states that the approach you (we) have been taken so far seems a bit > tedious. Ideally, in other words, the middle man has to be taken out, > which in this case is the intermediate transformation to a ctf-based > coordinate system. > > Hope this helps, > > JM > > > Quoting Hanneke van Dijk : > >> Now there is an attachment too! sorry >> >> On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < >> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >> >>> Dear all, >>> >>> I have entered the next step: sourceanalysis. But I have encountered >>> another problem, I think in sourceinterpolation or maybe >>> volumenormalise. >>> >>> After running the script as I have described before (to make the >>> headmodel >>> and the grid) I do the following; >>> >>> load f %load frequency data >>> cfg = []; >>> cfg.grid = grid; >>> cfg.frequency = 10; >>> cfg.vol = hdm; >>> cfg.grad = f.grad; >>> cfg.projectnoise = 'yes'; >>> cfg.lambda = 5e-28; >>> cfg.method = 'dics'; >>> cfg.feedback = 'textbar'; >>> >>> source = sourceanalysis(cfg,f); >>> >>> then: >>> >>> sd = sourcedescriptives([],source); >>> >>> then: >>> >>> load norm %normalized to MNI brain of single subject >>> sdint = sourceinterpolate([], sd , norm); >>> clear norm >>> %plotting the results >>> cfg.funparameter = 'avg.nai'; >>> cfg.anaparameter = 'anatomy'; >>> cfg.funcolormap = 'jet'; >>> cfg.method = 'ortho'; >>> cfg.projmethod = 'nearest'; >>> cfg.sphereradius = 20; >>> cfg.surffile = 'surface_l4_both'; >>> figure; >>> sourceplot(cfg,sdint) >>> >>> The result is attached to this email, the gird seems to have >>> moved upwards >>> and somewhat to the front relative to the normalised mri. But it >>> seems to >>> have the right size. I have been playing around with sourceunits >>> mriunits >>> x-y coordinates but nothing helps, or it makes it even worse. >>> >>> Does anybody have an idea what's happening? >>> >>> Yours, >>> Hanneke >>> >>> www.linkedin.com/in/hannekevandijk >>> tel. +49 (0)211 81 13074 >>> >>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between >>> users of the >>> FieldTrip toolbox, to share experiences and to discuss new ideas >>> for MEG >>> and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>> http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > > > ------------------------------------------------------------------ > The University of Glasgow, Department of Psychology WebMail system > ------------------------------------------------------------------ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri Jul 17 09:57:24 2009 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 17 Jul 2009 08:57:24 +0100 Subject: AW: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise sourceinterpolation coordinates. In-Reply-To: <72E993C35FB11743B79FF9286E5B6D8B0F3491@Mail2-UKD.VMED.UKD> Message-ID: Dear Hanneke, I am glad it worked out fine now. Note that the particular step which was bugging you is the same for both CTF and neuromag data. Best, JM On Jul 17, 2009, at 7:50 AM, Hanneke Van Dijk wrote: > Dear Jan-Matijs, > > It worked!!! Thanks so much! We should think of a way to fix the > differences between handeling CTF and NM data. I will have a look > at it! > > Yours, > > Hanneke > > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen > Gesendet: Do 16.07.2009 17:04 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] AW: [FIELDTRIP] MNI volumenormalise > sourceinterpolation coordinates. > > Hi Hanneke, > > source.pos should contain the MNI-based coordinates before calling > sourceinterpolate; I suspect that your single subject source data > contains the original (neuromag-space) positions. This is of course > how it should be for the sourceanalysis, because there the grid > points have to be defined in neuromag space. Yet, for the > interpolation this is wrong, because sourceinterpolate assumes that > the coordinate frames of both mri and functional volume are the same. > Because the neuromag coordinates are shifted with respect to the MNI- > coordinates, this still could explain the discrepancy. I suggest to > replace sd.pos with template_grid.pos before calling > sourceinterpolate. > > Best, > > Jan-Mathijs > > On Jul 16, 2009, at 3:21 PM, Hanneke Van Dijk wrote: > >> Hi Jan-Mathijs, >> >> Thanks for your suggestions and your time, but I haven't been able >> to fix it.... >> >> I agree that this work-around shouldn't be neccesary but I guess we >> first have to know what to fix.... >> >> You suggested to use the template_mri in MNI coordinates to >> interpolate to that seemed simple so I tried it immediately, >> however it didn't help. It didn't change a thing. >> >> So your other suggestion about the origin being different should be >> looked at, but this raised a few questions.. >> First, I thought because I had realigned the mri to ctf coordinates >> using volumerealign, the NM coordinates wouldn't matter anymore. >> Second, the headmodel I have created using the realigned, segmented >> and flipped mri looks very good to me relative to the gradiometer >> locations and the grid as well. >> (see http://fieldtrip.fcdonders.nl/example/ >> read_neuromag_mri_and_create_single- >> subject_grids_in_individual_head_space_that_are_all_aligned_in_mni_sp >> a >> ce). Additionally, the alpha source that I found using this >> headmodel and looking at the grid only (without the interpolation) >> looked believable as well. >> >> I have also segmentated the volumenormalised mri, which actually >> makes the later produced single_shell headmodel go downward and >> posterior as well. While the grid stays the same and >> 'goodlooking' ;-). >> So I am inclined to think that something strange is happening >> during the volumenormalise or sourceinterpolation procedure moving >> the mri slightly downward and more posterior. I would fix it myself >> but I don't know where I should look... it also puzzles me why this >> only happens 'for from NM- to ctf coordinates realigned' mri's. It >> seems that fieldtrip remembers that the mri was originally a NM... >> >> Hope you or someone else can help me further... >> >> Groetjes Hanneke >> >> >> -----Ursprüngliche Nachricht----- >> Von: FieldTrip discussion list im Auftrag von jan-mathijs schoffelen >> Gesendet: Mo 13.07.2009 10:42 >> An: FIELDTRIP at NIC.SURFNET.NL >> Betreff: Re: [FIELDTRIP] sourceinterpolation coordinates. >> >> Hi Hanneke, >> >> This looks like a difference in origin to me. Note that the MNI >> coordinate system has the cardinal axes pointing in the same >> directions as the neuromag headcoordinate system, but that the origin >> is different. The origin of the NM-headcoordinate system is on the >> interauricular line, the point where the y-axis hits it. This is >> approximately somewhere close or in the pons. The MNI origin is the >> AC, which is somewhere 'higher' in the volume. I suspect that the >> preparation of the grids did not work out without flaws. >> Alternatively, which I think is the most likely explanation, is that >> you should use the MNI-template as an MRI for the interpolation, >> rather than a normalized single subject MRI. I don't know about the >> single subject MRIs, but at least the MNI-template is explicitly in >> MNI-space, whereas the normalized MRI could be in head-space. This >> could explain the shift. >> Anyway, if the latter hunch is the explanation, then the >> sourceanalysis results might be trusted, if the first hunch was the >> one, the sourceanalysis results are most certainly wrong. >> >> As a matter of fact the whole swapping around with coordinates should >> not be necessary if the basic fieldtrip-code is adjusted such that it >> can handle neuromag-based headcoordinate systems in an appropriate >> way. This relates to an earlier remark on the list, which rightfully >> states that the approach you (we) have been taken so far seems a bit >> tedious. Ideally, in other words, the middle man has to be taken out, >> which in this case is the intermediate transformation to a ctf-based >> coordinate system. >> >> Hope this helps, >> >> JM >> >> >> Quoting Hanneke van Dijk : >> >>> Now there is an attachment too! sorry >>> >>> On Fri, Jul 10, 2009 at 4:08 PM, Hanneke Van Dijk < >>> Hanneke.vanDijk at med.uni-duesseldorf.de> wrote: >>> >>>> Dear all, >>>> >>>> I have entered the next step: sourceanalysis. But I have >>>> encountered >>>> another problem, I think in sourceinterpolation or maybe >>>> volumenormalise. >>>> >>>> After running the script as I have described before (to make the >>>> headmodel >>>> and the grid) I do the following; >>>> >>>> load f %load frequency data >>>> cfg = []; >>>> cfg.grid = grid; >>>> cfg.frequency = 10; >>>> cfg.vol = hdm; >>>> cfg.grad = f.grad; >>>> cfg.projectnoise = 'yes'; >>>> cfg.lambda = 5e-28; >>>> cfg.method = 'dics'; >>>> cfg.feedback = 'textbar'; >>>> >>>> source = sourceanalysis(cfg,f); >>>> >>>> then: >>>> >>>> sd = sourcedescriptives([],source); >>>> >>>> then: >>>> >>>> load norm %normalized to MNI brain of single subject >>>> sdint = sourceinterpolate([], sd , norm); >>>> clear norm >>>> %plotting the results >>>> cfg.funparameter = 'avg.nai'; >>>> cfg.anaparameter = 'anatomy'; >>>> cfg.funcolormap = 'jet'; >>>> cfg.method = 'ortho'; >>>> cfg.projmethod = 'nearest'; >>>> cfg.sphereradius = 20; >>>> cfg.surffile = 'surface_l4_both'; >>>> figure; >>>> sourceplot(cfg,sdint) >>>> >>>> The result is attached to this email, the gird seems to have >>>> moved upwards >>>> and somewhat to the front relative to the normalised mri. But it >>>> seems to >>>> have the right size. I have been playing around with sourceunits >>>> mriunits >>>> x-y coordinates but nothing helps, or it makes it even worse. >>>> >>>> Does anybody have an idea what's happening? >>>> >>>> Yours, >>>> Hanneke >>>> >>>> www.linkedin.com/in/hannekevandijk >>>> tel. +49 (0)211 81 13074 >>>> >>>> >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between >>>> users of the >>>> FieldTrip toolbox, to share experiences and to discuss new ideas >>>> for MEG >>>> and EEG analysis. See also >>>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>>> http://www.ru.nl/neuroimaging/fieldtrip. >>>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html and >>> http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> >> >> ------------------------------------------------------------------ >> The University of Glasgow, Department of Psychology WebMail system >> ------------------------------------------------------------------ >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From hungptit at GMAIL.COM Fri Jul 17 17:56:41 2009 From: hungptit at GMAIL.COM (Hung - Gmail) Date: Fri, 17 Jul 2009 09:56:41 -0600 Subject: beamformer source localization for EEG In-Reply-To: Message-ID: Dear all, We have known that beamformers and other good source localization techniques have zero localization error for single source cases. However, in real applications there are many sources inside the brain then we will have non-zero localization error. How can we justify which inverse solutions is better for multiple source cases? Thanks a lot Hung ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From bleichner.martin at GMAIL.COM Fri Jul 24 11:14:08 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Fri, 24 Jul 2009 11:14:08 +0200 Subject: Common Average reference - excluding channels Message-ID: Hello together, I want to compute the common average reference for an ecog dataset. But I have to exlude some of the channels due to epileptic activity. I am currenlty using the code below. Do I have to specify the channels I would like to include in my CAR in cfg.channels or in cfg.refchannel? Thanks a lot Martin cfg=[]; cfg.trackconfig='cleanup'; %compute common average reference cfg.channels=ch_in_avref; cfg.reref='yes'; cfg.refchannel='all'; %filter out the line noise using bandstop filter cfg.bsfilter='yes'; cfg.bsfiltord=3; cfg.bsfreq=[49.5 50.5; 99.5, 100.5]; data=preprocessing(cfg,data); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bleichner.martin at GMAIL.COM Fri Jul 24 15:14:30 2009 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Fri, 24 Jul 2009 15:14:30 +0200 Subject: Postdoc in BCI signal processing Message-ID: *Postdoc in BCI signal processing* The Rudolf Magnus Institute in Utrecht, The Netherlands is looking for a highly motivated postdoc interested in neural signal processing for Brain Computer Interfacing. The Utrecht BCI group, led by Prof. dr. Nick Ramsey, is part of the Department of Neurology and Neurosurgery at the University Medical Center Utrecht and participates in the nationwide BrainGain Consortium, which is devoted to application of Brain Computer Interfaces for patients and healthy individuals. The main focus of the group is conducting neuroscience research towards an invasive BCI application for paralyzed patients. We perform experiments with both healthy subjects and patients (~10 patients with electrode implants available for research each year). Available techniques: 128-channel EEG systems for extracranial and intracranial (ECoG) recordings, fMRI (1.5, 3 and 7 T human Philips systems), TMS and 64-channel intraoperative recordings in awake neurosurgery. Our highly interdisciplinary group consists of 4 postdocs, 10 PhD students and 6 master students, who have a background in neuroscience, psychology, biology or physics and their own expertise in the research field. The postdoc is expected to investigate new ECoG signal processing techniques for BCI purposes, as well as for cognitive neuroscience research. He/she will work in close collaboration with neuroscientists and needs to have excellent communication skills. The candidate is likely to have a PhD in biomedical engineering, computational neuroscience, electrical engineering or physics, with a record of publications. Solid experience in signal processing of any kind and excellent programming skills in Matlab are required. Experience in neuroscience is not a prerequisite, but we expect the candidate to acquire knowledge of underlying psychological and biological processes. Earliest starting date of the two-year position is July 1st, 2009. Application deadline is September 1st, 2009. Applications and information requests can be sent to Prof. dr. Nick Ramsey, Rudolf Magnus Institute of Neuroscience, Dept. of Neurology and Neurosurgery, Division of Neuroscience, University Medical Center Utrecht, Room G.03.122, Heidelberglaan 100, 3584 CX, Utrecht, Netherlands, n.f.ramsey at umcutrecht.nl. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From akiko at NYU.EDU Wed Jul 29 00:56:37 2009 From: akiko at NYU.EDU (Akiko Ikkai) Date: Wed, 29 Jul 2009 00:56:37 +0200 Subject: prepare_layout #input? Message-ID: Hi, I'm new to Fieldtrip, and am using fieldtrip-20090715 version. I'm making .lay file for our intracranial EEG data, and realized that prepare_layout.m requires 6 entries (chNum,X,Y,Width,Height,Lbl,Rem), whereas on the website ( http://fieldtrip.fcdonders.nl/tutorial/layout ) it says, "The 1st column is the channel number in the layout file, it is not used any more.". prepare_layout.m runs when I add chNum to my .lay, OR change line 743 of prepare_layout.m to [X,Y,Width,Height,Lbl,Rem] = textread(filename,'%f %f %f %f %q %q'); For the future reference, I'm wondering which is more recent way to write .lay files.... with, or without chNum? Thanks in advance! Akiko Akiko Ikkai PhD Candidate Department of Psychology New York University 6 Washington Place New York NY, 10003 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ingrid.nieuwenhuis at DONDERS.RU.NL Wed Jul 29 10:28:38 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Wed, 29 Jul 2009 10:28:38 +0200 Subject: prepare_layout #input? In-Reply-To: Message-ID: Dear Akiko, You're right that it is a bit confusing the way it is stated right now at the wiki. What is meant is that the first column is not used any more during the plotting by the plotting functions. But all FieldTrip functions do expect that that there is a first column present in the layout file containing the channel number. So when you are making a .lay file you should indeed add that column (although what is in there is totally ignored by the plotting functions). So the six columns in the layout file should be: chNum, X, Y, Width, Height, Lbl. I've modified the wiki, hope it is clearer now. All the best, Ingrid ___________________________________ Ingrid Nieuwenhuis PhD student Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging Radboud University Nijmegen, The Netherlands Email: ingrid.nieuwenhuis at donders.ru.nl Tel: 0031 (0)24 - 36 10887 > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Akiko Ikkai > Sent: Wednesday, July 29, 2009 12:57 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] prepare_layout #input? > > Hi, > > I'm new to Fieldtrip, and am using fieldtrip-20090715 version. > > I'm making .lay file for our intracranial EEG data, and realized that > prepare_layout.m requires 6 entries (chNum,X,Y,Width,Height,Lbl,Rem), > whereas on the website ( http://fieldtrip.fcdonders.nl/tutorial/layout ) > it > says, "The 1st column is the channel number in the layout file, it is not > used any more.". prepare_layout.m runs when I add chNum to my .lay, OR > change line 743 of prepare_layout.m to [X,Y,Width,Height,Lbl,Rem] = > textread(filename,'%f %f %f %f %q %q'); > > For the future reference, I'm wondering which is more recent way to write > .lay files.... with, or without chNum? > > Thanks in advance! Akiko > > Akiko Ikkai > PhD Candidate > Department of Psychology > New York University > 6 Washington Place > New York NY, 10003 > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:05:44 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:05:44 +0200 Subject: prepare_layout #input? In-Reply-To: Message-ID: Dear Akiko The ascii layout file has some limitations w.r.t. the layouts that you can make, especially in case of ECoG data. We are using prepare_layout to construct individual ECoG layouts based on a photo that was made during the surgery. I have just updated the documentation at http://fieldtrip.fcdonders.nl/tutorial/layout and http://fieldtrip.fcdonders.nl/faq/what_is_the_format_of_the_layout_file_which_is_used_for_plotting to better reflect the advanced options for making ECog layouts. Please have a look at the layout tutorial with the ECoG example, which includes details and screenshots. best regards, Robert ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen ----------------------------------------------------------- On 29 Jul 2009, at 0:56, Akiko Ikkai wrote: > Hi, > > I'm new to Fieldtrip, and am using fieldtrip-20090715 version. > > I'm making .lay file for our intracranial EEG data, and realized that > prepare_layout.m requires 6 entries (chNum,X,Y,Width,Height,Lbl,Rem), > whereas on the website ( http://fieldtrip.fcdonders.nl/tutorial/ > layout ) it > says, "The 1st column is the channel number in the layout file, it > is not > used any more.". prepare_layout.m runs when I add chNum to my .lay, OR > change line 743 of prepare_layout.m to [X,Y,Width,Height,Lbl,Rem] = > textread(filename,'%f %f %f %f %q %q'); > > For the future reference, I'm wondering which is more recent way to > write > .lay files.... with, or without chNum? > > Thanks in advance! Akiko > > Akiko Ikkai > PhD Candidate > Department of Psychology > New York University > 6 Washington Place > New York NY, 10003 > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:12:12 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:12:12 +0200 Subject: Common Average reference - excluding channels In-Reply-To: Message-ID: Hi Martin On 24 Jul 2009, at 11:14, Martin Bleichner wrote: > I want to compute the common average reference for an ecog dataset. > But I have to exlude some of the channels due to epileptic activity. > I am currenlty using the code below. Do I have to specify the > channels I would like to include in my CAR in cfg.channels or in > cfg.refchannel? You would specify the channels that you want to average over in cfg.refchannel. The average of those channels will subsequently be subtracted from cfg.channel (which defines the channels on which the preprocessing function works). So cfg.channel = {'EEG1020', 'M1', 'M2'} cfg.refchannel = {'M1', 'M2'} would result in a linked ears reference, and cfg.channel = 'EEG1020' cfg.refchannel = 'EEG1020' would result in an average over all EEG1020 channels. Note that the channels to which you want to reference should be included in cfg.channel. For EEG data files the reference channel usually is not included in the file (because it is zero anyway). If the reference used during recording is a mastoid, and you want to refer to both mastoids, you can add the implicit reference as all zeros and define its name with the cfg.implicitref option. The documentation at http://fieldtrip.fcdonders.nl/example/re-referencing and http://fieldtrip.fcdonders.nl/tutorial/continuous contains more examples for rereferencing. best regards, Robert ----------------------------------------------------------- Robert Oostenveld, PhD Senior Researcher Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen ----------------------------------------------------------- > > Thanks a lot > Martin > > cfg=[]; > cfg.trackconfig='cleanup'; > > %compute common average reference > cfg.channels=ch_in_avref; > cfg.reref='yes'; > cfg.refchannel='all'; > > %filter out the line noise using bandstop filter > cfg.bsfilter='yes'; > cfg.bsfiltord=3; > cfg.bsfreq=[49.5 50.5; 99.5, 100.5]; > > > data=preprocessing(cfg,data); > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:17:29 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:17:29 +0200 Subject: beamformer source localization for EEG In-Reply-To: <4A609F39.60801@gmail.com> Message-ID: Dear Hung The differences between source reconstruction methods, or inverse methods, are in the assumptions that they make on the sources. Some make assumptions on the number of sources (dipole fitting), distribution of activity (minimum norm linear estimation) and some make assumptions on the correlatedness of the timecourses of the sources (beamforming or music). A difference is also in wether and how the noise in the data is incorporated in the estimate of the source acitivity (ignored in plain old dipole fitting, explicitely suppressed in beamforming). The method that works the best is the method whose assumptions on the data (true sources and noise) best corresponds to the data that you have acquired. best regards, Robert On 17 Jul 2009, at 17:56, Hung - Gmail wrote: > Dear all, > We have known that beamformers and other good source localization > techniques have zero localization error for single source cases. > However, in > real applications there are many sources inside the brain then we will > have non-zero localization error. How can we justify which inverse > solutions is better for multiple source cases? > > Thanks a lot > Hung > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Wed Jul 29 11:32:11 2009 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 29 Jul 2009 11:32:11 +0200 Subject: beamformer source localization for EEG In-Reply-To: <4A5F6A26.9060404@ucdavis.edu> Message-ID: Hi Jess, On 16 Jul 2009, at 19:57, Jess R. Kerlin wrote: > I'm using a 128 electrode Biosemi EEG system, attempting to perform > beam-former source analysis. I had go all the way back to Matlab 6.5 > and SPM 2, as well as some trial and error to get through it, but I > finally managed to get a nolte BEM using mostly the same code as in > the example script "BEM head model for EEG" script". However, > prepare_leadfield throws the error "unsupported volume conductor > model for EEG", which is clearly the case looking at the > prepare_leadfield code. The "nolte" model is a single shell realistic model for MEG. It is based on the boundary of the inside of the skull, but is not a BEM model and it is not for EEG. See http://fieldtrip.fcdonders.nl/references_to_implemented_methods and search for Nolte. The boundary element method can be used for EEG volume conduction, using the prepare_bemmodel function. > A few questions on this topic: > > Does fieldtrip actually support beamforming source localization on > BEM models for EEG? Yes, see Schneider TR, Debener S, Oostenveld R, Engel AK, Enhanced EEG gamma-band activity reflects multisensory semantic matching in visual- to-auditory object priming. Neuroimage. 2008 Sep 1;42(3):1244-54 > Or, given the coarser spatial resolution of EEG, is it better to use > a simpler spherical model? The beamformer method is rather sensitive to volume conductor misspecifications. So for a simple dipole fit a concentric spehrical model might be enough, but for beamforming I would recommend to use a BEM model. > Either way, does anyone have successful sample code for beamformer > localization EEG data, start to finish? you can get a template BEM volume conduction model from ftp.fcdonders.nl/pub/fieldtrip/standard_BEM.zip . The geometry is based on the canonical MNI template ("collin27") and it is defined in MNI coordinates (consistent with SPM). > And for the developers: > I love your work. thanks > I notice the move from SPM 2 to SPM 8 is in the development cue. Is > there any release coming soon which will use SPM 8 to make this > process smoother? SPM2 is not supported any more in recent matlab versions, so we have a compatibility problem one way or the other. Fieldtrip does not use that many functions from spm, but some of them are not compatible between spm2 and spm5/spm8. The idea is first to make a fieldtrip/ external/spm2 folder with a subset of the old spm2 functions in it that is enough to keep it running. Those spm2 functions then have to be fixed for compatibility with the most recent matlab (simple: replace finite with "isfinite"). Subsequently, the difference between those functions in their spm2 and spm8 incarnation has to be determined and fieldtrip should be fixed to reflect these differences. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From megjim1 at GMAIL.COM Wed Jul 29 18:10:44 2009 From: megjim1 at GMAIL.COM (Jim Li) Date: Wed, 29 Jul 2009 18:10:44 +0200 Subject: color bar not agreeing with data Message-ID: Dear Fieldtripper: I am puzzled by the output from "multiplotTFR". The colorbar doesn't look right at all! Can anyone help me? Basicly I have a data structure caled "TF" that's calculated from FREQANALYSIS. I ran the following script and got a plot (see attachment) ----------------------------- >> cfg = []; cfg.layout = '4D248.lay'; cfg.interactive = 'yes'; cfg.showlabels = 'yes'; cfg.colorbar = 'yes'; cfg.renderer= 'zbuffer' figure; multiplotTFR(cfg,TF); cfg = layout: '4D248.lay' interactive: 'yes' showlabels: 'yes' colorbar: 'yes' renderer: 'zbuffer' the input is freq data with 248 channels, 141 frequencybins and 77 timebins reading layout from file 4D248.lay >> ------------------------------ Now, when running " max(max(max(max(TF.powspctrm(:,:,:,:)))))" I got : ------------- ans = 2.287227537931770e-023 -------------- This is order of magnitude larger than the colorbar maximum, which is 1.82e- 24 (see attachment) . Why should this discrepency happen? Why the data maximum is not plotted? The same happened to the minimum: when running "min(min(min(min (TF.powspctrm(:,:,:,:)))))" I got 5.393784644607502e-034, which is about 8 orders of magnitude smaller than the colorbar minimum (2.12e-26 according to the attached figure). This I can understand since small numbers should be sacrificed to save bandwidth for more significant numbers. BTW I tried "singleplotTFR" and got the same discrepency between data maximum and plot/colorbar maximum for a channel. They differ by about an order of magnitude, which is huge! FYI, I was working directly before my PC, not through VNC or Remote Desktop connection. Thanks a lot, Jim ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: OutputFigure.TIF Type: image/tiff Size: 94342 bytes Desc: not available URL: From saskia.haegens at DONDERS.RU.NL Wed Jul 29 18:55:48 2009 From: saskia.haegens at DONDERS.RU.NL (Saskia Haegens) Date: Wed, 29 Jul 2009 18:55:48 +0200 Subject: color bar not agreeing with data In-Reply-To: Message-ID: Hi Jim, Does your data contain a repetition dimension (i.e. did you run freqanalysis with cfg.keeptrials='yes')? In that case, when you don't specify which trials to plot, the plotting functions such as multiplotTFR will plot the average over all trials. This could explain the discrepancy you describe. Best, Saskia > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Jim Li > Sent: 29 July 2009 18:11 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] color bar not agreeing with data > > Dear Fieldtripper: > > I am puzzled by the output from "multiplotTFR". The colorbar doesn't look > right > at all! Can anyone help me? > > Basicly I have a data structure caled "TF" that's calculated from > FREQANALYSIS. I ran the following script and got a plot (see attachment) > > ----------------------------- > >> cfg = []; cfg.layout = '4D248.lay'; cfg.interactive = > 'yes'; > cfg.showlabels = 'yes'; > cfg.colorbar = 'yes'; cfg.renderer= 'zbuffer' > figure; > multiplotTFR(cfg,TF); > > cfg = > > layout: '4D248.lay' > interactive: 'yes' > showlabels: 'yes' > colorbar: 'yes' > renderer: 'zbuffer' > > the input is freq data with 248 channels, 141 frequencybins and 77 > timebins > reading layout from file 4D248.lay > >> > ------------------------------ > > Now, when running " max(max(max(max(TF.powspctrm(:,:,:,:)))))" I got : > > ------------- > ans = > > 2.287227537931770e-023 > -------------- > > This is order of magnitude larger than the colorbar maximum, which is > 1.82e- > 24 (see attachment) . Why should this discrepency happen? Why the data > maximum is not plotted? > > > The same happened to the minimum: when running "min(min(min(min > (TF.powspctrm(:,:,:,:)))))" I got 5.393784644607502e-034, which is about > 8 > orders of magnitude smaller than the colorbar minimum (2.12e-26 according > to > the attached figure). This I can understand since small numbers should be > sacrificed to save bandwidth for more significant numbers. > > > BTW I tried "singleplotTFR" and got the same discrepency between data > maximum and plot/colorbar maximum for a channel. They differ by about an > order of magnitude, which is huge! > > FYI, I was working directly before my PC, not through VNC or Remote > Desktop connection. > > Thanks a lot, > > Jim > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From megjim1 at GMAIL.COM Thu Jul 30 01:31:40 2009 From: megjim1 at GMAIL.COM (Jim Li) Date: Thu, 30 Jul 2009 01:31:40 +0200 Subject: color bar not agreeing with data Message-ID: Hi Saskia, You're right on the point! Thanks a lot for your help, :) Jim On Wed, 29 Jul 2009 18:55:48 +0200, Saskia Haegens wrote: >Hi Jim, > >Does your data contain a repetition dimension (i.e. did you run freqanalysis >with cfg.keeptrials='yes')? In that case, when you don't specify which >trials to plot, the plotting functions such as multiplotTFR will plot the >average over all trials. This could explain the discrepancy you describe. > >Best, >Saskia > >> -----Original Message----- >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >> Behalf Of Jim Li >> Sent: 29 July 2009 18:11 >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: [FIELDTRIP] color bar not agreeing with data >> >> Dear Fieldtripper: >> >> I am puzzled by the output from "multiplotTFR". The colorbar doesn't look >> right >> at all! Can anyone help me? >> >> Basicly I have a data structure caled "TF" that's calculated from >> FREQANALYSIS. I ran the following script and got a plot (see attachment) >> >> ----------------------------- >> >> cfg = []; cfg.layout = '4D248.lay'; cfg.interactive = >> 'yes'; >> cfg.showlabels = 'yes'; >> cfg.colorbar = 'yes'; cfg.renderer= 'zbuffer' >> figure; >> multiplotTFR(cfg,TF); >> >> cfg = >> >> layout: '4D248.lay' >> interactive: 'yes' >> showlabels: 'yes' >> colorbar: 'yes' >> renderer: 'zbuffer' >> >> the input is freq data with 248 channels, 141 frequencybins and 77 >> timebins >> reading layout from file 4D248.lay >> >> >> ------------------------------ >> >> Now, when running " max(max(max(max(TF.powspctrm(:,:,:,:)))))" I got : >> >> ------------- >> ans = >> >> 2.287227537931770e-023 >> -------------- >> >> This is order of magnitude larger than the colorbar maximum, which is >> 1.82e- >> 24 (see attachment) . Why should this discrepency happen? Why the data >> maximum is not plotted? >> >> >> The same happened to the minimum: when running "min(min(min(min >> (TF.powspctrm(:,:,:,:)))))" I got 5.393784644607502e-034, which is about >> 8 >> orders of magnitude smaller than the colorbar minimum (2.12e-26 according >> to >> the attached figure). This I can understand since small numbers should be >> sacrificed to save bandwidth for more significant numbers. >> >> >> BTW I tried "singleplotTFR" and got the same discrepency between data >> maximum and plot/colorbar maximum for a channel. They differ by about an >> order of magnitude, which is huge! >> >> FYI, I was working directly before my PC, not through VNC or Remote >> Desktop connection. >> >> Thanks a lot, >> >> Jim >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. > >---------------------------------- >The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From vvw at CALTECH.EDU Thu Jul 30 10:39:55 2009 From: vvw at CALTECH.EDU (Virginie van Wassenhove) Date: Thu, 30 Jul 2009 10:39:55 +0200 Subject: ECG artifact with MEG data Message-ID: Hi everyone, I am testing the ECG artifact removal using the ICA method described here: http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_ica_to_remove_ecg_artifacts At the stage where freqanalysis is to be computed on the components comp_ecg, I encounter this error, anyone else has experienced such issue? the input is component data with 204 components and 204 original channels ??? Error using ==> checkdata at 388 This function requires raw data as input. Error in ==> freqanalysis at 165 data = checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset', 'yes'); Thanks in advance, Virginie ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ingrid.nieuwenhuis at DONDERS.RU.NL Thu Jul 30 21:52:47 2009 From: ingrid.nieuwenhuis at DONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 30 Jul 2009 21:52:47 +0200 Subject: ECG artifact with MEG data In-Reply-To: Message-ID: Dear Virginie, You're problem was caused by a too strict check of the input data by checkdata. This function only allowed raw data as input, but it also works on component data. I've fixed the bug and the ftp fieldtrip version of tomorrow should not give the problem. You can also fix the problem yourself by changing line 165 in freqanalysis into data = checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hasoffset', 'yes'); Best Ingrid ___________________________________ Ingrid Nieuwenhuis PhD student Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging Radboud University Nijmegen, The Netherlands Email: ingrid.nieuwenhuis at donders.ru.nl Tel: 0031 (0)24 - 36 10887 > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Virginie van Wassenhove > Sent: Thursday, July 30, 2009 10:40 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] ECG artifact with MEG data > > Hi everyone, > > I am testing the ECG artifact removal using the ICA method described here: > http://fieldtrip.fcdonders.nl/example/use_independent_component_analysis_i > ca_to_remove_ecg_artifacts > > At the stage where freqanalysis is to be computed on the components > comp_ecg, I encounter this error, anyone else has experienced such issue? > > the input is component data with 204 components and 204 original channels > ??? Error using ==> checkdata at 388 > This function requires raw data as input. > > Error in ==> freqanalysis at 165 > data = checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset', > 'yes'); > > Thanks in advance, > Virginie > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.