From r.oostenveld at FCDONDERS.RU.NL Tue May 6 14:48:00 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 May 2008 14:48:00 +0200 Subject: Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** In-Reply-To: Message-ID: It might be related to the use of a mex file when reading in your data. The mex file then seems to deallocate a piece of memory that is not in use any more, see http://en.wikipedia.org/wiki/Malloc. It does not seem a serious problem, but perhaps you could give more information about your OS, matlab version and fileformat that you are working with, so that potential other problems related to this warning can be investigated. best regards, Robert On 30 Apr 2008, at 13:50, Frederic Roux wrote: > I get this error message every time I try to preprocess my data: > > > *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** > > Does anyone have a clue what this could mean? ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue May 6 14:53:59 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 May 2008 14:53:59 +0200 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Susana, Your problem might well be to the file being exported in a non- standard brainvision format. On 27 Apr 2008, at 0:01, Susana Silva wrote: > My questions are: > - In my position – someone who has eep files and brainvision files, > what is the most simple option: try to use eep or brainvision (at the > moment, I can use neither!) Reading the eep files requires mex files, and that requires additional software from ANT (a librarry with the low0-level routines). Since that software is not open source, it is not possible to recompile the MEX file on your platform. You could complain about the file format with ANT and/or get another Matlab version (an old matlab on windows should work). As such, the brainvision format seems the most pragmatic solution to me. > - Can you give me an example of a trial definition based upon a > brainvision file, let us say s1.eeg (data), s1.vhdr , s1.vmrk, > where ‘s33’ > (eventvalue) is the ‘Stimulus’ (eventtype)? Example trial definitions are given in the documentation on the fieldtrip website. > - In case I can not do the trial definition, how exactly should I > arrange my data so that they are equivalent to the output of > “definetrial”? You should specify a trl matrix as cfg.trl to the preprocessing function, that matrrix is explained in the documentation on the website and in the definetrial function help. 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/fcdonders/fieldtrip. From fredericroux at HOTMAIL.DE Tue May 6 15:07:08 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Tue, 6 May 2008 15:07:08 +0200 Subject: Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 ** In-Reply-To: <2F72F811-B941-4DE1-BECA-37DF9B3FB4D3@fcdonders.ru.nl> Message-ID: Hi Robert, thank you for answering. I found out what the error was related to. It's related to the 'feature accel off' option. When I launch my analysis with that option the bug does not appear. Can you tell me why that is so? I have 2 more questions: 1. Can I contribute to Fieldtrip with my functions? I've written a baseline Correction function that computes Decibeland Z-scores. I've also got other functions that could be useful to other users. 2. When I compute a Wavelet transformation of my MEG signals I get an aquward looking power spectrum that looks like the signal is full of epileptic spikes. It kinda looks like a 'flame pattern'. I remember that you mentioned it during the Fieldtrip toolkit but I can't remember what it was related to. Can you tell me what this means? The funny thing is that this does not happen when I do a multitaper analysis of the same signal. The parameters I used for the wavelet transform are the following: width = 4 and gwidth = 3. Best regards, Frederic Dipl. Psych. Frederic Roux Max Planck Institut für HirnforschungAbteilung NeurophysiologieDeutschordenstr. 4660528 Frankfurt am MainTel.: 069 / 6301 83225Mail: fredericroux at hotmail.de froux at mpih-frankfurt.mpg.de ---------------------------------------- > Date: Tue, 6 May 2008 14:48:00 +0200 > From: r.oostenveld at FCDONDERS.RU.NL > Subject: Re: [FIELDTRIP] Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** > To: FIELDTRIP at NIC.SURFNET.NL > > It might be related to the use of a mex file when reading in your > data. The mex file then seems to deallocate a piece of memory that is > not in use any more, see http://en.wikipedia.org/wiki/Malloc. It does > not seem a serious problem, but perhaps you could give more > information about your OS, matlab version and fileformat that you are > working with, so that potential other problems related to this > warning can be investigated. > > best regards, > Robert > > > On 30 Apr 2008, at 13:50, Frederic Roux wrote: > >> I get this error message every time I try to preprocess my data: >> >> >> *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** >> >> Does anyone have a clue what this could mean? > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ Lustige Emoticons für Ihren Messenger! Hier kostenlos downloaden! http://messenger.live.de/mein/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From zanasilva at GMAIL.COM Tue May 6 19:33:57 2008 From: zanasilva at GMAIL.COM (Susana Silva) Date: Tue, 6 May 2008 18:33:57 +0100 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Robert, Thank you very much for the information. In the mean time, I finally succeed in reading all brainvision files (yes, there should have been a problem with bv format, because I had to change the name of a field - to nChans- in the m file). However, after rereading the documentation, I still have a local (and very basic) question on the cfg for definetrial: what is a "dataset" when we are using brainvision files? Can it be replaced by the header file, the data file and the event/marker file? If so, what should bi included in the cfg (cfg.datafile, cfg.headerfile, cfg.event?) I tried that but it did not work out. Concerning the arrangement of data so as to match definetrial output, I also did this, based upon the documentation. However, this solution does not give a prestimulus time, to be seen in each trial as referenced to a negative time (eg: time -0.2 up to time 0) . I believe this is necessary to view the baseline later. Thank you again. Best regards, Susana Silva On 5/6/08, Robert Oostenveld wrote: > > Hi Susana, > > Your problem might well be to the file being exported in a non-standard > brainvision format. > > > On 27 Apr 2008, at 0:01, Susana Silva wrote: > > > My questions are: > > - In my position – someone who has eep files and brainvision > > files, > > what is the most simple option: try to use eep or brainvision (at the > > moment, I can use neither!) > > > > Reading the eep files requires mex files, and that requires additional > software from ANT (a librarry with the low0-level routines). Since that > software is not open source, it is not possible to recompile the MEX file on > your platform. You could complain about the file format with ANT and/or get > another Matlab version (an old matlab on windows should work). As such, the > brainvision format seems the most pragmatic solution to me. > > - Can you give me an example of a trial definition based upon a > > brainvision file, let us say s1.eeg (data), s1.vhdr , s1.vmrk, where > > 's33' > > (eventvalue) is the 'Stimulus' (eventtype)? > > > > Example trial definitions are given in the documentation on the fieldtrip > website. > > - In case I can not do the trial definition, how exactly should I > > arrange my data so that they are equivalent to the output of > > "definetrial"? > > > > You should specify a trl matrix as cfg.trl to the preprocessing function, > that matrrix is explained in the documentation on the website and in the > definetrial function help. > > 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/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathan.dees at UMSL.EDU Wed May 7 00:54:05 2008 From: nathan.dees at UMSL.EDU (Nathan Dees) Date: Wed, 7 May 2008 00:54:05 +0200 Subject: CMCorig data, Coherence Tutorial Message-ID: How can one gain access to the dataset 'CMCorig' discussed in the tutorials, specifically the tutorial on Coherence? This file is not included in the SubjectCMC data posted on the tutorial data section of the website. Has anyone else had trouble running the Coherence tutorial from start to finish - I thought having access to this data might help me get through certain sections? Thank you ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Fri May 9 09:18:19 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 9 May 2008 09:18:19 +0200 Subject: Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 ** In-Reply-To: Message-ID: Hi Frederic On 6 May 2008, at 15:07, Frederic Roux wrote: > I found out what the error was related to. It's related to the > 'feature accel off' option. > > When I launch my analysis with that option the bug does not appear. > Can you tell me why that is so? I don't know what the relatino between "feature accel off" and the emx file is, I have not heard about problems with that before. However, I know that in an older matlab versino (don't recall the exact version number) where that feature wa sintroduced, that there were problems with persistent variables (used underneath the cfg.feedback option in fieldtrip). To fix those matlab bugs, it was also needed to turn accel off. > I have 2 more questions: > > 1. Can I contribute to Fieldtrip with my functions? I've written a > baseline Correction function that computes Decibeland Z-scores. > I've also got other functions that could be useful to other users. The different baselineling options would be interesting to incorporate into the existing freqbaseline function. Would that be doable? If so, then they would automatically be available for plotting (cfg.baselinetype refers to freqbaseline). For the other functions: In the past other people within the Donders have contributed some miscellaneous functions as well. I have added them, but over the years (as they have not been maintained) the functions might have lost their usefullness. Those functions sofar also have not all been included in the external ftp release version of fieldtrip. However, I certainly would like to encourage people to contribute to fieldtrip. If the functions are sufficiently usefull and fieldtrip-like (regarding their interface and documentation) then I am also happy to add them to fieldtrip-main and play an active role in maintaining them. And for small-helper functions I could add a directory fieldtrip/contrib where those functions could go. An example functions that I think would be better of in fieldtrip/ contrib would be source2sparce.m (which is a helper function taht I made myself, but it is not very fieldtrip-like). > 2. When I compute a Wavelet transformation of my MEG signals I get > an aquward looking power spectrum that looks like the signal is > full of epileptic spikes. > It kinda looks like a 'flame pattern'. I remember that you > mentioned it during the Fieldtrip toolkit but I can't remember what > it was related to. Can you tell me what this means? There are probably short and sharp transients in your data (i.e. "blips"). The morlet wavelets for the higher frequencies get shorter and shorter, and increase the frequency bandwith at trhe same time. So a broad-looking blip at a low frequency becomes smaller at higher frequencies, hence the flame pattern. > The funny thing is that this does not happen when I do a multitaper > analysis of the same signal. With multitapers you probably use a longer t_ftimwin for the high frequencies (where the morlet wavelets are short, especially with your cfg.width=4). The increased timewindow together with the multiple tapers results in a more robust power estimate, which is less affected by noise (your blips). 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/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Fri May 9 09:19:34 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 9 May 2008 09:19:34 +0200 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Susana On 6 May 2008, at 19:33, Susana Silva wrote: > In the mean time, I finally succeed in reading all brainvision > files (yes, there should have been a problem with bv format, > because I had to change the name of a field - to nChans- in the m > file). Can you upload one of your problematic files to ftp.fcdonders.nl/pub/ incoming, or if it is less <1MB send it as email attachement to my personal email account? > However, after rereading the documentation, I still have a local > (and very basic) question on the cfg for definetrial: what is a > "dataset" when we are using brainvision files? Can it be replaced > by the header file, the data file and the event/marker file? If so, > what should bi included in the cfg (cfg.datafile, cfg.headerfile, > cfg.event?) I tried that but it did not work out. You can specify cfg.datafile and cfg.headerfile seperately, or in your case you can specify cfg.dataset=yourfile.vhdr. Also for the events (which are read using read_fcdc_event) you can specify the header file, because that file contains the name of the accompanying event file. > Concerning the arrangement of data so as to match definetrial > output, I also did this, based upon the documentation. However, > this solution does not give a prestimulus time, to be seen in each > trial as referenced to a negative time (eg: time -0.2 up to time > 0) . I believe this is necessary to view the baseline later. This is from the definetrial documentation % The trial definition "trl" is an Nx3 matrix, N is the number of trials. % The first column contains the sample-indices of the begin of each trial % relative to the begin of the raw data, the second column contains the % sample-indices of the end of each trial, and the third column contains % the offset of the trigger with respect to the trial. An offset of 0 % means that the first sample of the trial corresponds to the trigger. A % positive offset indicates that the first sample is later than the trigger, % a negative offset indicates that the trial begins before the trigger. The trl matrix is used to read in the interesting segments of the data with the preprocessing function (using the first and second column of trl) and to attach a timeaxis to each trial (using the third column). 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/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri May 9 10:39:16 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 9 May 2008 10:39:16 +0200 Subject: CMCorig data, Coherence Tutorial In-Reply-To: Message-ID: Dear Nathan, Indeed the CMCorig mat-file is missing from the ftp-server, but in principle it can be generated by executing the preceding steps in the tutorial. We will change the tutorial accordingly. Historically, the tutorials have been used at the FCDC toolkit-courses for data analysis, and students had the mat-file available to save some time. However, from your mail I conclude that you had some problems running the tutorial itself, probably unrelated to the (un)availability of the CMCorig file. If so, could you just retry running the tutorial and let us know whether and where specified problems arise? Thanks, Jan-Mathijs On May 7, 2008, at 12:54 AM, Nathan Dees wrote: > How can one gain access to the dataset 'CMCorig' discussed in the > tutorials, specifically the tutorial on Coherence? This file is not > included in the SubjectCMC data posted on the tutorial data section > of the > website. > > Has anyone else had trouble running the Coherence tutorial from > start to > finish - I thought having access to this data might help me get > through > certain sections? > > Thank you > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri May 9 16:55:11 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 9 May 2008 16:55:11 +0200 Subject: strange sensor signals in the baseline Message-ID: Dear Fieldtrippers, I have some data from a 275ch CTF system, that were (in each single subject) preprocessed in Fieldtrip with baseline correction and detrending. If I now look at the grandaverage ERP some sensors have a nonzero signal that is entirely on one side (either completely above or completely below) of the baseline, while most sensors oscillate around zero as I would expect. Is this an effect of detrending, i.e. is detrending performed AFTER baseline correction AND on the whole datapiece, instead of just the specified baseline interval? Any suggestions welcome. 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/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From zanasilva at GMAIL.COM Tue May 13 00:02:18 2008 From: zanasilva at GMAIL.COM (Susana Silva) Date: Mon, 12 May 2008 23:02:18 +0100 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Robert, On 6 May 2008, at 19:33, Susana Silva wrote: > In the mean time, I finally succeed in reading all brainvision files (yes, > > there should have been a problem with bv format, because I had to change the > > name of a field - to nChans- in the m file). > > > > Can you upload one of your problematic files to ftp.fcdonders.nl/pub/incoming, > or if it is less <1MB send it as email attachement to my personal email > account? I send you a .vhdr file and a .vmrk file from a subject, both as I exported from ASA. The .eeg is too big. Maybe you can figure out quickly if the brainvision format is anyhow problematic for fieldtrip. I remind you that my problem, now, is to use the define trial function. Thank you very much susana ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue May 13 09:26:35 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 May 2008 09:26:35 +0200 Subject: 2 Post-doctoral positions at the University of Chieti - MEGMRI Message-ID: 2 Post-doctoral positions at the University of Chieti - Institute of Advanced Biomedical Technologies (ITAB) to work on MEGMRI, a FP7 sponsored project, starting immediately. MEGMRI goal is to produce and validate a hybrid instrument able to perform simultaneous MEG and MRI for obtaining undistorted structural brain images and time-resolved functional maps that are spatially precisely aligned with each other. The project has three main tasks: i) build optimized magnetic femtotesla sensors for MEG and MRI; ii) the production of an MEG-MRI hybrid prototype; iii) pre-clinical validation of MEG-MRI. MEGMRI is a multi-center project involving the following centers: Helsinki University of Technology (Finland, coordinator), Aivon Oy (Finland), CEDRAT (France), Chalmers Tekniska Hoegskola Aktiebolag (Sweden), University of Chieti (Italy), Commissariat à l’energie atomique (France), Elekta AB (Sweden), Associazione Fatebenefratelli per la Ricerca (Italy), Hospital District of Helsinki and Uusimaa (Finland), Imaging Technology Abruzzo (Italy), PTB (Germany), University of Parma (Italy), Valtion teknillinen tutkimuskeskus (Finland) The two positions are for: 1) One position for a post-doc working on MEGMRI instrumentation development. The post-doc is expected to work on a prototype using superconducting devices for the detection of the MEG and MRI signals. Candidates should have a PhD in Physics or Engineering. Candidates should be already familiar either with MEG or MRI hardware. Skills in signal processing as well as computer programming (C++, Matlab) is highly desirable. 2) One position for a post-doc working on MEGMRI software development. The post-doc is expected to work on software for MEG- MRI data integration to produce a toolbox to be included in an MEG analysis software. Candidates should have a PhD in Physics, Engineering, or Computer Science. Candidates should be already familiar either with MEG or MRI methods. Applications should include CV, a research statement, and 2 letters of recommendation. The positions will be assigned on a 2+2 years schedule. Chieti is a university town, located in central Italy, about 15 minutes from the Adriatic coast, 30 minutes from the Parco Nazionale degli Abruzzi, the largest natural reserve in Italy, great skying, hiking, and mountain or seaside activities, only 2 hours from Rome. Please forward the application materials to: Prof. Gian Luca Romani, glromani at itab.unich.it Institute of Advanced Biomedical Technologies University of Chieti 66013 Chieti, ITALY ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue May 13 12:30:41 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 May 2008 12:30:41 +0200 Subject: strange sensor signals in the baseline In-Reply-To: <667272528@web.de> Message-ID: On 9 May 2008, at 16:55, Michael Wibral wrote: > Dear Fieldtrippers, > > I have some data from a 275ch CTF system, that were (in each single > subject) preprocessed in Fieldtrip with baseline correction and > detrending. If I now look at the grandaverage ERP some sensors have > a nonzero signal that is entirely on one side (either completely > above or completely below) of the baseline, while most sensors > oscillate around zero as I would expect. Is this an effect of > detrending, i.e. is detrending performed AFTER baseline correction > AND on the whole datapiece, instead of just the specified baseline > interval? Hi Michael, detrending is done prior to baselinecorrection. See fieldtrip/private/ preproc.m around line 346. Note that for detrending always the whole segment is used (minus the optional filterpadding), whereas for baseline correction you can specify the baseline window. The default for baseline correction is to use the whole segment (also minus the filter padding). If you use filter padding, then it is technically possible to specify a baseline window that extends into (or even is completely in) the padding. Did you use padding, and what did you specify as cfg.blcwindow? However, regardless of the order of detrending and baselinecorrection and assuming that you did not use filter padding, your ERFs should all have an average of zero over the time axis. An easy check is to compute baseline = mean(timelock.avg, 2); or baseline = mean(raw.trial{i}, 2); for each of your trials. This returns a nchansX1 vector that should be zero (or very close to zero) for each channel. 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/fcdonders/fieldtrip. From sdmuthu at CARDIFF.AC.UK Tue May 13 16:57:12 2008 From: sdmuthu at CARDIFF.AC.UK (Suresh Muthukumaraswamy) Date: Tue, 13 May 2008 16:57:12 +0200 Subject: Minimum norm estimates... Message-ID: Hi, I am trying to use sourceanalysis to create minimum norm estimates. The software runs fine but the resulting images I get back are completely dominated by the voxels at the edges of my grid near the sensors. So I am wondering If I have either made a mistake somewhere or if there are some parameters that can be tweaked to improve the reconstructions? My data is 275Ch CTF data and for the purposes of trying out fieldtrip's MNE I am just using a simple VEP dataset, with the headmodel created by localSpheres. There is a simple field pattern in the data which I was hoping to reconstruct. I have used the DICS (power) part of sourceanalysis before and get images that look pretty similar to SAM images made outside of fieldtrip, so I think my MRI/registration stuff in fieldtrip is ok. Thanks, Suresh Here is my code Dataset = '/gpfs/home/sapsm7/Bristol/Day/DC/DC_VSM-VEF_20080409_01.ds'; hdmFile = [Dataset '/default.hdm'] ;%assumes localSpheres has been run mrifile = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.mri'; shapefilename = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.shape'; OutImage = '/gpfs/home/sapsm7/Bristol/Day/DC/testminnorm'; cfg = []; cfg.trialdef.prestim = 2; %How much of the prestim to load in (s) cfg.trialdef.poststim = 2; cfg.trialdef.eventtype = 'High'; cfg.dataset = Dataset cfg.channel = {'MEG'}; %Right V5 and Left V5 sensitive cfg.bpfilter = [0.5 30]; cfg.lpfilter = 30 cfg.blc = 'yes'; cfg.blcwindow = [-0.2 0]; cfg = definetrial(cfg); Data = preprocessing(cfg); save DC_RawData load DC_RawData cfg = []; cfg.latency = [-0.2 1]; DCERF = timelockanalysis(cfg, Data); cfg = []; cfg.baseline = [-0.2 0]; DCERF = timelockbaseline(cfg, DCERF); %At this point the waveform plots and topos in fieldtrip look very nice [XMax, XMin, YMax, YMin, ZMax, ZMin] = shapefilemaxmin (shapefilename) ; %Extract the source reconstruction grid from the shapefile Resolution = 1; cfg = []; cfg.method = 'mne'; cfg.hdmfile = hdmFile; cfg.grid.xgrid = XMin : Resolution : XMax; cfg.grid.ygrid = YMin : Resolution : YMax; cfg.grid.zgrid = ZMin : Resolution : ZMax; [sourcePre] = sourceanalysis(cfg, DCERF); sourcePre.avg.coll = mean(sourcePre.avg.pow(:,169:183), 2); %Grab a time window and put into a variable for sourceint cfg = []; cfg.downsample = 2; sourceInt = sourceinterpolate(cfg, sourcePre, mrifile); sourceInt.avg.coll = sourceInt.avg.coll * 1e10 %upscale to make it easy to visualise in mri3dX %Write the analyse files out DeleteAnalyseFiles(OutImage); cfg = []; cfg.parameter = 'coll'; cfg.filename = OutImage; cfg.filetype = 'spm'; cfg.coordinates = []; cfg.datatype = 'float'; cfg.coordinates = 'ctf'; volumewrite(cfg, sourceInt); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue May 13 20:40:28 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 May 2008 20:40:28 +0200 Subject: Minimum norm estimates... In-Reply-To: Message-ID: Hi Suresh On 13 May 2008, at 16:57, Suresh Muthukumaraswamy wrote: > I am trying to use sourceanalysis to create minimum norm > estimates. The > software runs fine but the resulting images I get back are completely > dominated by the voxels at the edges of my grid near the sensors. > So I am > wondering If I have either made a mistake somewhere or if there are > some > parameters that can be tweaked to improve the reconstructions? The standard MNE is non-regularised. Since superficial dipoles result in a much stronger leadfield, the superficial sources are able to explain your data with much "smaller" norm, hence the minimum norm solution is very superficial. That is the depth bias inherent to MNE. The minimum norm estimate implementation has the following options % 'noisecov' = Nchan x Nchan matrix with noise covariance % 'sourcecov' = Nsource x Nsource matrix with source covariance (can be empty, the default will then be identity) % 'lambda' = scalar, regularisation parameter (can be empty, it will then be estimated from snr) % 'snr' = scalar, signal to noise ratio % 'reducerank' = reduce the leadfield rank, can be 'no' or a number (e.g. 2) % 'normalize' = normalize the leadfield % 'normalizeparam' = parameter for depth normalization (default = 0.5) These can be passed in sourceanalysis by specifying e.g. cfg.mne.normalize = 'yes'. See also the documentation included in the private functions minimumnormestimate and compute_leadfield. My first guess at the solution to your problem would be normalize and optionally the normalizeparam option. Depth regularization (or "depth weighing") is described in various papers and I recall that the normalizeparam comes from a paper by Wagner and/or Fuchs (Hamburg). I hope this suggestion gets you started. Since we have not used MNE ourselves sofar, I am curious to hear how it performs on your 275ch MEG data and which tweaks are most optimal. best regards, Robert > My data is 275Ch CTF data and for the purposes of trying out > fieldtrip's MNE > I am just using a simple VEP dataset, with the headmodel created by > localSpheres. There is a simple field pattern in the data which I > was hoping > to reconstruct. > I have used the DICS (power) part of sourceanalysis before and > get images > that look pretty similar to SAM images made outside of fieldtrip, > so I think > my MRI/registration stuff in fieldtrip is ok. > > Thanks, > Suresh > > Here is my code > > Dataset = '/gpfs/home/sapsm7/Bristol/Day/DC/DC_VSM- > VEF_20080409_01.ds'; > hdmFile = [Dataset '/default.hdm'] ;%assumes localSpheres has been run > mrifile = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.mri'; > shapefilename = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.shape'; > OutImage = '/gpfs/home/sapsm7/Bristol/Day/DC/testminnorm'; > > > cfg = []; > cfg.trialdef.prestim = 2; %How much of the prestim to load in (s) > cfg.trialdef.poststim = 2; > cfg.trialdef.eventtype = 'High'; > cfg.dataset = Dataset > cfg.channel = {'MEG'}; %Right V5 and Left V5 sensitive > cfg.bpfilter = [0.5 30]; > cfg.lpfilter = 30 > cfg.blc = 'yes'; > cfg.blcwindow = [-0.2 0]; > cfg = definetrial(cfg); > Data = preprocessing(cfg); > > save DC_RawData > > load DC_RawData > > cfg = []; > cfg.latency = [-0.2 1]; > DCERF = timelockanalysis(cfg, Data); > > cfg = []; > cfg.baseline = [-0.2 0]; > DCERF = timelockbaseline(cfg, DCERF); > > %At this point the waveform plots and topos in fieldtrip look very > nice > > > [XMax, XMin, YMax, YMin, ZMax, ZMin] = shapefilemaxmin > (shapefilename) ; > %Extract the source reconstruction grid from the shapefile > Resolution = 1; > cfg = []; > cfg.method = 'mne'; > cfg.hdmfile = hdmFile; > cfg.grid.xgrid = XMin : Resolution : XMax; > cfg.grid.ygrid = YMin : Resolution : YMax; > cfg.grid.zgrid = ZMin : Resolution : ZMax; > [sourcePre] = sourceanalysis(cfg, DCERF); > > sourcePre.avg.coll = mean(sourcePre.avg.pow(:,169:183), 2); %Grab a > time > window and put into a variable for sourceint > > cfg = []; > cfg.downsample = 2; > sourceInt = sourceinterpolate(cfg, sourcePre, mrifile); > > > sourceInt.avg.coll = sourceInt.avg.coll * 1e10 %upscale to make it > easy to > visualise in mri3dX > > %Write the analyse files out > DeleteAnalyseFiles(OutImage); > cfg = []; > cfg.parameter = 'coll'; > cfg.filename = OutImage; > cfg.filetype = 'spm'; > cfg.coordinates = []; > cfg.datatype = 'float'; > cfg.coordinates = 'ctf'; > volumewrite(cfg, sourceInt); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From muthuraman10 at HOTMAIL.COM Thu May 15 19:22:30 2008 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Thu, 15 May 2008 17:22:30 +0000 Subject: cross-spectral density matrix is rank deficient! Message-ID: Hello Fieldtrippers, I get the warning "cross-spectral density matrix is rank deficient" when running the sourceanalysis_DICS on simulated data. Any hints due to which the warning comes will be very helpfull, because the channel combination was selected for ''all" in the frequency analysis. Thanking you With regards, M.Muthuraman. _________________________________________________________________ Catch the latest fashion shows, get beauty tips and learn more on fashion and lifestyle. http://video.msn.com/?mkt=en-in ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Thu May 15 20:47:52 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 15 May 2008 19:47:52 +0100 Subject: cross-spectral density matrix is rank deficient! In-Reply-To: Message-ID: Hi Muthuraman, You are warned for the rank-deficiency of the csd-matrix, because this could lead to numerical instabilities when inverting this matrix. However, since fieldtrip uses pinv instead of inv, this does not lead to crashing scripts. On the other hand, the message basically is the consequence of the fact that: -you used too few trials to simulate the csd (the total number of tapers applied should ideally be > the number of channels), -you did not add enough sensor noise to your simulation. because you typically want to simulate fewer sources than sensors (which by definition makes the true source csd-matrix rank deficient) you really have to add sensor noise, -or both. Good luck Jan-Mathijs Quoting Muthuraman Muthuraman : > > Hello Fieldtrippers, > > I get the warning "cross-spectral density matrix is rank deficient" > when running the sourceanalysis_DICS on simulated data. > Any hints due to which the warning comes will be very helpfull, > because the channel combination was selected for ''all" in the > frequency analysis. > > > Thanking you > > With regards, > M.Muthuraman. > > _________________________________________________________________ > Catch the latest fashion shows, get beauty tips and learn more on > fashion and lifestyle. > http://video.msn.com/?mkt=en-in > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > ------------------------------------------------------------------ The 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/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri May 16 10:35:02 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 16 May 2008 10:35:02 +0200 Subject: cross-spectral density matrix is rank deficient! Message-ID: Hi Muthuraman, could it be that you have removed some channels from your data and did not calculate a new headmodel/leadfield? As far as I remember this will cause a similar error message (although strictly speaking it shouldn't). Michael > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list > Gesendet: 15.05.08 20:51:27 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] cross-spectral density matrix is rank deficient! > Hi Muthuraman, > > You are warned for the rank-deficiency of the csd-matrix, because this > could lead to numerical instabilities when inverting this matrix. > However, since fieldtrip uses pinv instead of inv, this does not lead > to crashing scripts. > On the other hand, the message basically is the consequence of the fact that: > > -you used too few trials to simulate the csd (the total number of > tapers applied should ideally be > the number of channels), > -you did not add enough sensor noise to your simulation. because you > typically want to simulate fewer sources than sensors (which by > definition makes the true source csd-matrix rank deficient) you really > have to add sensor noise, > -or both. > > Good luck > > Jan-Mathijs > > Quoting Muthuraman Muthuraman : > > > > > Hello Fieldtrippers, > > > > I get the warning "cross-spectral density matrix is rank deficient" > > when running the sourceanalysis_DICS on simulated data. > > Any hints due to which the warning comes will be very helpfull, > > because the channel combination was selected for ''all" in the > > frequency analysis. > > > > > > Thanking you > > > > With regards, > > M.Muthuraman. > > > > _________________________________________________________________ > > Catch the latest fashion shows, get beauty tips and learn more on > > fashion and lifestyle. > > http://video.msn.com/?mkt=en-in > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > > of the FieldTrip toolbox, to share experiences and to discuss new > > ideas for MEG and EEG analysis. See also > > http://listserv.surfnet.nl/archives/fieldtrip.html and > > http://www.ru.nl/fcdonders/fieldtrip. > > > > > > ------------------------------------------------------------------ > The 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/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From Kooijman at TIFN.NL Fri May 16 12:56:19 2008 From: Kooijman at TIFN.NL (Valesca Kooijman) Date: Fri, 16 May 2008 12:56:19 +0200 Subject: Valesca Kooijman is out of the office. Message-ID: I will be out of the office starting 16-05-2008 and will not return until 08-06-2008. I will respond to your message when I return. For urgent messages, please contact Corine Beemster (beemster at tifn.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/fcdonders/fieldtrip. From Kooijman at TIFN.NL Fri May 16 18:56:32 2008 From: Kooijman at TIFN.NL (Valesca Kooijman) Date: Fri, 16 May 2008 18:56:32 +0200 Subject: Valesca Kooijman is out of the office. Message-ID: I will be out of the office starting Fri 05/16/2008 and will not return until Sun 06/08/2008. I will respond to your message when I return. For urgent messages, please contact Corine Beemster (beemster at tifn.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/fcdonders/fieldtrip. From grion at SISSA.IT Tue May 20 10:47:24 2008 From: grion at SISSA.IT (Natalia Grion) Date: Tue, 20 May 2008 10:47:24 +0200 Subject: Phase- angle In-Reply-To: Message-ID: Dear fieldtrippers, one question about freqdescriptives: I'm computing the phase locking value (and its angle) of 2 electrodes. I want to keep the phase difference of trials (apart from the average; plv), there is no cfg.keeptrials option for freqdescriptives, did anybody implement it? Thanks! Natalia ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Tue May 20 11:20:17 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Tue, 20 May 2008 11:20:17 +0200 Subject: Phase- angle In-Reply-To: <4832901C.2030904@sissa.it> Message-ID: Dear Natalia, Basically, the information you want can already be extracted from the data. However, you do not have to call freqdescriptives in the first place. When you call freqanalysis with cfg.output = 'powandcsd' and cfg.keeptrials = 'yes' and cfg.channelcmb as a cell-array containing the sensor-combination you want to compute the phase-difference from you pretty much have it. The output to freqanalysis will then contain single trial, complex valued cross-spectral densities. The angle can be easily extracted. Hope this helps, Jan-Mathijs On May 20, 2008, at 10:47 AM, Natalia Grion wrote: > Dear fieldtrippers, > one question about freqdescriptives: > I'm computing the phase locking value (and its angle) of 2 > electrodes. I want to keep the phase difference of trials (apart > from the average; plv), there is no cfg.keeptrials option for > freqdescriptives, did anybody implement it? > Thanks! > Natalia > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From grion at SISSA.IT Tue May 20 12:02:10 2008 From: grion at SISSA.IT (Natalia Grion) Date: Tue, 20 May 2008 12:02:10 +0200 Subject: Phase- angle In-Reply-To: <7B4D152D-F472-45F3-A7DC-27994066803A@psy.gla.ac.uk> Message-ID: Thanks Jan-Mathijs! jan-mathijs schoffelen wrote: > Dear Natalia, > > Basically, the information you want can already be extracted from the > data. However, you do not have to call freqdescriptives in the first > place. > When you call freqanalysis with cfg.output = 'powandcsd' and > cfg.keeptrials = 'yes' and cfg.channelcmb as a cell-array containing > the sensor-combination you want to compute the phase-difference from > you pretty much have it. > The output to freqanalysis will then contain single trial, complex > valued cross-spectral densities. The angle can be easily extracted. > > Hope this helps, > > Jan-Mathijs > > On May 20, 2008, at 10:47 AM, Natalia Grion wrote: > >> Dear fieldtrippers, >> one question about freqdescriptives: >> I'm computing the phase locking value (and its angle) of 2 >> electrodes. I want to keep the phase difference of trials (apart >> from the average; plv), there is no cfg.keeptrials option for >> freqdescriptives, did anybody implement it? >> Thanks! >> Natalia >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Tue May 20 15:22:55 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Tue, 20 May 2008 15:22:55 +0200 Subject: Baseline Problem Message-ID: Dear Robert, dear Fieldtrippers, I recently reported on some strange sensor signals that were complete on one side of the baseline. I have meanwhile run the checks Robert proposed to get the average fields throughout the baseline and I find values as high as 20fT, which I think is too much!? Maybe it's just something stupid in my code (attached below). Maybe it's related to the fact that we set the threshold for sensor jumps quite high (50)? We chose such a high value because the standard value would report sensor jumps in files where careful visual inspection didn' seem to find any... %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Preprocessing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % File selection pathname = '/data/MEGArchive/data/meg/CTF_Data/MooneyFacesMEEG.proc/DATASETS/'; outpath = '/net/M036-LFS1/srv/data1/home1/ctillman/data/MooneyMEEGFieldtripAnalysis/MEG_Preprocessing/controls_chanjump50/'; % "Design matrix % first Column: subject basefilename % second column: vector of valid run numbers % third column: name of trialfun for that particular subject % fourth column: trial types as defined in the trialfunction (!) % that should be analysed Design = { 'ABA04_MooneyFacesMEEG_20070625_0', [1 2 3 4 5 6], 'mytrialfun_MooneyMEEG_FaceRightButton',[1 4]; }; for subject = 1:size(Design,1) conditions = Design{subject,4}; % These are the correct trials for conditioncount = 1:length(conditions) DataOut = []; OutFileName = strcat(outpath, 'PreprocNew1secbase_',Design{subject,1},'_cond_',... num2str(Design{subject,4}(1,conditioncount)),... '.mat'); for run = 1:size(Design{subject,2},2) filename = strcat(Design{subject,1},num2str(Design{subject,2}(1,run)),'.ds'); fullname = strcat(pathname,filename); disp('working on: '); disp(filename); disp(strcat('# of run in Design is: ',num2str(Design{subject,2}(1,run)))); % Channel selection cfg = []; cfg.channel = {'MEG', '-MLP12', '-MRC14', '-MLT41', '-MRC25', '-MRP56', '-MRT21', '-MLO21', '-MRO44', '-MRT47'}; % added -MLO21 % for compatibility because it is bad in some subjects cfg.channelmeg = {'MEG' ... '-MLP12' '-MRC14' '-MLT41'... '-MRC25' '-MRP56' '-MRT21', '-MLO21','-MRO44','-MRT47'}; cfg.dataset = fullname; % Trial definition cfg.cond = conditions(conditioncount); % selection of one of the 4 possible conditions (see readme.txt) cfg.trialfun = Design{subject,3}; cfg = definetrial(cfg); % Artifact rejection cfg.artfctdef.feedback = 'no'; cfg.artfctdef.eog.sgn = 'MRT41'; % selection of channel MRT41 as the pseudo EOG channel cfg = artifact_eog(cfg); % automatic eye blinks rejection cfg.artfctdef.jump.sgn = cfg.channelmeg; % selection of valid channels cfg.artfctdef.jump.cutoff = 50; cfg = artifact_jump(cfg); % automatic sensor jump rejection cfg.artfctdef.muscle.cutoff = 6; % default = 4 cfg.artfctdef.muscle.sgn = cfg.channelmeg; % selection of valid channels cfg = artifact_muscle(cfg); % automatic muscle activity rejection cfg = rejectartifact(cfg); % Baseline correction cfg.blc = 'yes'; % baseline correction cfg.blcwindow = [-0.5 -0.1]; cfg.detrend = 'yes'; preproc = preprocessing(cfg); % preprocessing % Concatenate the data as necessary if run <=1 DataOut1 = preproc; % buffer DataOut for the first concatenation end if run == 2 cfg = []; DataOut = appenddata(cfg, DataOut1, preproc); end if run > 2 cfg = []; DataOut = appenddata(cfg, DataOut, preproc); end end % end of run-loop % write data for one subject and one condition to disk save(OutFileName, 'DataOut'); end % end of condition loop end % end of subject loop exit; %exit MATLAB to free licence %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % trialfunction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function trl = mytrialfun_MooneyMEEG_FaceRightButton(cfg); hdr = read_fcdc_header(cfg.dataset); event = read_fcdc_event(cfg.dataset); pre = 1; % pretrigger interval in seconds post = 1; % posttrigger interval in seconds off = pre; % trigger offset into datapiece trl1 = []; trl2 = []; trl3 = []; trl4 = []; trl5 = []; trl6 = []; trl7 = []; trl8 = []; for i = 1 : length(event)-2 switch event(i).type case {'Upright'} % it is a stimulus trigger, define a trial begsample = event(i).sample - pre*hdr.Fs; % 1 second prestimulus data endsample = event(i).sample + post*hdr.Fs - 1; % 1 second post stimulus data offset = - off*hdr.Fs; % Position where the trigger initially was found for j = 1 : 1 % change this number if intervening triggers are present k = j % added for faulty datasets from PEGE_... if (strcmp(event(i+k).type,'UPPT001') | strcmp(event(i+k).type,'frontpanel trigger') ) k = k+1 end if (strcmp(event(i+k).type,'frontpanel trigger') | strcmp(event(i+k).type,'UPPT001')) k = k+1 end % see to what condition it belongs by looking at the button press response if strcmp(event(i+k).type,'ButtonNoFace') trl1(end+1,:) = round([begsample endsample offset]); end end % end for case {'Inverted'} % it is a stimulus trigger, define a trial begsample = event(i).sample - pre*hdr.Fs; % 0.5 second prestimulus data endsample = event(i).sample + post*hdr.Fs - 1; % 1 second post stimulus data offset = - off*hdr.Fs; % Position where the trigger initially was found for j = 1 : 1 % change this number if intervening triggers are present k = j % added for faulty datasets from PEGE_... if (strcmp(event(i+k).type,'UPPT001') | strcmp(event(i+k).type,'frontpanel trigger')) k = k+1 end if (strcmp(event(i+k).type,'frontpanel trigger') | strcmp(event(i+k).type,'UPPT001')) k = k+1 end if strcmp(event(i+k).type,'ButtonFace') trl4(end+1,:) = round([begsample endsample offset]); end end % end for end % end switch end % end for trl = eval(strcat('trl',num2str(cfg.cond))); % picking out the condition that was asked in cfg % (not so elegant; TODO: change so that not all arrays trl1 ... trl8 are build at each call of the function) trl = trl(2:end-1,:); % skip the first and last trial for potential boundary problems cfg.trl = trl; % needed for compatibility with some later functions ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From bps231 at NYU.EDU Wed May 21 02:58:14 2008 From: bps231 at NYU.EDU (Bernhard Staresina) Date: Wed, 21 May 2008 02:58:14 +0200 Subject: coherence stats Message-ID: Dear FieldTrip experts, I have a quick question about the statistical assessment of coherence. I first derive coherence values across two channels of interest for condition A and condition B by running (i) FREQ = freqanalysis [with cfg.output = 'powandcsd'] followed by (ii) COH = freqdescriptives(FREQ), separately for each condition. Now, how can I assess whether the coherence values differ significantly between condition A and condition B? First I thought the I can just plug in COH_condition_A and COH_condition_B into freqstatistics (using montecarlo randomizations). But given that COH doesn't contain trial-by-trial data any more, that doesn't seem to work. So, I assume that I should use FREQ_condition_A and FREQ_condition_B instead? But if so, how does the code know what data to choose for the stats (e.g., crsspctrm versus powspctrm)? Any guidance would be appreciated. Best, Bernhard ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Wed May 21 11:18:32 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 21 May 2008 11:18:32 +0200 Subject: coherence stats In-Reply-To: Message-ID: Dear Bernhard, Indeed, since coherence already is a kind of 'statistic', and computed across observations, you have to walk a different path. Personally I usually perform statistics on coherence between conditions on the group level, but from your question I understand that you want to compare within a subject. If you would want to go for the non-parametric option (which I would strongly encourage) you could have a look at Maris et al. J Neurosci Meth 2007. As such I think that the method is implemented in Fieldtrip. If you prefer to stick to a parametric approach you could for example have a look at Bokil et al J Neurosci Meth 2006, or Amjad J Neurosci Meth 1997. These methods are not readily available in Fieldtrip but Hemant Bokil's double jackknife approach should be present in the Chronux software package. Finally, you could try to compute a condition specific variance of coherence, and perform a simple T-test across the conditions. However, statistically this is not completely correct, because you are violating the t-test's assumption of gaussianity. Anyway, a variance estimate of coherence can be obtained by specifying cfg.jackknife = 'yes' in freqdescriptives after having run freqanalysis with cfg.keeptrials = 'yes'. However, I believe that any T-value computation has to be done outside fieldtrip. Since this is not the path you seem to want to go, I'd suggest that you call freqanalysis with cfg.output = 'fourier'. If you subsequently call freqstatistics with cfg.statistic = 'indepsamplesZcoh', and a further appropriate cfg, I think you are pretty much there. However, I believe statfun_indepsamplesZcoh computes coherence between all channel-combinations between the channels you provide it with, so you can run into memory problems if you have many channels. You could however create a loop in which you feed freqstatistics with a channel pair each time. I would then take care to initialize the random-number generator in the same way prior to every call of freqstatistics, so that the 'random' permutation is the same for all channel-pairs. Hope this helps, Jan-Mathijs On May 21, 2008, at 2:58 AM, Bernhard Staresina wrote: > Dear FieldTrip experts, > > I have a quick question about the statistical assessment of > coherence. I > first derive coherence values across two channels of interest for > condition > A and condition B by running (i) FREQ = freqanalysis [with > cfg.output = > 'powandcsd'] followed by (ii) COH = freqdescriptives(FREQ), > separately for > each condition. > Now, how can I assess whether the coherence values differ > significantly > between condition A and condition B? First I thought the I can just > plug in > COH_condition_A and COH_condition_B into freqstatistics (using > montecarlo > randomizations). But given that COH doesn't contain trial-by-trial > data any > more, that doesn't seem to work. So, I assume that I should use > FREQ_condition_A and FREQ_condition_B instead? But if so, how does > the code > know what data to choose for the stats (e.g., crsspctrm versus > powspctrm)? > > Any guidance would be appreciated. > > Best, > Bernhard > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From grion at SISSA.IT Thu May 22 15:45:29 2008 From: grion at SISSA.IT (Natalia Grion) Date: Thu, 22 May 2008 15:45:29 +0200 Subject: Permut-test- BetweenTrials Message-ID: Dear all, I having a bug when running freqstatistics (montecarlo, indepsamplesT), for difference in power between conditionA and B, (UO:trials). ??? Reference to non-existent field 'label'. Error in ==> statistics_wrapper at 325 stat.label = data.label; Error in ==> freqstatistics at 132 [stat] = statistics_wrapper(cfg, varargin{:}); 'label' refers to the channels from where pow was computed, this structure is in fact present in my data; I have 2 channels: 'H_LFP_1' 'B_LFP_3'. The point is that I cannot figure out which is the origin of the bug. Any help will be appreciated! Natalia PS: This is the code: cfg = []; cfg.channel = {'B_LFP_3'}; %cfg.channelcmb = []; cfg.latency = [-1.5 2]; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesT'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.neighbours = []; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg.numrandomization = 100; cfg.correctm = 'cluster'; design = zeros(1,size(freqoutNG6ITrigg.powspctrm,1)+size(freqoutNG6CTrigg.powspctrm,1)); design(1,1:size(freqoutNG6ITrigg.powspctrm,1)) = 1; design(1,(size(freqoutNG6ITrigg.powspctrm,1)+1):(size(freqoutNG6ITrigg.powspctrm,1)+... size(freqoutNG6CTrigg.powspctrm,1)))=2; cfg.design = design; cfg.ivar = 1; [stat] = freqstatistics(cfg, freqoutNG6ITrigg, freqoutNG6CTrigg); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From brian.roach at YALE.EDU Thu May 22 22:14:01 2008 From: brian.roach at YALE.EDU (Brian Roach) Date: Thu, 22 May 2008 13:14:01 -0700 Subject: [Fwd: freqanalysis_wltconvol.m wavelets] Message-ID: -------- Original Message -------- Subject: freqanalysis_wltconvol.m wavelets Date: Thu, 22 May 2008 12:47:11 -0700 From: Brian Roach To: FieldTrip discussion list Hi All, Attached is a plot with 6 iterations of freqanalysis_wltconvol.m run (40Hz wavelet plotted). From top to bottom, these plots show 1. cfg.width = 7, cfg.gwidth = 1 2. cfg.width = 7, cfg.gwidth = 2 3. cfg.width = 7, cfg.gwidth = 3 4. cfg.width = 14, cfg.gwidth = 4 5. cfg.width = 14, cfg.gwidth = 5 6. cfg.width = 14, cfg.gwidth = 6 My question is regarding the peaks of the windowed wavelets - why are they offset from one another? I would think that the peak latencies should not shift, only the number of cycles or the length of the gauss should change with the cfg manipulations above. In addition to that question, I have attached a screen shot from the matlab help on the topic of complex morlet wavelets. There, it looks like the real part should have its peak at the 0 point or middle of the gauss, which does not appear to be the case in any of my 6 examples. Is this peak at 0ms a necessary feature or a morlet wavelet, or is it always plotted this way as a convention, not as a rule? thank you, Brian ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: waveScreen_matlab.png Type: image/png Size: 14881 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 40HzWavelets.png Type: image/png Size: 22188 bytes Desc: not available URL: From Ingmar.Schneider at BIO.UNI-GIESSEN.DE Mon May 26 20:12:07 2008 From: Ingmar.Schneider at BIO.UNI-GIESSEN.DE (Ingmar Schneider) Date: Mon, 26 May 2008 20:12:07 +0200 Subject: Messtermin Probemessung In-Reply-To: <667272528@web.de> Message-ID: Hi Michael, ich weiß nicht, ob du es vorhin noch mitbekommen hast. Für Mittwoch, den 28.05.2008 habe ich die Probemessung im Netz eingetragen. Tahmine hat sich bereit erklärt zwischen 14:00 Uhr und 18:00 Uhr das Versuchskaninchen zu spielen. Viele Grüße, Ingmar ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Ingmar.Schneider at BIO.UNI-GIESSEN.DE Mon May 26 20:16:51 2008 From: Ingmar.Schneider at BIO.UNI-GIESSEN.DE (Ingmar Schneider) Date: Mon, 26 May 2008 20:16:51 +0200 Subject: Wrong recipient! Message-ID: Dear Fieldtrippers, please just ignore the last mail I sent to the discussionlist. I picked the wrong recipient from my address book. Regards, Ingmar ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From soren.r.christensen at GSK.COM Mon May 26 21:08:25 2008 From: soren.r.christensen at GSK.COM (Soren Rahn Christensen) Date: Mon, 26 May 2008 20:08:25 +0100 Subject: Soren R Christensen is out of the office. Message-ID: I will be out of the office starting 24-May-2008 and will not return until 01-Jun-2008. I'll be back June 2nd. ----------------------------------------------------------- This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS. ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gregstuarthooper at GMAIL.COM Tue May 27 04:54:36 2008 From: gregstuarthooper at GMAIL.COM (Greg Hooper) Date: Tue, 27 May 2008 04:54:36 +0200 Subject: error Message-ID: Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core system. The header information reads fine, but I get the following error message in Matlab when trying to use read_data ??? Error using ==> fileio-20080526\private\read_24bit this function is implemented as mex file and is not available for this platform Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 buf = read_24bit(filename, offset, epochlength); Error in ==> read_data at 429 dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); I have compiled the read_24bit.c as a mex file but this has not been successful The code is [hdr] = read_header('HHH_123.BDF'); % loads the header successfully dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I read this as as loading 1000 data points from channel 12 - is this correct? thankyou for any help Greg ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Tue May 27 08:52:49 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Tue, 27 May 2008 07:52:49 +0100 Subject: error In-Reply-To: Message-ID: Did you move your compiled file one directory up (into \private) and replace the previous version of the file? Vladimir On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: > Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using > fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core > system. > > The header information reads fine, but > I get the following error message in Matlab when trying to use read_data > > ??? Error using ==> fileio-20080526\private\read_24bit > this function is implemented as mex file and is not available for this platform > > Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 > buf = read_24bit(filename, offset, epochlength); > > Error in ==> read_data at 429 > dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); > > > > I have compiled the read_24bit.c as a mex file but this has not been successful > > The code is > > [hdr] = read_header('HHH_123.BDF'); % loads the header successfully > dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I > read this as as loading 1000 data points from channel 12 - is this correct? > > thankyou for any help > > Greg > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From gregstuarthooper at GMAIL.COM Tue May 27 09:25:46 2008 From: gregstuarthooper at GMAIL.COM (Greg Hooper) Date: Tue, 27 May 2008 17:25:46 +1000 Subject: error In-Reply-To: Message-ID: Thanks for the response Vladimir. Unfortunately moving the file up does not help - once compiled it forms a dll rather than a mex file. Is that where the error lies? On Tue, May 27, 2008 at 4:52 PM, Vladimir Litvak wrote: > Did you move your compiled file one directory up (into \private) and > replace the previous version of the file? > > Vladimir > > On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: >> Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using >> fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core >> system. >> >> The header information reads fine, but >> I get the following error message in Matlab when trying to use read_data >> >> ??? Error using ==> fileio-20080526\private\read_24bit >> this function is implemented as mex file and is not available for this platform >> >> Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 >> buf = read_24bit(filename, offset, epochlength); >> >> Error in ==> read_data at 429 >> dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); >> >> >> >> I have compiled the read_24bit.c as a mex file but this has not been successful >> >> The code is >> >> [hdr] = read_header('HHH_123.BDF'); % loads the header successfully >> dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I >> read this as as loading 1000 data points from channel 12 - is this correct? >> >> thankyou for any help >> >> Greg >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Tue May 27 09:55:17 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Tue, 27 May 2008 08:55:17 +0100 Subject: error In-Reply-To: Message-ID: I think it depends on your Matlab version. I've had this problem many times and recompiling with just 'mex read_24bit.c' in Matlab command line and moving the file up has always solved it for me. Maybe Robert will have some other ideas. Just to make sure - you really compiled it from Matlab command line, not with an external compiler? Best, Vladimir On Tue, May 27, 2008 at 8:25 AM, Greg Hooper wrote: > Thanks for the response Vladimir. Unfortunately moving the file up > does not help - once compiled it forms a dll rather than a mex file. > Is that where the error lies? > > On Tue, May 27, 2008 at 4:52 PM, Vladimir Litvak wrote: >> Did you move your compiled file one directory up (into \private) and >> replace the previous version of the file? >> >> Vladimir >> >> On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: >>> Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using >>> fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core >>> system. >>> >>> The header information reads fine, but >>> I get the following error message in Matlab when trying to use read_data >>> >>> ??? Error using ==> fileio-20080526\private\read_24bit >>> this function is implemented as mex file and is not available for this platform >>> >>> Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 >>> buf = read_24bit(filename, offset, epochlength); >>> >>> Error in ==> read_data at 429 >>> dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); >>> >>> >>> >>> I have compiled the read_24bit.c as a mex file but this has not been successful >>> >>> The code is >>> >>> [hdr] = read_header('HHH_123.BDF'); % loads the header successfully >>> dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I >>> read this as as loading 1000 data points from channel 12 - is this correct? >>> >>> thankyou for any help >>> >>> Greg >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >>> >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From gregstuarthooper at GMAIL.COM Tue May 27 10:18:20 2008 From: gregstuarthooper at GMAIL.COM (Greg Hooper) Date: Tue, 27 May 2008 18:18:20 +1000 Subject: error In-Reply-To: Message-ID: thanks again - yes that is the command i used - i have matlab 7.0.4 Greg On Tue, May 27, 2008 at 5:55 PM, Vladimir Litvak wrote: > I think it depends on your Matlab version. I've had this problem many > times and recompiling with just 'mex read_24bit.c' in Matlab command > line and moving the file up has always solved it for me. Maybe Robert > will have some other ideas. Just to make sure - you really compiled it > from Matlab command line, not with an external compiler? > > Best, > > Vladimir > > On Tue, May 27, 2008 at 8:25 AM, Greg Hooper wrote: >> Thanks for the response Vladimir. Unfortunately moving the file up >> does not help - once compiled it forms a dll rather than a mex file. >> Is that where the error lies? >> >> On Tue, May 27, 2008 at 4:52 PM, Vladimir Litvak wrote: >>> Did you move your compiled file one directory up (into \private) and >>> replace the previous version of the file? >>> >>> Vladimir >>> >>> On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: >>>> Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using >>>> fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core >>>> system. >>>> >>>> The header information reads fine, but >>>> I get the following error message in Matlab when trying to use read_data >>>> >>>> ??? Error using ==> fileio-20080526\private\read_24bit >>>> this function is implemented as mex file and is not available for this platform >>>> >>>> Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 >>>> buf = read_24bit(filename, offset, epochlength); >>>> >>>> Error in ==> read_data at 429 >>>> dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); >>>> >>>> >>>> >>>> I have compiled the read_24bit.c as a mex file but this has not been successful >>>> >>>> The code is >>>> >>>> [hdr] = read_header('HHH_123.BDF'); % loads the header successfully >>>> dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I >>>> read this as as loading 1000 data points from channel 12 - is this correct? >>>> >>>> thankyou for any help >>>> >>>> Greg >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >>>> >>>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From florisdelange at GMAIL.COM Tue May 27 16:27:41 2008 From: florisdelange at GMAIL.COM (Floris de Lange) Date: Tue, 27 May 2008 16:27:41 +0200 Subject: ICA and artifact rejection Message-ID: Dear Fieldtrippers, I've started to play with using ICA to remove artifacts from the MEG signal. Now, there's a couple of questions that came to my mind. I hope anyone of you can help me with them. 1) ICA can be pretty slow, and it has been suggested in the Fieldtrip mailing list to use PCA and estimate only the 50 components that explain most variance. However, when I do this to e.g. identify ECG-related artifacts, I run into trouble when trying to decompose the ECG-locked data into the components, using the previously estimated 50 components (in order to calculate the coherence between the components and the ECG signal). The ECG-locked data is 275 channels X number of time points, so it cannot be simply decomposed into 50 components. Does anyone know how to go about this? 2) For EOG I suppose I could do like for ECG, and calculate the coherence with VEOG in order to select components that are artifacts. But this is not so easy for head muscle-related artifacts (jaw and neck movements, etc.), since we typically don't measure neck and jaw muscle EMG. Apart from looking at spatial topography, is there a robust criterion that one could use for detection of EMG artifact components? Or would it be better to use 'classical' artifact rejection routines for these kinds of artifacts? And would ICA also be suitable to remove things like jumps and head movements in the MEG, or is it better/safer to just throw away those kind of data segments? Thanks for your help, Best wishes, Floris ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nicolas.robitaille at UMONTREAL.CA Tue May 27 17:48:32 2008 From: nicolas.robitaille at UMONTREAL.CA (Nicolas Robitaille) Date: Tue, 27 May 2008 15:48:32 +0000 Subject: ICA and artifact rejection In-Reply-To: <483C1A5D.3000408@gmail.com> Message-ID: Dear Floris I used ICA to remove noise from MEG signal. I can share my experience. If calculation time is an issue, I suggest to use FastICA instead of infomaxICA, which is the default. You need to download the toolbox yourself (http://www.cis.hut.fi/projects/ica/fastica/), but Fieldtrip take charge of it afterward, it's a new option in componentanalysis. For both infomaxICA and FastICA you can specify to the routine a specific numbers of components (like 100 instead of 275) to output, which should also reduce computing time. You can also select a subset of your data that contains all the artefacts you are interested to remove, run ICA on that, and apply the signal reconstruction without the artefactual-component to the entire dataset. For artefactual-component identifications, I suggest to look simultaneously at the topography and the time-course of the components. My position is that we do not absolutely need robust objective criteria for artefactual-component identification, unless we want a fully automatize process (that I would not trust for now). Furthermore, it's always a good idea to look at the raw data you have, prior to any signal processing. The EOG and ECG components are obvious, you will pick them easily. Just find a time-window of raw data that shows these artefacts, and look at the time-course of the components. I suppose this would be the same for muscle-related artefact. Others artefacts are more complex for ICA. I would remove segments with jumps and head movements. Breathing artefacts tended, in my MEG data, to spread across severals components, so it was tedious to identify them. You may also consider if the time requiered to spare a noizy subject is worth, comparing to the time (and cost) to test another one. Hope this help, Nicolas ---------------------------------------- > Date: Tue, 27 May 2008 16:27:41 +0200 > From: florisdelange at GMAIL.COM > Subject: [FIELDTRIP] ICA and artifact rejection > To: FIELDTRIP at NIC.SURFNET.NL > > Dear Fieldtrippers, > > I've started to play with using ICA to remove artifacts from the MEG > signal. Now, there's a couple of questions that came to my mind. I hope > anyone of you can help me with them. > > 1) ICA can be pretty slow, and it has been suggested in the Fieldtrip > mailing list to use PCA and estimate only the 50 components that explain > most variance. However, when I do this to e.g. identify ECG-related > artifacts, I run into trouble when trying to decompose the ECG-locked > data into the components, using the previously estimated 50 components > (in order to calculate the coherence between the components and the ECG > signal). The ECG-locked data is 275 channels X number of time points, so > it cannot be simply decomposed into 50 components. Does anyone know how > to go about this? > 2) For EOG I suppose I could do like for ECG, and calculate the > coherence with VEOG in order to select components that are artifacts. > But this is not so easy for head muscle-related artifacts (jaw and neck > movements, etc.), since we typically don't measure neck and jaw muscle > EMG. Apart from looking at spatial topography, is there a robust > criterion that one could use for detection of EMG artifact components? > Or would it be better to use 'classical' artifact rejection routines for > these kinds of artifacts? And would ICA also be suitable to remove > things like jumps and head movements in the MEG, or is it better/safer > to just throw away those kind of data segments? > > Thanks for your help, > Best wishes, > Floris > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 14:57:48 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 13:57:48 +0100 Subject: ICA and artifact rejection In-Reply-To: <483C1A5D.3000408@gmail.com> Message-ID: Hi Floris > 1) ICA can be pretty slow, and it has been suggested in the Fieldtrip > mailing list to use PCA and estimate only the 50 components that > explain most variance. However, when I do this to e.g. identify > ECG-related artifacts, I run into trouble when trying to decompose the > ECG-locked data into the components, using the previously estimated 50 > components (in order to calculate the coherence between the components > and the ECG signal). The ECG-locked data is 275 channels X number of > time points, so it cannot be simply decomposed into 50 components. > Does anyone know how to go about this? I'm not quite sure whether I understand the problem correctly. But obviously, if you have done a PCA first on the data, and do an ICA those principal components, in order to get back to the original data you have to multiply the unmixing matrix obtained from the ICA with that of the PCA. So if you only kept 50 principal components and pruned the others, your PC unmixing matrix will have 275 rows and 50 columns (ICA usually then 50 columns and rows) and in order to get back to your raw data you have to multiply the mixing matrices (i.e. pseudoinverse of the mixing matrix) of ICA and PCA in the correct order. I can provide you some code snippet if that is indeed the problem... > 2) For EOG I suppose I could do like for ECG, and calculate the > coherence with VEOG in order to select components that are artifacts. > But this is not so easy for head muscle-related artifacts (jaw and > neck movements, etc.), since we typically don't measure neck and jaw > muscle EMG. Apart from looking at spatial topography, is there a > robust criterion that one could use for detection of EMG artifact > components? Or would it be better to use 'classical' artifact > rejection routines for these kinds of artifacts? And would ICA also be > suitable to remove things like jumps and head movements in the MEG, or > is it better/safer to just throw away those kind of data segments? I would take out any short-lived non stationary (or non-frequently occuring) phenomena such as short muscle twitches and jumps in any case. For the more tonic muscle phenomena (like the neck and jaw muscles) ICA can do a decent job, but if subjects make movements the topography can each time be quite different - if a subject makes too many movements the whole idea of ICA as spatial filters is pointless cause the MEG sensor array won't follow the movement One problem with muscle artefacts is that there can be these huge variations in high-frequency power (muscle tonus primarily in neck and jaw muscle) over several blocks of trials. These can be detrimental for identifying gamma-oscillations and also for finding a decent rejection criteria for short-muscle artefacts (movements etc). In order to compensate for that we've written in Berlin some own muscle artefact routines that basically apply kind of a low-pass filter on the amplitude envelope of the high-frequency signal (that you use to separate short lived muscle artefacts from the ones with longer time course). You can use that to throw away the movements and leave the more tonic effects in (which may be in half of your trials or so) - to either take care of them by individual trial baseline correction or removing them by ICA. I can give you the scripts - but they use a radically different reading routine. I will also hand them over to Robert, they are written a bit differently than the usual fieldtrip stuff, but maybe he'll like them anyway best Markus PS: Personally, I became sceptical about ICA, cause it's so subjhecttive whether a compoentn is now an artefact component or not, whether to take it out or not. Also, often one and the "same" phenomenon are distributed acroiss components others you would expect to find you don't find. I didn't like that much what I saw ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 16:00:54 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 15:00:54 +0100 Subject: use of dipoles as spatial filters (for SEP) Message-ID: An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Wed May 28 16:15:54 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 28 May 2008 16:15:54 +0200 Subject: use of dipoles as spatial filters (for SEP) In-Reply-To: <483D6596.7040601@fil.ion.ucl.ac.uk> Message-ID: Hi Markus, Did you consider trying out the beamforming algorithm with multiple dipoles as a source model? As opposed to the dipole-fitting (which pinv'es the concatenated leadfields), the beamformer actually tries to suppress contributions of the other guys (provided they are not too much correlated in time). Obviously, the suppression will be more robust against violations of the temporal uncorrelation-assumption, when the leadfield-columns are less correlated. However, I would guess it's worth a try, and it's exactly what you try to achieve: to avoid mixing up correlated leadfield components. But perhaps I did not grasp the problem completely... ;o) Yours, JM On May 28, 2008, at 4:00 PM, Markus Bauer wrote: > > Hi fieldtrippers (in particular probably Robert) > > I have a few slightly more advanced questions regarding the use of > dipoles as spatial filters and the creation of multi-dipole models > with fieldtrip (questions in bold) > I know that the functionality of fieldtrip is not designed for > multi-dipole models, but neither Beamformer nor MNE worked somewhat > reliably (only worked in rather few subjects and then was usually > pretty smeared still), as often is the case...(for evoked fields in > this case). So I finally decided to once go back to the "gold > standard" of somatosensory EEG/MEG research > > I have used a serial fit-procedure to fit components of the SEP to > EEG data. The early components (50 and 80 ms post response) are > largely determined by two single dipoles, plus a symmetric dipole > later for bilateral S2. So it is kind of ok to fit simple dipoles > to those (though clearly not ideal) > > My first question: > Are there plans to extend the functionality of dipolefitting to > allow for proper serial fit (i.e. adding to be fitted dipoles to > existing ones) ? I guess it would not be that much rewriting to > include a fixed dipole and only fit the parameters of the other? > > Anyway, in order to create spatial filters I have then fitted the > orientation of each dipole (estimated from the moments) and thereby > reduced the leadfield to a onedimensional one. > In order to get to the sourcewaveforms, I have concatenated the > (one dimensional) leadfields associated with each source into a > common leadfield matrix (4 sources corresponding to 4 rows and 124 > columns for each channel) and then took the pseudoinverse of this > combined leadfield matrix - for use as spatial filters to obtain > sourcewaveforms - for the "complete solution". > > When I looked at those filters obtained, however, I realized that > it did not work that nicely, since the filters looked for at least > two components very similar - more similar than the respective > leadfields!! (which is contra-intuitive) > The topographies of the peaks where I fitted dipoles to are > beautiful single dipolar topographies and so are the single > leadfield matrices, but the filters are anything else than clean. > It is clear that they will represent a mixture between the sources > - mutually "supressing" each other. But at least for two of them > (the early sources for 50 and 80 ms with clearly distinct topos, > presumably area3b and area1) they pretty much mixed up. I was > surprised about this cause the topoghraphies look so distinct and I > would have assumed this should come out nicely (also considering > all the Hari-studies) > > Anyway, a look at the correlation matrix of the leadfields showed > that despite the topographies of those dipoles had quite a > different orientation they were correlated at 0.77 (weights over > channels). So I guess what happens is identical to a suppressor > effect in multiple regresion - when the predictors are too > correlated their weights get mixed up.... > > I tend to use the individual spatial filters now - not the > pseudoinverse of the combined source model (consisting of only > four, well identifiable sources). > My question: > > Is this justified - to take individual filters when having a multi- > dipole model ? > > I also realized that when I only included the first two sources > (the ones described above), and take the pseudoinverse the > separation succeeds much better. > > - Might prior regularization of the leadfield help ? > - Are there any standards about this - when to still use a combined > leadfield model ? I guess should be the same as in multiple > regression cause formulas more or less identical...? But I guess > nobody publishing sourcewaveforms from multidipole model cares > about it... > > I was a bit "shocked" to see how much this can falsify the results > (the waveforms), I also wouldn't have expected the leadfields (and > filters...) of such rather different sources to be that strongly > correlated. I assume it will be not much different in MEG, cause > they were both tangential dipoles, looking almost identical as in > MEG (apart from 90deg rotation due to field geometry). > My strategy is therefore to either use individual filters of single > dipoles or reduce the dipolar model...any other suggestions ?? > It seems it is really a very ill-posed problem that we're spending > our time with.... > > > thanks and best wishes > Markus > ---------------------------------- > > The aim of this list 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/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 16:41:31 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 15:41:31 +0100 Subject: use of dipoles as spatial filters (for SEP) In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 16:45:16 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 15:45:16 +0100 Subject: even one more dipole question...symmetry constraint... Message-ID: ....what precisely is the consequence of the symmetry constraint on the calculated leadfields for symmetrical sources ? I used the symmetry constraint for fitting two dipoles (for bilat. S2) and looked at the respective leadfields of the corresponding "individual" dipoles - to find out that they rather look not so individual at all... the coefficients of both had bilateral maxima, as the leadfields being a mixture of the two individual dipoles, being symmetric along some axes (y and z ?) and antisymmetric along the others (x?) I do not quite understand this, cause I assumed the symmetry constraint was only used to find the location parameter but the leadfields would then be calculated for each position independently.... but this does not seem to be the case. are there any assumptions about correlations of symmetric sources (dipoles) going in here to suppress the respective other source ? is there a reference to that ? thanks Markus ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 17:07:12 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 16:07:12 +0100 Subject: use of dipoles as spatial filters (for SEP) In-Reply-To: Message-ID: > > Did you consider trying out the beamforming algorithm with multiple > dipoles as a source model? > As opposed to the dipole-fitting (which pinv'es the concatenated > leadfields), the beamformer actually tries to suppress contributions > of the other guys (provided they are not too much correlated in time). > Obviously, the suppression will be more robust against violations of > the temporal uncorrelation-assumption, when the leadfield-columns are > less correlated. another reason why I didn't want to put the beamformer just into a location to estimate the timecourse of the evoked field is that you would have to calculate the covariance matrix-stepwise for each time point (or at least over timeintervals, in a sliding fashion) - otherwise the method is not legitimate - and I assume it will indeed substantially distort the results if one just calculates one covariance matrix over the whole (severely nonstationary) timeperiod where one wants to look at the source-waveform. this problem is more severe for evoked fields than in the frequency doman cause of greater transients, not separated by frequency.... has anyone got more experience with this / investigated more in depth ? my previous experience on this (with ordinary beamformers) wasn't that great m ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From fredericroux at HOTMAIL.DE Fri May 30 16:00:43 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Fri, 30 May 2008 16:00:43 +0200 Subject: strange baseline artefacts Message-ID: Dear Fieldtrippers, I have a very strange activity pattern in my baseline. This artefact only appears in 2 of 3 experimental conditions. Does anyone have an idea were this could come from? Regards, Frederic Dipl. Psych. Frederic Roux Max Planck Institut für Hirnforschung Abteilung Neurophysiologie Deutschordenstr. 46 60528 Frankfurt am Main Tel.: 069 / 6301 83225 Mail: fredericroux at hotmail.de froux at mpih-frankfurt.mpg.de _________________________________________________________________ Die aktuelle Frühjahrsmode - Preise vergleichen bei MSN Shopping http://shopping.msn.de/category/damenbekleidung/bcatid66/forsale?text=category:damenbekleidung&edt=1&ptnrid=230 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: sensorAvg_dB.jpg Type: image/jpeg Size: 105609 bytes Desc: not available URL: From nathanweisz at MAC.COM Fri May 30 22:39:38 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Fri, 30 May 2008 22:39:38 +0200 Subject: job vacancies in konstanz (germany) Message-ID: dear colleagues, 3 positions (1 postdoc, 2 phd) will be available in a newly founded research group (MEG / EEG / TMS) at the university of konstanz, starting earliest august 2008. see attached pdf for details. please pass this on to anyone who may be interested. cheers, nathan -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Emmy_KN08_positions.pdf Type: application/pdf Size: 30237 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue May 6 14:48:00 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 May 2008 14:48:00 +0200 Subject: Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** In-Reply-To: Message-ID: It might be related to the use of a mex file when reading in your data. The mex file then seems to deallocate a piece of memory that is not in use any more, see http://en.wikipedia.org/wiki/Malloc. It does not seem a serious problem, but perhaps you could give more information about your OS, matlab version and fileformat that you are working with, so that potential other problems related to this warning can be investigated. best regards, Robert On 30 Apr 2008, at 13:50, Frederic Roux wrote: > I get this error message every time I try to preprocess my data: > > > *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** > > Does anyone have a clue what this could mean? ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue May 6 14:53:59 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 May 2008 14:53:59 +0200 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Susana, Your problem might well be to the file being exported in a non- standard brainvision format. On 27 Apr 2008, at 0:01, Susana Silva wrote: > My questions are: > - In my position – someone who has eep files and brainvision files, > what is the most simple option: try to use eep or brainvision (at the > moment, I can use neither!) Reading the eep files requires mex files, and that requires additional software from ANT (a librarry with the low0-level routines). Since that software is not open source, it is not possible to recompile the MEX file on your platform. You could complain about the file format with ANT and/or get another Matlab version (an old matlab on windows should work). As such, the brainvision format seems the most pragmatic solution to me. > - Can you give me an example of a trial definition based upon a > brainvision file, let us say s1.eeg (data), s1.vhdr , s1.vmrk, > where ‘s33’ > (eventvalue) is the ‘Stimulus’ (eventtype)? Example trial definitions are given in the documentation on the fieldtrip website. > - In case I can not do the trial definition, how exactly should I > arrange my data so that they are equivalent to the output of > “definetrial”? You should specify a trl matrix as cfg.trl to the preprocessing function, that matrrix is explained in the documentation on the website and in the definetrial function help. 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/fcdonders/fieldtrip. From fredericroux at HOTMAIL.DE Tue May 6 15:07:08 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Tue, 6 May 2008 15:07:08 +0200 Subject: Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 ** In-Reply-To: <2F72F811-B941-4DE1-BECA-37DF9B3FB4D3@fcdonders.ru.nl> Message-ID: Hi Robert, thank you for answering. I found out what the error was related to. It's related to the 'feature accel off' option. When I launch my analysis with that option the bug does not appear. Can you tell me why that is so? I have 2 more questions: 1. Can I contribute to Fieldtrip with my functions? I've written a baseline Correction function that computes Decibeland Z-scores. I've also got other functions that could be useful to other users. 2. When I compute a Wavelet transformation of my MEG signals I get an aquward looking power spectrum that looks like the signal is full of epileptic spikes. It kinda looks like a 'flame pattern'. I remember that you mentioned it during the Fieldtrip toolkit but I can't remember what it was related to. Can you tell me what this means? The funny thing is that this does not happen when I do a multitaper analysis of the same signal. The parameters I used for the wavelet transform are the following: width = 4 and gwidth = 3. Best regards, Frederic Dipl. Psych. Frederic Roux Max Planck Institut für HirnforschungAbteilung NeurophysiologieDeutschordenstr. 4660528 Frankfurt am MainTel.: 069 / 6301 83225Mail: fredericroux at hotmail.de froux at mpih-frankfurt.mpg.de ---------------------------------------- > Date: Tue, 6 May 2008 14:48:00 +0200 > From: r.oostenveld at FCDONDERS.RU.NL > Subject: Re: [FIELDTRIP] Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** > To: FIELDTRIP at NIC.SURFNET.NL > > It might be related to the use of a mex file when reading in your > data. The mex file then seems to deallocate a piece of memory that is > not in use any more, see http://en.wikipedia.org/wiki/Malloc. It does > not seem a serious problem, but perhaps you could give more > information about your OS, matlab version and fileformat that you are > working with, so that potential other problems related to this > warning can be investigated. > > best regards, > Robert > > > On 30 Apr 2008, at 13:50, Frederic Roux wrote: > >> I get this error message every time I try to preprocess my data: >> >> >> *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** >> >> Does anyone have a clue what this could mean? > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ Lustige Emoticons für Ihren Messenger! Hier kostenlos downloaden! http://messenger.live.de/mein/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From zanasilva at GMAIL.COM Tue May 6 19:33:57 2008 From: zanasilva at GMAIL.COM (Susana Silva) Date: Tue, 6 May 2008 18:33:57 +0100 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Robert, Thank you very much for the information. In the mean time, I finally succeed in reading all brainvision files (yes, there should have been a problem with bv format, because I had to change the name of a field - to nChans- in the m file). However, after rereading the documentation, I still have a local (and very basic) question on the cfg for definetrial: what is a "dataset" when we are using brainvision files? Can it be replaced by the header file, the data file and the event/marker file? If so, what should bi included in the cfg (cfg.datafile, cfg.headerfile, cfg.event?) I tried that but it did not work out. Concerning the arrangement of data so as to match definetrial output, I also did this, based upon the documentation. However, this solution does not give a prestimulus time, to be seen in each trial as referenced to a negative time (eg: time -0.2 up to time 0) . I believe this is necessary to view the baseline later. Thank you again. Best regards, Susana Silva On 5/6/08, Robert Oostenveld wrote: > > Hi Susana, > > Your problem might well be to the file being exported in a non-standard > brainvision format. > > > On 27 Apr 2008, at 0:01, Susana Silva wrote: > > > My questions are: > > - In my position – someone who has eep files and brainvision > > files, > > what is the most simple option: try to use eep or brainvision (at the > > moment, I can use neither!) > > > > Reading the eep files requires mex files, and that requires additional > software from ANT (a librarry with the low0-level routines). Since that > software is not open source, it is not possible to recompile the MEX file on > your platform. You could complain about the file format with ANT and/or get > another Matlab version (an old matlab on windows should work). As such, the > brainvision format seems the most pragmatic solution to me. > > - Can you give me an example of a trial definition based upon a > > brainvision file, let us say s1.eeg (data), s1.vhdr , s1.vmrk, where > > 's33' > > (eventvalue) is the 'Stimulus' (eventtype)? > > > > Example trial definitions are given in the documentation on the fieldtrip > website. > > - In case I can not do the trial definition, how exactly should I > > arrange my data so that they are equivalent to the output of > > "definetrial"? > > > > You should specify a trl matrix as cfg.trl to the preprocessing function, > that matrrix is explained in the documentation on the website and in the > definetrial function help. > > 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/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathan.dees at UMSL.EDU Wed May 7 00:54:05 2008 From: nathan.dees at UMSL.EDU (Nathan Dees) Date: Wed, 7 May 2008 00:54:05 +0200 Subject: CMCorig data, Coherence Tutorial Message-ID: How can one gain access to the dataset 'CMCorig' discussed in the tutorials, specifically the tutorial on Coherence? This file is not included in the SubjectCMC data posted on the tutorial data section of the website. Has anyone else had trouble running the Coherence tutorial from start to finish - I thought having access to this data might help me get through certain sections? Thank you ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Fri May 9 09:18:19 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 9 May 2008 09:18:19 +0200 Subject: Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 ** In-Reply-To: Message-ID: Hi Frederic On 6 May 2008, at 15:07, Frederic Roux wrote: > I found out what the error was related to. It's related to the > 'feature accel off' option. > > When I launch my analysis with that option the bug does not appear. > Can you tell me why that is so? I don't know what the relatino between "feature accel off" and the emx file is, I have not heard about problems with that before. However, I know that in an older matlab versino (don't recall the exact version number) where that feature wa sintroduced, that there were problems with persistent variables (used underneath the cfg.feedback option in fieldtrip). To fix those matlab bugs, it was also needed to turn accel off. > I have 2 more questions: > > 1. Can I contribute to Fieldtrip with my functions? I've written a > baseline Correction function that computes Decibeland Z-scores. > I've also got other functions that could be useful to other users. The different baselineling options would be interesting to incorporate into the existing freqbaseline function. Would that be doable? If so, then they would automatically be available for plotting (cfg.baselinetype refers to freqbaseline). For the other functions: In the past other people within the Donders have contributed some miscellaneous functions as well. I have added them, but over the years (as they have not been maintained) the functions might have lost their usefullness. Those functions sofar also have not all been included in the external ftp release version of fieldtrip. However, I certainly would like to encourage people to contribute to fieldtrip. If the functions are sufficiently usefull and fieldtrip-like (regarding their interface and documentation) then I am also happy to add them to fieldtrip-main and play an active role in maintaining them. And for small-helper functions I could add a directory fieldtrip/contrib where those functions could go. An example functions that I think would be better of in fieldtrip/ contrib would be source2sparce.m (which is a helper function taht I made myself, but it is not very fieldtrip-like). > 2. When I compute a Wavelet transformation of my MEG signals I get > an aquward looking power spectrum that looks like the signal is > full of epileptic spikes. > It kinda looks like a 'flame pattern'. I remember that you > mentioned it during the Fieldtrip toolkit but I can't remember what > it was related to. Can you tell me what this means? There are probably short and sharp transients in your data (i.e. "blips"). The morlet wavelets for the higher frequencies get shorter and shorter, and increase the frequency bandwith at trhe same time. So a broad-looking blip at a low frequency becomes smaller at higher frequencies, hence the flame pattern. > The funny thing is that this does not happen when I do a multitaper > analysis of the same signal. With multitapers you probably use a longer t_ftimwin for the high frequencies (where the morlet wavelets are short, especially with your cfg.width=4). The increased timewindow together with the multiple tapers results in a more robust power estimate, which is less affected by noise (your blips). 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/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Fri May 9 09:19:34 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 9 May 2008 09:19:34 +0200 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Susana On 6 May 2008, at 19:33, Susana Silva wrote: > In the mean time, I finally succeed in reading all brainvision > files (yes, there should have been a problem with bv format, > because I had to change the name of a field - to nChans- in the m > file). Can you upload one of your problematic files to ftp.fcdonders.nl/pub/ incoming, or if it is less <1MB send it as email attachement to my personal email account? > However, after rereading the documentation, I still have a local > (and very basic) question on the cfg for definetrial: what is a > "dataset" when we are using brainvision files? Can it be replaced > by the header file, the data file and the event/marker file? If so, > what should bi included in the cfg (cfg.datafile, cfg.headerfile, > cfg.event?) I tried that but it did not work out. You can specify cfg.datafile and cfg.headerfile seperately, or in your case you can specify cfg.dataset=yourfile.vhdr. Also for the events (which are read using read_fcdc_event) you can specify the header file, because that file contains the name of the accompanying event file. > Concerning the arrangement of data so as to match definetrial > output, I also did this, based upon the documentation. However, > this solution does not give a prestimulus time, to be seen in each > trial as referenced to a negative time (eg: time -0.2 up to time > 0) . I believe this is necessary to view the baseline later. This is from the definetrial documentation % The trial definition "trl" is an Nx3 matrix, N is the number of trials. % The first column contains the sample-indices of the begin of each trial % relative to the begin of the raw data, the second column contains the % sample-indices of the end of each trial, and the third column contains % the offset of the trigger with respect to the trial. An offset of 0 % means that the first sample of the trial corresponds to the trigger. A % positive offset indicates that the first sample is later than the trigger, % a negative offset indicates that the trial begins before the trigger. The trl matrix is used to read in the interesting segments of the data with the preprocessing function (using the first and second column of trl) and to attach a timeaxis to each trial (using the third column). 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/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri May 9 10:39:16 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 9 May 2008 10:39:16 +0200 Subject: CMCorig data, Coherence Tutorial In-Reply-To: Message-ID: Dear Nathan, Indeed the CMCorig mat-file is missing from the ftp-server, but in principle it can be generated by executing the preceding steps in the tutorial. We will change the tutorial accordingly. Historically, the tutorials have been used at the FCDC toolkit-courses for data analysis, and students had the mat-file available to save some time. However, from your mail I conclude that you had some problems running the tutorial itself, probably unrelated to the (un)availability of the CMCorig file. If so, could you just retry running the tutorial and let us know whether and where specified problems arise? Thanks, Jan-Mathijs On May 7, 2008, at 12:54 AM, Nathan Dees wrote: > How can one gain access to the dataset 'CMCorig' discussed in the > tutorials, specifically the tutorial on Coherence? This file is not > included in the SubjectCMC data posted on the tutorial data section > of the > website. > > Has anyone else had trouble running the Coherence tutorial from > start to > finish - I thought having access to this data might help me get > through > certain sections? > > Thank you > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri May 9 16:55:11 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 9 May 2008 16:55:11 +0200 Subject: strange sensor signals in the baseline Message-ID: Dear Fieldtrippers, I have some data from a 275ch CTF system, that were (in each single subject) preprocessed in Fieldtrip with baseline correction and detrending. If I now look at the grandaverage ERP some sensors have a nonzero signal that is entirely on one side (either completely above or completely below) of the baseline, while most sensors oscillate around zero as I would expect. Is this an effect of detrending, i.e. is detrending performed AFTER baseline correction AND on the whole datapiece, instead of just the specified baseline interval? Any suggestions welcome. 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/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From zanasilva at GMAIL.COM Tue May 13 00:02:18 2008 From: zanasilva at GMAIL.COM (Susana Silva) Date: Mon, 12 May 2008 23:02:18 +0100 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Robert, On 6 May 2008, at 19:33, Susana Silva wrote: > In the mean time, I finally succeed in reading all brainvision files (yes, > > there should have been a problem with bv format, because I had to change the > > name of a field - to nChans- in the m file). > > > > Can you upload one of your problematic files to ftp.fcdonders.nl/pub/incoming, > or if it is less <1MB send it as email attachement to my personal email > account? I send you a .vhdr file and a .vmrk file from a subject, both as I exported from ASA. The .eeg is too big. Maybe you can figure out quickly if the brainvision format is anyhow problematic for fieldtrip. I remind you that my problem, now, is to use the define trial function. Thank you very much susana ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue May 13 09:26:35 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 May 2008 09:26:35 +0200 Subject: 2 Post-doctoral positions at the University of Chieti - MEGMRI Message-ID: 2 Post-doctoral positions at the University of Chieti - Institute of Advanced Biomedical Technologies (ITAB) to work on MEGMRI, a FP7 sponsored project, starting immediately. MEGMRI goal is to produce and validate a hybrid instrument able to perform simultaneous MEG and MRI for obtaining undistorted structural brain images and time-resolved functional maps that are spatially precisely aligned with each other. The project has three main tasks: i) build optimized magnetic femtotesla sensors for MEG and MRI; ii) the production of an MEG-MRI hybrid prototype; iii) pre-clinical validation of MEG-MRI. MEGMRI is a multi-center project involving the following centers: Helsinki University of Technology (Finland, coordinator), Aivon Oy (Finland), CEDRAT (France), Chalmers Tekniska Hoegskola Aktiebolag (Sweden), University of Chieti (Italy), Commissariat à l’energie atomique (France), Elekta AB (Sweden), Associazione Fatebenefratelli per la Ricerca (Italy), Hospital District of Helsinki and Uusimaa (Finland), Imaging Technology Abruzzo (Italy), PTB (Germany), University of Parma (Italy), Valtion teknillinen tutkimuskeskus (Finland) The two positions are for: 1) One position for a post-doc working on MEGMRI instrumentation development. The post-doc is expected to work on a prototype using superconducting devices for the detection of the MEG and MRI signals. Candidates should have a PhD in Physics or Engineering. Candidates should be already familiar either with MEG or MRI hardware. Skills in signal processing as well as computer programming (C++, Matlab) is highly desirable. 2) One position for a post-doc working on MEGMRI software development. The post-doc is expected to work on software for MEG- MRI data integration to produce a toolbox to be included in an MEG analysis software. Candidates should have a PhD in Physics, Engineering, or Computer Science. Candidates should be already familiar either with MEG or MRI methods. Applications should include CV, a research statement, and 2 letters of recommendation. The positions will be assigned on a 2+2 years schedule. Chieti is a university town, located in central Italy, about 15 minutes from the Adriatic coast, 30 minutes from the Parco Nazionale degli Abruzzi, the largest natural reserve in Italy, great skying, hiking, and mountain or seaside activities, only 2 hours from Rome. Please forward the application materials to: Prof. Gian Luca Romani, glromani at itab.unich.it Institute of Advanced Biomedical Technologies University of Chieti 66013 Chieti, ITALY ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue May 13 12:30:41 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 May 2008 12:30:41 +0200 Subject: strange sensor signals in the baseline In-Reply-To: <667272528@web.de> Message-ID: On 9 May 2008, at 16:55, Michael Wibral wrote: > Dear Fieldtrippers, > > I have some data from a 275ch CTF system, that were (in each single > subject) preprocessed in Fieldtrip with baseline correction and > detrending. If I now look at the grandaverage ERP some sensors have > a nonzero signal that is entirely on one side (either completely > above or completely below) of the baseline, while most sensors > oscillate around zero as I would expect. Is this an effect of > detrending, i.e. is detrending performed AFTER baseline correction > AND on the whole datapiece, instead of just the specified baseline > interval? Hi Michael, detrending is done prior to baselinecorrection. See fieldtrip/private/ preproc.m around line 346. Note that for detrending always the whole segment is used (minus the optional filterpadding), whereas for baseline correction you can specify the baseline window. The default for baseline correction is to use the whole segment (also minus the filter padding). If you use filter padding, then it is technically possible to specify a baseline window that extends into (or even is completely in) the padding. Did you use padding, and what did you specify as cfg.blcwindow? However, regardless of the order of detrending and baselinecorrection and assuming that you did not use filter padding, your ERFs should all have an average of zero over the time axis. An easy check is to compute baseline = mean(timelock.avg, 2); or baseline = mean(raw.trial{i}, 2); for each of your trials. This returns a nchansX1 vector that should be zero (or very close to zero) for each channel. 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/fcdonders/fieldtrip. From sdmuthu at CARDIFF.AC.UK Tue May 13 16:57:12 2008 From: sdmuthu at CARDIFF.AC.UK (Suresh Muthukumaraswamy) Date: Tue, 13 May 2008 16:57:12 +0200 Subject: Minimum norm estimates... Message-ID: Hi, I am trying to use sourceanalysis to create minimum norm estimates. The software runs fine but the resulting images I get back are completely dominated by the voxels at the edges of my grid near the sensors. So I am wondering If I have either made a mistake somewhere or if there are some parameters that can be tweaked to improve the reconstructions? My data is 275Ch CTF data and for the purposes of trying out fieldtrip's MNE I am just using a simple VEP dataset, with the headmodel created by localSpheres. There is a simple field pattern in the data which I was hoping to reconstruct. I have used the DICS (power) part of sourceanalysis before and get images that look pretty similar to SAM images made outside of fieldtrip, so I think my MRI/registration stuff in fieldtrip is ok. Thanks, Suresh Here is my code Dataset = '/gpfs/home/sapsm7/Bristol/Day/DC/DC_VSM-VEF_20080409_01.ds'; hdmFile = [Dataset '/default.hdm'] ;%assumes localSpheres has been run mrifile = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.mri'; shapefilename = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.shape'; OutImage = '/gpfs/home/sapsm7/Bristol/Day/DC/testminnorm'; cfg = []; cfg.trialdef.prestim = 2; %How much of the prestim to load in (s) cfg.trialdef.poststim = 2; cfg.trialdef.eventtype = 'High'; cfg.dataset = Dataset cfg.channel = {'MEG'}; %Right V5 and Left V5 sensitive cfg.bpfilter = [0.5 30]; cfg.lpfilter = 30 cfg.blc = 'yes'; cfg.blcwindow = [-0.2 0]; cfg = definetrial(cfg); Data = preprocessing(cfg); save DC_RawData load DC_RawData cfg = []; cfg.latency = [-0.2 1]; DCERF = timelockanalysis(cfg, Data); cfg = []; cfg.baseline = [-0.2 0]; DCERF = timelockbaseline(cfg, DCERF); %At this point the waveform plots and topos in fieldtrip look very nice [XMax, XMin, YMax, YMin, ZMax, ZMin] = shapefilemaxmin (shapefilename) ; %Extract the source reconstruction grid from the shapefile Resolution = 1; cfg = []; cfg.method = 'mne'; cfg.hdmfile = hdmFile; cfg.grid.xgrid = XMin : Resolution : XMax; cfg.grid.ygrid = YMin : Resolution : YMax; cfg.grid.zgrid = ZMin : Resolution : ZMax; [sourcePre] = sourceanalysis(cfg, DCERF); sourcePre.avg.coll = mean(sourcePre.avg.pow(:,169:183), 2); %Grab a time window and put into a variable for sourceint cfg = []; cfg.downsample = 2; sourceInt = sourceinterpolate(cfg, sourcePre, mrifile); sourceInt.avg.coll = sourceInt.avg.coll * 1e10 %upscale to make it easy to visualise in mri3dX %Write the analyse files out DeleteAnalyseFiles(OutImage); cfg = []; cfg.parameter = 'coll'; cfg.filename = OutImage; cfg.filetype = 'spm'; cfg.coordinates = []; cfg.datatype = 'float'; cfg.coordinates = 'ctf'; volumewrite(cfg, sourceInt); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue May 13 20:40:28 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 May 2008 20:40:28 +0200 Subject: Minimum norm estimates... In-Reply-To: Message-ID: Hi Suresh On 13 May 2008, at 16:57, Suresh Muthukumaraswamy wrote: > I am trying to use sourceanalysis to create minimum norm > estimates. The > software runs fine but the resulting images I get back are completely > dominated by the voxels at the edges of my grid near the sensors. > So I am > wondering If I have either made a mistake somewhere or if there are > some > parameters that can be tweaked to improve the reconstructions? The standard MNE is non-regularised. Since superficial dipoles result in a much stronger leadfield, the superficial sources are able to explain your data with much "smaller" norm, hence the minimum norm solution is very superficial. That is the depth bias inherent to MNE. The minimum norm estimate implementation has the following options % 'noisecov' = Nchan x Nchan matrix with noise covariance % 'sourcecov' = Nsource x Nsource matrix with source covariance (can be empty, the default will then be identity) % 'lambda' = scalar, regularisation parameter (can be empty, it will then be estimated from snr) % 'snr' = scalar, signal to noise ratio % 'reducerank' = reduce the leadfield rank, can be 'no' or a number (e.g. 2) % 'normalize' = normalize the leadfield % 'normalizeparam' = parameter for depth normalization (default = 0.5) These can be passed in sourceanalysis by specifying e.g. cfg.mne.normalize = 'yes'. See also the documentation included in the private functions minimumnormestimate and compute_leadfield. My first guess at the solution to your problem would be normalize and optionally the normalizeparam option. Depth regularization (or "depth weighing") is described in various papers and I recall that the normalizeparam comes from a paper by Wagner and/or Fuchs (Hamburg). I hope this suggestion gets you started. Since we have not used MNE ourselves sofar, I am curious to hear how it performs on your 275ch MEG data and which tweaks are most optimal. best regards, Robert > My data is 275Ch CTF data and for the purposes of trying out > fieldtrip's MNE > I am just using a simple VEP dataset, with the headmodel created by > localSpheres. There is a simple field pattern in the data which I > was hoping > to reconstruct. > I have used the DICS (power) part of sourceanalysis before and > get images > that look pretty similar to SAM images made outside of fieldtrip, > so I think > my MRI/registration stuff in fieldtrip is ok. > > Thanks, > Suresh > > Here is my code > > Dataset = '/gpfs/home/sapsm7/Bristol/Day/DC/DC_VSM- > VEF_20080409_01.ds'; > hdmFile = [Dataset '/default.hdm'] ;%assumes localSpheres has been run > mrifile = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.mri'; > shapefilename = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.shape'; > OutImage = '/gpfs/home/sapsm7/Bristol/Day/DC/testminnorm'; > > > cfg = []; > cfg.trialdef.prestim = 2; %How much of the prestim to load in (s) > cfg.trialdef.poststim = 2; > cfg.trialdef.eventtype = 'High'; > cfg.dataset = Dataset > cfg.channel = {'MEG'}; %Right V5 and Left V5 sensitive > cfg.bpfilter = [0.5 30]; > cfg.lpfilter = 30 > cfg.blc = 'yes'; > cfg.blcwindow = [-0.2 0]; > cfg = definetrial(cfg); > Data = preprocessing(cfg); > > save DC_RawData > > load DC_RawData > > cfg = []; > cfg.latency = [-0.2 1]; > DCERF = timelockanalysis(cfg, Data); > > cfg = []; > cfg.baseline = [-0.2 0]; > DCERF = timelockbaseline(cfg, DCERF); > > %At this point the waveform plots and topos in fieldtrip look very > nice > > > [XMax, XMin, YMax, YMin, ZMax, ZMin] = shapefilemaxmin > (shapefilename) ; > %Extract the source reconstruction grid from the shapefile > Resolution = 1; > cfg = []; > cfg.method = 'mne'; > cfg.hdmfile = hdmFile; > cfg.grid.xgrid = XMin : Resolution : XMax; > cfg.grid.ygrid = YMin : Resolution : YMax; > cfg.grid.zgrid = ZMin : Resolution : ZMax; > [sourcePre] = sourceanalysis(cfg, DCERF); > > sourcePre.avg.coll = mean(sourcePre.avg.pow(:,169:183), 2); %Grab a > time > window and put into a variable for sourceint > > cfg = []; > cfg.downsample = 2; > sourceInt = sourceinterpolate(cfg, sourcePre, mrifile); > > > sourceInt.avg.coll = sourceInt.avg.coll * 1e10 %upscale to make it > easy to > visualise in mri3dX > > %Write the analyse files out > DeleteAnalyseFiles(OutImage); > cfg = []; > cfg.parameter = 'coll'; > cfg.filename = OutImage; > cfg.filetype = 'spm'; > cfg.coordinates = []; > cfg.datatype = 'float'; > cfg.coordinates = 'ctf'; > volumewrite(cfg, sourceInt); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From muthuraman10 at HOTMAIL.COM Thu May 15 19:22:30 2008 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Thu, 15 May 2008 17:22:30 +0000 Subject: cross-spectral density matrix is rank deficient! Message-ID: Hello Fieldtrippers, I get the warning "cross-spectral density matrix is rank deficient" when running the sourceanalysis_DICS on simulated data. Any hints due to which the warning comes will be very helpfull, because the channel combination was selected for ''all" in the frequency analysis. Thanking you With regards, M.Muthuraman. _________________________________________________________________ Catch the latest fashion shows, get beauty tips and learn more on fashion and lifestyle. http://video.msn.com/?mkt=en-in ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Thu May 15 20:47:52 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 15 May 2008 19:47:52 +0100 Subject: cross-spectral density matrix is rank deficient! In-Reply-To: Message-ID: Hi Muthuraman, You are warned for the rank-deficiency of the csd-matrix, because this could lead to numerical instabilities when inverting this matrix. However, since fieldtrip uses pinv instead of inv, this does not lead to crashing scripts. On the other hand, the message basically is the consequence of the fact that: -you used too few trials to simulate the csd (the total number of tapers applied should ideally be > the number of channels), -you did not add enough sensor noise to your simulation. because you typically want to simulate fewer sources than sensors (which by definition makes the true source csd-matrix rank deficient) you really have to add sensor noise, -or both. Good luck Jan-Mathijs Quoting Muthuraman Muthuraman : > > Hello Fieldtrippers, > > I get the warning "cross-spectral density matrix is rank deficient" > when running the sourceanalysis_DICS on simulated data. > Any hints due to which the warning comes will be very helpfull, > because the channel combination was selected for ''all" in the > frequency analysis. > > > Thanking you > > With regards, > M.Muthuraman. > > _________________________________________________________________ > Catch the latest fashion shows, get beauty tips and learn more on > fashion and lifestyle. > http://video.msn.com/?mkt=en-in > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > ------------------------------------------------------------------ The 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/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri May 16 10:35:02 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 16 May 2008 10:35:02 +0200 Subject: cross-spectral density matrix is rank deficient! Message-ID: Hi Muthuraman, could it be that you have removed some channels from your data and did not calculate a new headmodel/leadfield? As far as I remember this will cause a similar error message (although strictly speaking it shouldn't). Michael > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list > Gesendet: 15.05.08 20:51:27 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] cross-spectral density matrix is rank deficient! > Hi Muthuraman, > > You are warned for the rank-deficiency of the csd-matrix, because this > could lead to numerical instabilities when inverting this matrix. > However, since fieldtrip uses pinv instead of inv, this does not lead > to crashing scripts. > On the other hand, the message basically is the consequence of the fact that: > > -you used too few trials to simulate the csd (the total number of > tapers applied should ideally be > the number of channels), > -you did not add enough sensor noise to your simulation. because you > typically want to simulate fewer sources than sensors (which by > definition makes the true source csd-matrix rank deficient) you really > have to add sensor noise, > -or both. > > Good luck > > Jan-Mathijs > > Quoting Muthuraman Muthuraman : > > > > > Hello Fieldtrippers, > > > > I get the warning "cross-spectral density matrix is rank deficient" > > when running the sourceanalysis_DICS on simulated data. > > Any hints due to which the warning comes will be very helpfull, > > because the channel combination was selected for ''all" in the > > frequency analysis. > > > > > > Thanking you > > > > With regards, > > M.Muthuraman. > > > > _________________________________________________________________ > > Catch the latest fashion shows, get beauty tips and learn more on > > fashion and lifestyle. > > http://video.msn.com/?mkt=en-in > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > > of the FieldTrip toolbox, to share experiences and to discuss new > > ideas for MEG and EEG analysis. See also > > http://listserv.surfnet.nl/archives/fieldtrip.html and > > http://www.ru.nl/fcdonders/fieldtrip. > > > > > > ------------------------------------------------------------------ > The 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/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From Kooijman at TIFN.NL Fri May 16 12:56:19 2008 From: Kooijman at TIFN.NL (Valesca Kooijman) Date: Fri, 16 May 2008 12:56:19 +0200 Subject: Valesca Kooijman is out of the office. Message-ID: I will be out of the office starting 16-05-2008 and will not return until 08-06-2008. I will respond to your message when I return. For urgent messages, please contact Corine Beemster (beemster at tifn.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/fcdonders/fieldtrip. From Kooijman at TIFN.NL Fri May 16 18:56:32 2008 From: Kooijman at TIFN.NL (Valesca Kooijman) Date: Fri, 16 May 2008 18:56:32 +0200 Subject: Valesca Kooijman is out of the office. Message-ID: I will be out of the office starting Fri 05/16/2008 and will not return until Sun 06/08/2008. I will respond to your message when I return. For urgent messages, please contact Corine Beemster (beemster at tifn.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/fcdonders/fieldtrip. From grion at SISSA.IT Tue May 20 10:47:24 2008 From: grion at SISSA.IT (Natalia Grion) Date: Tue, 20 May 2008 10:47:24 +0200 Subject: Phase- angle In-Reply-To: Message-ID: Dear fieldtrippers, one question about freqdescriptives: I'm computing the phase locking value (and its angle) of 2 electrodes. I want to keep the phase difference of trials (apart from the average; plv), there is no cfg.keeptrials option for freqdescriptives, did anybody implement it? Thanks! Natalia ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Tue May 20 11:20:17 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Tue, 20 May 2008 11:20:17 +0200 Subject: Phase- angle In-Reply-To: <4832901C.2030904@sissa.it> Message-ID: Dear Natalia, Basically, the information you want can already be extracted from the data. However, you do not have to call freqdescriptives in the first place. When you call freqanalysis with cfg.output = 'powandcsd' and cfg.keeptrials = 'yes' and cfg.channelcmb as a cell-array containing the sensor-combination you want to compute the phase-difference from you pretty much have it. The output to freqanalysis will then contain single trial, complex valued cross-spectral densities. The angle can be easily extracted. Hope this helps, Jan-Mathijs On May 20, 2008, at 10:47 AM, Natalia Grion wrote: > Dear fieldtrippers, > one question about freqdescriptives: > I'm computing the phase locking value (and its angle) of 2 > electrodes. I want to keep the phase difference of trials (apart > from the average; plv), there is no cfg.keeptrials option for > freqdescriptives, did anybody implement it? > Thanks! > Natalia > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From grion at SISSA.IT Tue May 20 12:02:10 2008 From: grion at SISSA.IT (Natalia Grion) Date: Tue, 20 May 2008 12:02:10 +0200 Subject: Phase- angle In-Reply-To: <7B4D152D-F472-45F3-A7DC-27994066803A@psy.gla.ac.uk> Message-ID: Thanks Jan-Mathijs! jan-mathijs schoffelen wrote: > Dear Natalia, > > Basically, the information you want can already be extracted from the > data. However, you do not have to call freqdescriptives in the first > place. > When you call freqanalysis with cfg.output = 'powandcsd' and > cfg.keeptrials = 'yes' and cfg.channelcmb as a cell-array containing > the sensor-combination you want to compute the phase-difference from > you pretty much have it. > The output to freqanalysis will then contain single trial, complex > valued cross-spectral densities. The angle can be easily extracted. > > Hope this helps, > > Jan-Mathijs > > On May 20, 2008, at 10:47 AM, Natalia Grion wrote: > >> Dear fieldtrippers, >> one question about freqdescriptives: >> I'm computing the phase locking value (and its angle) of 2 >> electrodes. I want to keep the phase difference of trials (apart >> from the average; plv), there is no cfg.keeptrials option for >> freqdescriptives, did anybody implement it? >> Thanks! >> Natalia >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Tue May 20 15:22:55 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Tue, 20 May 2008 15:22:55 +0200 Subject: Baseline Problem Message-ID: Dear Robert, dear Fieldtrippers, I recently reported on some strange sensor signals that were complete on one side of the baseline. I have meanwhile run the checks Robert proposed to get the average fields throughout the baseline and I find values as high as 20fT, which I think is too much!? Maybe it's just something stupid in my code (attached below). Maybe it's related to the fact that we set the threshold for sensor jumps quite high (50)? We chose such a high value because the standard value would report sensor jumps in files where careful visual inspection didn' seem to find any... %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Preprocessing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % File selection pathname = '/data/MEGArchive/data/meg/CTF_Data/MooneyFacesMEEG.proc/DATASETS/'; outpath = '/net/M036-LFS1/srv/data1/home1/ctillman/data/MooneyMEEGFieldtripAnalysis/MEG_Preprocessing/controls_chanjump50/'; % "Design matrix % first Column: subject basefilename % second column: vector of valid run numbers % third column: name of trialfun for that particular subject % fourth column: trial types as defined in the trialfunction (!) % that should be analysed Design = { 'ABA04_MooneyFacesMEEG_20070625_0', [1 2 3 4 5 6], 'mytrialfun_MooneyMEEG_FaceRightButton',[1 4]; }; for subject = 1:size(Design,1) conditions = Design{subject,4}; % These are the correct trials for conditioncount = 1:length(conditions) DataOut = []; OutFileName = strcat(outpath, 'PreprocNew1secbase_',Design{subject,1},'_cond_',... num2str(Design{subject,4}(1,conditioncount)),... '.mat'); for run = 1:size(Design{subject,2},2) filename = strcat(Design{subject,1},num2str(Design{subject,2}(1,run)),'.ds'); fullname = strcat(pathname,filename); disp('working on: '); disp(filename); disp(strcat('# of run in Design is: ',num2str(Design{subject,2}(1,run)))); % Channel selection cfg = []; cfg.channel = {'MEG', '-MLP12', '-MRC14', '-MLT41', '-MRC25', '-MRP56', '-MRT21', '-MLO21', '-MRO44', '-MRT47'}; % added -MLO21 % for compatibility because it is bad in some subjects cfg.channelmeg = {'MEG' ... '-MLP12' '-MRC14' '-MLT41'... '-MRC25' '-MRP56' '-MRT21', '-MLO21','-MRO44','-MRT47'}; cfg.dataset = fullname; % Trial definition cfg.cond = conditions(conditioncount); % selection of one of the 4 possible conditions (see readme.txt) cfg.trialfun = Design{subject,3}; cfg = definetrial(cfg); % Artifact rejection cfg.artfctdef.feedback = 'no'; cfg.artfctdef.eog.sgn = 'MRT41'; % selection of channel MRT41 as the pseudo EOG channel cfg = artifact_eog(cfg); % automatic eye blinks rejection cfg.artfctdef.jump.sgn = cfg.channelmeg; % selection of valid channels cfg.artfctdef.jump.cutoff = 50; cfg = artifact_jump(cfg); % automatic sensor jump rejection cfg.artfctdef.muscle.cutoff = 6; % default = 4 cfg.artfctdef.muscle.sgn = cfg.channelmeg; % selection of valid channels cfg = artifact_muscle(cfg); % automatic muscle activity rejection cfg = rejectartifact(cfg); % Baseline correction cfg.blc = 'yes'; % baseline correction cfg.blcwindow = [-0.5 -0.1]; cfg.detrend = 'yes'; preproc = preprocessing(cfg); % preprocessing % Concatenate the data as necessary if run <=1 DataOut1 = preproc; % buffer DataOut for the first concatenation end if run == 2 cfg = []; DataOut = appenddata(cfg, DataOut1, preproc); end if run > 2 cfg = []; DataOut = appenddata(cfg, DataOut, preproc); end end % end of run-loop % write data for one subject and one condition to disk save(OutFileName, 'DataOut'); end % end of condition loop end % end of subject loop exit; %exit MATLAB to free licence %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % trialfunction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function trl = mytrialfun_MooneyMEEG_FaceRightButton(cfg); hdr = read_fcdc_header(cfg.dataset); event = read_fcdc_event(cfg.dataset); pre = 1; % pretrigger interval in seconds post = 1; % posttrigger interval in seconds off = pre; % trigger offset into datapiece trl1 = []; trl2 = []; trl3 = []; trl4 = []; trl5 = []; trl6 = []; trl7 = []; trl8 = []; for i = 1 : length(event)-2 switch event(i).type case {'Upright'} % it is a stimulus trigger, define a trial begsample = event(i).sample - pre*hdr.Fs; % 1 second prestimulus data endsample = event(i).sample + post*hdr.Fs - 1; % 1 second post stimulus data offset = - off*hdr.Fs; % Position where the trigger initially was found for j = 1 : 1 % change this number if intervening triggers are present k = j % added for faulty datasets from PEGE_... if (strcmp(event(i+k).type,'UPPT001') | strcmp(event(i+k).type,'frontpanel trigger') ) k = k+1 end if (strcmp(event(i+k).type,'frontpanel trigger') | strcmp(event(i+k).type,'UPPT001')) k = k+1 end % see to what condition it belongs by looking at the button press response if strcmp(event(i+k).type,'ButtonNoFace') trl1(end+1,:) = round([begsample endsample offset]); end end % end for case {'Inverted'} % it is a stimulus trigger, define a trial begsample = event(i).sample - pre*hdr.Fs; % 0.5 second prestimulus data endsample = event(i).sample + post*hdr.Fs - 1; % 1 second post stimulus data offset = - off*hdr.Fs; % Position where the trigger initially was found for j = 1 : 1 % change this number if intervening triggers are present k = j % added for faulty datasets from PEGE_... if (strcmp(event(i+k).type,'UPPT001') | strcmp(event(i+k).type,'frontpanel trigger')) k = k+1 end if (strcmp(event(i+k).type,'frontpanel trigger') | strcmp(event(i+k).type,'UPPT001')) k = k+1 end if strcmp(event(i+k).type,'ButtonFace') trl4(end+1,:) = round([begsample endsample offset]); end end % end for end % end switch end % end for trl = eval(strcat('trl',num2str(cfg.cond))); % picking out the condition that was asked in cfg % (not so elegant; TODO: change so that not all arrays trl1 ... trl8 are build at each call of the function) trl = trl(2:end-1,:); % skip the first and last trial for potential boundary problems cfg.trl = trl; % needed for compatibility with some later functions ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From bps231 at NYU.EDU Wed May 21 02:58:14 2008 From: bps231 at NYU.EDU (Bernhard Staresina) Date: Wed, 21 May 2008 02:58:14 +0200 Subject: coherence stats Message-ID: Dear FieldTrip experts, I have a quick question about the statistical assessment of coherence. I first derive coherence values across two channels of interest for condition A and condition B by running (i) FREQ = freqanalysis [with cfg.output = 'powandcsd'] followed by (ii) COH = freqdescriptives(FREQ), separately for each condition. Now, how can I assess whether the coherence values differ significantly between condition A and condition B? First I thought the I can just plug in COH_condition_A and COH_condition_B into freqstatistics (using montecarlo randomizations). But given that COH doesn't contain trial-by-trial data any more, that doesn't seem to work. So, I assume that I should use FREQ_condition_A and FREQ_condition_B instead? But if so, how does the code know what data to choose for the stats (e.g., crsspctrm versus powspctrm)? Any guidance would be appreciated. Best, Bernhard ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Wed May 21 11:18:32 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 21 May 2008 11:18:32 +0200 Subject: coherence stats In-Reply-To: Message-ID: Dear Bernhard, Indeed, since coherence already is a kind of 'statistic', and computed across observations, you have to walk a different path. Personally I usually perform statistics on coherence between conditions on the group level, but from your question I understand that you want to compare within a subject. If you would want to go for the non-parametric option (which I would strongly encourage) you could have a look at Maris et al. J Neurosci Meth 2007. As such I think that the method is implemented in Fieldtrip. If you prefer to stick to a parametric approach you could for example have a look at Bokil et al J Neurosci Meth 2006, or Amjad J Neurosci Meth 1997. These methods are not readily available in Fieldtrip but Hemant Bokil's double jackknife approach should be present in the Chronux software package. Finally, you could try to compute a condition specific variance of coherence, and perform a simple T-test across the conditions. However, statistically this is not completely correct, because you are violating the t-test's assumption of gaussianity. Anyway, a variance estimate of coherence can be obtained by specifying cfg.jackknife = 'yes' in freqdescriptives after having run freqanalysis with cfg.keeptrials = 'yes'. However, I believe that any T-value computation has to be done outside fieldtrip. Since this is not the path you seem to want to go, I'd suggest that you call freqanalysis with cfg.output = 'fourier'. If you subsequently call freqstatistics with cfg.statistic = 'indepsamplesZcoh', and a further appropriate cfg, I think you are pretty much there. However, I believe statfun_indepsamplesZcoh computes coherence between all channel-combinations between the channels you provide it with, so you can run into memory problems if you have many channels. You could however create a loop in which you feed freqstatistics with a channel pair each time. I would then take care to initialize the random-number generator in the same way prior to every call of freqstatistics, so that the 'random' permutation is the same for all channel-pairs. Hope this helps, Jan-Mathijs On May 21, 2008, at 2:58 AM, Bernhard Staresina wrote: > Dear FieldTrip experts, > > I have a quick question about the statistical assessment of > coherence. I > first derive coherence values across two channels of interest for > condition > A and condition B by running (i) FREQ = freqanalysis [with > cfg.output = > 'powandcsd'] followed by (ii) COH = freqdescriptives(FREQ), > separately for > each condition. > Now, how can I assess whether the coherence values differ > significantly > between condition A and condition B? First I thought the I can just > plug in > COH_condition_A and COH_condition_B into freqstatistics (using > montecarlo > randomizations). But given that COH doesn't contain trial-by-trial > data any > more, that doesn't seem to work. So, I assume that I should use > FREQ_condition_A and FREQ_condition_B instead? But if so, how does > the code > know what data to choose for the stats (e.g., crsspctrm versus > powspctrm)? > > Any guidance would be appreciated. > > Best, > Bernhard > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From grion at SISSA.IT Thu May 22 15:45:29 2008 From: grion at SISSA.IT (Natalia Grion) Date: Thu, 22 May 2008 15:45:29 +0200 Subject: Permut-test- BetweenTrials Message-ID: Dear all, I having a bug when running freqstatistics (montecarlo, indepsamplesT), for difference in power between conditionA and B, (UO:trials). ??? Reference to non-existent field 'label'. Error in ==> statistics_wrapper at 325 stat.label = data.label; Error in ==> freqstatistics at 132 [stat] = statistics_wrapper(cfg, varargin{:}); 'label' refers to the channels from where pow was computed, this structure is in fact present in my data; I have 2 channels: 'H_LFP_1' 'B_LFP_3'. The point is that I cannot figure out which is the origin of the bug. Any help will be appreciated! Natalia PS: This is the code: cfg = []; cfg.channel = {'B_LFP_3'}; %cfg.channelcmb = []; cfg.latency = [-1.5 2]; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesT'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.neighbours = []; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg.numrandomization = 100; cfg.correctm = 'cluster'; design = zeros(1,size(freqoutNG6ITrigg.powspctrm,1)+size(freqoutNG6CTrigg.powspctrm,1)); design(1,1:size(freqoutNG6ITrigg.powspctrm,1)) = 1; design(1,(size(freqoutNG6ITrigg.powspctrm,1)+1):(size(freqoutNG6ITrigg.powspctrm,1)+... size(freqoutNG6CTrigg.powspctrm,1)))=2; cfg.design = design; cfg.ivar = 1; [stat] = freqstatistics(cfg, freqoutNG6ITrigg, freqoutNG6CTrigg); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From brian.roach at YALE.EDU Thu May 22 22:14:01 2008 From: brian.roach at YALE.EDU (Brian Roach) Date: Thu, 22 May 2008 13:14:01 -0700 Subject: [Fwd: freqanalysis_wltconvol.m wavelets] Message-ID: -------- Original Message -------- Subject: freqanalysis_wltconvol.m wavelets Date: Thu, 22 May 2008 12:47:11 -0700 From: Brian Roach To: FieldTrip discussion list Hi All, Attached is a plot with 6 iterations of freqanalysis_wltconvol.m run (40Hz wavelet plotted). From top to bottom, these plots show 1. cfg.width = 7, cfg.gwidth = 1 2. cfg.width = 7, cfg.gwidth = 2 3. cfg.width = 7, cfg.gwidth = 3 4. cfg.width = 14, cfg.gwidth = 4 5. cfg.width = 14, cfg.gwidth = 5 6. cfg.width = 14, cfg.gwidth = 6 My question is regarding the peaks of the windowed wavelets - why are they offset from one another? I would think that the peak latencies should not shift, only the number of cycles or the length of the gauss should change with the cfg manipulations above. In addition to that question, I have attached a screen shot from the matlab help on the topic of complex morlet wavelets. There, it looks like the real part should have its peak at the 0 point or middle of the gauss, which does not appear to be the case in any of my 6 examples. Is this peak at 0ms a necessary feature or a morlet wavelet, or is it always plotted this way as a convention, not as a rule? thank you, Brian ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: waveScreen_matlab.png Type: image/png Size: 14881 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 40HzWavelets.png Type: image/png Size: 22188 bytes Desc: not available URL: From Ingmar.Schneider at BIO.UNI-GIESSEN.DE Mon May 26 20:12:07 2008 From: Ingmar.Schneider at BIO.UNI-GIESSEN.DE (Ingmar Schneider) Date: Mon, 26 May 2008 20:12:07 +0200 Subject: Messtermin Probemessung In-Reply-To: <667272528@web.de> Message-ID: Hi Michael, ich weiß nicht, ob du es vorhin noch mitbekommen hast. Für Mittwoch, den 28.05.2008 habe ich die Probemessung im Netz eingetragen. Tahmine hat sich bereit erklärt zwischen 14:00 Uhr und 18:00 Uhr das Versuchskaninchen zu spielen. Viele Grüße, Ingmar ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Ingmar.Schneider at BIO.UNI-GIESSEN.DE Mon May 26 20:16:51 2008 From: Ingmar.Schneider at BIO.UNI-GIESSEN.DE (Ingmar Schneider) Date: Mon, 26 May 2008 20:16:51 +0200 Subject: Wrong recipient! Message-ID: Dear Fieldtrippers, please just ignore the last mail I sent to the discussionlist. I picked the wrong recipient from my address book. Regards, Ingmar ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From soren.r.christensen at GSK.COM Mon May 26 21:08:25 2008 From: soren.r.christensen at GSK.COM (Soren Rahn Christensen) Date: Mon, 26 May 2008 20:08:25 +0100 Subject: Soren R Christensen is out of the office. Message-ID: I will be out of the office starting 24-May-2008 and will not return until 01-Jun-2008. I'll be back June 2nd. ----------------------------------------------------------- This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS. ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gregstuarthooper at GMAIL.COM Tue May 27 04:54:36 2008 From: gregstuarthooper at GMAIL.COM (Greg Hooper) Date: Tue, 27 May 2008 04:54:36 +0200 Subject: error Message-ID: Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core system. The header information reads fine, but I get the following error message in Matlab when trying to use read_data ??? Error using ==> fileio-20080526\private\read_24bit this function is implemented as mex file and is not available for this platform Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 buf = read_24bit(filename, offset, epochlength); Error in ==> read_data at 429 dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); I have compiled the read_24bit.c as a mex file but this has not been successful The code is [hdr] = read_header('HHH_123.BDF'); % loads the header successfully dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I read this as as loading 1000 data points from channel 12 - is this correct? thankyou for any help Greg ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Tue May 27 08:52:49 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Tue, 27 May 2008 07:52:49 +0100 Subject: error In-Reply-To: Message-ID: Did you move your compiled file one directory up (into \private) and replace the previous version of the file? Vladimir On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: > Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using > fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core > system. > > The header information reads fine, but > I get the following error message in Matlab when trying to use read_data > > ??? Error using ==> fileio-20080526\private\read_24bit > this function is implemented as mex file and is not available for this platform > > Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 > buf = read_24bit(filename, offset, epochlength); > > Error in ==> read_data at 429 > dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); > > > > I have compiled the read_24bit.c as a mex file but this has not been successful > > The code is > > [hdr] = read_header('HHH_123.BDF'); % loads the header successfully > dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I > read this as as loading 1000 data points from channel 12 - is this correct? > > thankyou for any help > > Greg > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From gregstuarthooper at GMAIL.COM Tue May 27 09:25:46 2008 From: gregstuarthooper at GMAIL.COM (Greg Hooper) Date: Tue, 27 May 2008 17:25:46 +1000 Subject: error In-Reply-To: Message-ID: Thanks for the response Vladimir. Unfortunately moving the file up does not help - once compiled it forms a dll rather than a mex file. Is that where the error lies? On Tue, May 27, 2008 at 4:52 PM, Vladimir Litvak wrote: > Did you move your compiled file one directory up (into \private) and > replace the previous version of the file? > > Vladimir > > On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: >> Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using >> fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core >> system. >> >> The header information reads fine, but >> I get the following error message in Matlab when trying to use read_data >> >> ??? Error using ==> fileio-20080526\private\read_24bit >> this function is implemented as mex file and is not available for this platform >> >> Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 >> buf = read_24bit(filename, offset, epochlength); >> >> Error in ==> read_data at 429 >> dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); >> >> >> >> I have compiled the read_24bit.c as a mex file but this has not been successful >> >> The code is >> >> [hdr] = read_header('HHH_123.BDF'); % loads the header successfully >> dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I >> read this as as loading 1000 data points from channel 12 - is this correct? >> >> thankyou for any help >> >> Greg >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Tue May 27 09:55:17 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Tue, 27 May 2008 08:55:17 +0100 Subject: error In-Reply-To: Message-ID: I think it depends on your Matlab version. I've had this problem many times and recompiling with just 'mex read_24bit.c' in Matlab command line and moving the file up has always solved it for me. Maybe Robert will have some other ideas. Just to make sure - you really compiled it from Matlab command line, not with an external compiler? Best, Vladimir On Tue, May 27, 2008 at 8:25 AM, Greg Hooper wrote: > Thanks for the response Vladimir. Unfortunately moving the file up > does not help - once compiled it forms a dll rather than a mex file. > Is that where the error lies? > > On Tue, May 27, 2008 at 4:52 PM, Vladimir Litvak wrote: >> Did you move your compiled file one directory up (into \private) and >> replace the previous version of the file? >> >> Vladimir >> >> On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: >>> Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using >>> fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core >>> system. >>> >>> The header information reads fine, but >>> I get the following error message in Matlab when trying to use read_data >>> >>> ??? Error using ==> fileio-20080526\private\read_24bit >>> this function is implemented as mex file and is not available for this platform >>> >>> Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 >>> buf = read_24bit(filename, offset, epochlength); >>> >>> Error in ==> read_data at 429 >>> dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); >>> >>> >>> >>> I have compiled the read_24bit.c as a mex file but this has not been successful >>> >>> The code is >>> >>> [hdr] = read_header('HHH_123.BDF'); % loads the header successfully >>> dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I >>> read this as as loading 1000 data points from channel 12 - is this correct? >>> >>> thankyou for any help >>> >>> Greg >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >>> >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From gregstuarthooper at GMAIL.COM Tue May 27 10:18:20 2008 From: gregstuarthooper at GMAIL.COM (Greg Hooper) Date: Tue, 27 May 2008 18:18:20 +1000 Subject: error In-Reply-To: Message-ID: thanks again - yes that is the command i used - i have matlab 7.0.4 Greg On Tue, May 27, 2008 at 5:55 PM, Vladimir Litvak wrote: > I think it depends on your Matlab version. I've had this problem many > times and recompiling with just 'mex read_24bit.c' in Matlab command > line and moving the file up has always solved it for me. Maybe Robert > will have some other ideas. Just to make sure - you really compiled it > from Matlab command line, not with an external compiler? > > Best, > > Vladimir > > On Tue, May 27, 2008 at 8:25 AM, Greg Hooper wrote: >> Thanks for the response Vladimir. Unfortunately moving the file up >> does not help - once compiled it forms a dll rather than a mex file. >> Is that where the error lies? >> >> On Tue, May 27, 2008 at 4:52 PM, Vladimir Litvak wrote: >>> Did you move your compiled file one directory up (into \private) and >>> replace the previous version of the file? >>> >>> Vladimir >>> >>> On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: >>>> Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using >>>> fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core >>>> system. >>>> >>>> The header information reads fine, but >>>> I get the following error message in Matlab when trying to use read_data >>>> >>>> ??? Error using ==> fileio-20080526\private\read_24bit >>>> this function is implemented as mex file and is not available for this platform >>>> >>>> Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 >>>> buf = read_24bit(filename, offset, epochlength); >>>> >>>> Error in ==> read_data at 429 >>>> dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); >>>> >>>> >>>> >>>> I have compiled the read_24bit.c as a mex file but this has not been successful >>>> >>>> The code is >>>> >>>> [hdr] = read_header('HHH_123.BDF'); % loads the header successfully >>>> dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I >>>> read this as as loading 1000 data points from channel 12 - is this correct? >>>> >>>> thankyou for any help >>>> >>>> Greg >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >>>> >>>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From florisdelange at GMAIL.COM Tue May 27 16:27:41 2008 From: florisdelange at GMAIL.COM (Floris de Lange) Date: Tue, 27 May 2008 16:27:41 +0200 Subject: ICA and artifact rejection Message-ID: Dear Fieldtrippers, I've started to play with using ICA to remove artifacts from the MEG signal. Now, there's a couple of questions that came to my mind. I hope anyone of you can help me with them. 1) ICA can be pretty slow, and it has been suggested in the Fieldtrip mailing list to use PCA and estimate only the 50 components that explain most variance. However, when I do this to e.g. identify ECG-related artifacts, I run into trouble when trying to decompose the ECG-locked data into the components, using the previously estimated 50 components (in order to calculate the coherence between the components and the ECG signal). The ECG-locked data is 275 channels X number of time points, so it cannot be simply decomposed into 50 components. Does anyone know how to go about this? 2) For EOG I suppose I could do like for ECG, and calculate the coherence with VEOG in order to select components that are artifacts. But this is not so easy for head muscle-related artifacts (jaw and neck movements, etc.), since we typically don't measure neck and jaw muscle EMG. Apart from looking at spatial topography, is there a robust criterion that one could use for detection of EMG artifact components? Or would it be better to use 'classical' artifact rejection routines for these kinds of artifacts? And would ICA also be suitable to remove things like jumps and head movements in the MEG, or is it better/safer to just throw away those kind of data segments? Thanks for your help, Best wishes, Floris ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nicolas.robitaille at UMONTREAL.CA Tue May 27 17:48:32 2008 From: nicolas.robitaille at UMONTREAL.CA (Nicolas Robitaille) Date: Tue, 27 May 2008 15:48:32 +0000 Subject: ICA and artifact rejection In-Reply-To: <483C1A5D.3000408@gmail.com> Message-ID: Dear Floris I used ICA to remove noise from MEG signal. I can share my experience. If calculation time is an issue, I suggest to use FastICA instead of infomaxICA, which is the default. You need to download the toolbox yourself (http://www.cis.hut.fi/projects/ica/fastica/), but Fieldtrip take charge of it afterward, it's a new option in componentanalysis. For both infomaxICA and FastICA you can specify to the routine a specific numbers of components (like 100 instead of 275) to output, which should also reduce computing time. You can also select a subset of your data that contains all the artefacts you are interested to remove, run ICA on that, and apply the signal reconstruction without the artefactual-component to the entire dataset. For artefactual-component identifications, I suggest to look simultaneously at the topography and the time-course of the components. My position is that we do not absolutely need robust objective criteria for artefactual-component identification, unless we want a fully automatize process (that I would not trust for now). Furthermore, it's always a good idea to look at the raw data you have, prior to any signal processing. The EOG and ECG components are obvious, you will pick them easily. Just find a time-window of raw data that shows these artefacts, and look at the time-course of the components. I suppose this would be the same for muscle-related artefact. Others artefacts are more complex for ICA. I would remove segments with jumps and head movements. Breathing artefacts tended, in my MEG data, to spread across severals components, so it was tedious to identify them. You may also consider if the time requiered to spare a noizy subject is worth, comparing to the time (and cost) to test another one. Hope this help, Nicolas ---------------------------------------- > Date: Tue, 27 May 2008 16:27:41 +0200 > From: florisdelange at GMAIL.COM > Subject: [FIELDTRIP] ICA and artifact rejection > To: FIELDTRIP at NIC.SURFNET.NL > > Dear Fieldtrippers, > > I've started to play with using ICA to remove artifacts from the MEG > signal. Now, there's a couple of questions that came to my mind. I hope > anyone of you can help me with them. > > 1) ICA can be pretty slow, and it has been suggested in the Fieldtrip > mailing list to use PCA and estimate only the 50 components that explain > most variance. However, when I do this to e.g. identify ECG-related > artifacts, I run into trouble when trying to decompose the ECG-locked > data into the components, using the previously estimated 50 components > (in order to calculate the coherence between the components and the ECG > signal). The ECG-locked data is 275 channels X number of time points, so > it cannot be simply decomposed into 50 components. Does anyone know how > to go about this? > 2) For EOG I suppose I could do like for ECG, and calculate the > coherence with VEOG in order to select components that are artifacts. > But this is not so easy for head muscle-related artifacts (jaw and neck > movements, etc.), since we typically don't measure neck and jaw muscle > EMG. Apart from looking at spatial topography, is there a robust > criterion that one could use for detection of EMG artifact components? > Or would it be better to use 'classical' artifact rejection routines for > these kinds of artifacts? And would ICA also be suitable to remove > things like jumps and head movements in the MEG, or is it better/safer > to just throw away those kind of data segments? > > Thanks for your help, > Best wishes, > Floris > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 14:57:48 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 13:57:48 +0100 Subject: ICA and artifact rejection In-Reply-To: <483C1A5D.3000408@gmail.com> Message-ID: Hi Floris > 1) ICA can be pretty slow, and it has been suggested in the Fieldtrip > mailing list to use PCA and estimate only the 50 components that > explain most variance. However, when I do this to e.g. identify > ECG-related artifacts, I run into trouble when trying to decompose the > ECG-locked data into the components, using the previously estimated 50 > components (in order to calculate the coherence between the components > and the ECG signal). The ECG-locked data is 275 channels X number of > time points, so it cannot be simply decomposed into 50 components. > Does anyone know how to go about this? I'm not quite sure whether I understand the problem correctly. But obviously, if you have done a PCA first on the data, and do an ICA those principal components, in order to get back to the original data you have to multiply the unmixing matrix obtained from the ICA with that of the PCA. So if you only kept 50 principal components and pruned the others, your PC unmixing matrix will have 275 rows and 50 columns (ICA usually then 50 columns and rows) and in order to get back to your raw data you have to multiply the mixing matrices (i.e. pseudoinverse of the mixing matrix) of ICA and PCA in the correct order. I can provide you some code snippet if that is indeed the problem... > 2) For EOG I suppose I could do like for ECG, and calculate the > coherence with VEOG in order to select components that are artifacts. > But this is not so easy for head muscle-related artifacts (jaw and > neck movements, etc.), since we typically don't measure neck and jaw > muscle EMG. Apart from looking at spatial topography, is there a > robust criterion that one could use for detection of EMG artifact > components? Or would it be better to use 'classical' artifact > rejection routines for these kinds of artifacts? And would ICA also be > suitable to remove things like jumps and head movements in the MEG, or > is it better/safer to just throw away those kind of data segments? I would take out any short-lived non stationary (or non-frequently occuring) phenomena such as short muscle twitches and jumps in any case. For the more tonic muscle phenomena (like the neck and jaw muscles) ICA can do a decent job, but if subjects make movements the topography can each time be quite different - if a subject makes too many movements the whole idea of ICA as spatial filters is pointless cause the MEG sensor array won't follow the movement One problem with muscle artefacts is that there can be these huge variations in high-frequency power (muscle tonus primarily in neck and jaw muscle) over several blocks of trials. These can be detrimental for identifying gamma-oscillations and also for finding a decent rejection criteria for short-muscle artefacts (movements etc). In order to compensate for that we've written in Berlin some own muscle artefact routines that basically apply kind of a low-pass filter on the amplitude envelope of the high-frequency signal (that you use to separate short lived muscle artefacts from the ones with longer time course). You can use that to throw away the movements and leave the more tonic effects in (which may be in half of your trials or so) - to either take care of them by individual trial baseline correction or removing them by ICA. I can give you the scripts - but they use a radically different reading routine. I will also hand them over to Robert, they are written a bit differently than the usual fieldtrip stuff, but maybe he'll like them anyway best Markus PS: Personally, I became sceptical about ICA, cause it's so subjhecttive whether a compoentn is now an artefact component or not, whether to take it out or not. Also, often one and the "same" phenomenon are distributed acroiss components others you would expect to find you don't find. I didn't like that much what I saw ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 16:00:54 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 15:00:54 +0100 Subject: use of dipoles as spatial filters (for SEP) Message-ID: An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Wed May 28 16:15:54 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 28 May 2008 16:15:54 +0200 Subject: use of dipoles as spatial filters (for SEP) In-Reply-To: <483D6596.7040601@fil.ion.ucl.ac.uk> Message-ID: Hi Markus, Did you consider trying out the beamforming algorithm with multiple dipoles as a source model? As opposed to the dipole-fitting (which pinv'es the concatenated leadfields), the beamformer actually tries to suppress contributions of the other guys (provided they are not too much correlated in time). Obviously, the suppression will be more robust against violations of the temporal uncorrelation-assumption, when the leadfield-columns are less correlated. However, I would guess it's worth a try, and it's exactly what you try to achieve: to avoid mixing up correlated leadfield components. But perhaps I did not grasp the problem completely... ;o) Yours, JM On May 28, 2008, at 4:00 PM, Markus Bauer wrote: > > Hi fieldtrippers (in particular probably Robert) > > I have a few slightly more advanced questions regarding the use of > dipoles as spatial filters and the creation of multi-dipole models > with fieldtrip (questions in bold) > I know that the functionality of fieldtrip is not designed for > multi-dipole models, but neither Beamformer nor MNE worked somewhat > reliably (only worked in rather few subjects and then was usually > pretty smeared still), as often is the case...(for evoked fields in > this case). So I finally decided to once go back to the "gold > standard" of somatosensory EEG/MEG research > > I have used a serial fit-procedure to fit components of the SEP to > EEG data. The early components (50 and 80 ms post response) are > largely determined by two single dipoles, plus a symmetric dipole > later for bilateral S2. So it is kind of ok to fit simple dipoles > to those (though clearly not ideal) > > My first question: > Are there plans to extend the functionality of dipolefitting to > allow for proper serial fit (i.e. adding to be fitted dipoles to > existing ones) ? I guess it would not be that much rewriting to > include a fixed dipole and only fit the parameters of the other? > > Anyway, in order to create spatial filters I have then fitted the > orientation of each dipole (estimated from the moments) and thereby > reduced the leadfield to a onedimensional one. > In order to get to the sourcewaveforms, I have concatenated the > (one dimensional) leadfields associated with each source into a > common leadfield matrix (4 sources corresponding to 4 rows and 124 > columns for each channel) and then took the pseudoinverse of this > combined leadfield matrix - for use as spatial filters to obtain > sourcewaveforms - for the "complete solution". > > When I looked at those filters obtained, however, I realized that > it did not work that nicely, since the filters looked for at least > two components very similar - more similar than the respective > leadfields!! (which is contra-intuitive) > The topographies of the peaks where I fitted dipoles to are > beautiful single dipolar topographies and so are the single > leadfield matrices, but the filters are anything else than clean. > It is clear that they will represent a mixture between the sources > - mutually "supressing" each other. But at least for two of them > (the early sources for 50 and 80 ms with clearly distinct topos, > presumably area3b and area1) they pretty much mixed up. I was > surprised about this cause the topoghraphies look so distinct and I > would have assumed this should come out nicely (also considering > all the Hari-studies) > > Anyway, a look at the correlation matrix of the leadfields showed > that despite the topographies of those dipoles had quite a > different orientation they were correlated at 0.77 (weights over > channels). So I guess what happens is identical to a suppressor > effect in multiple regresion - when the predictors are too > correlated their weights get mixed up.... > > I tend to use the individual spatial filters now - not the > pseudoinverse of the combined source model (consisting of only > four, well identifiable sources). > My question: > > Is this justified - to take individual filters when having a multi- > dipole model ? > > I also realized that when I only included the first two sources > (the ones described above), and take the pseudoinverse the > separation succeeds much better. > > - Might prior regularization of the leadfield help ? > - Are there any standards about this - when to still use a combined > leadfield model ? I guess should be the same as in multiple > regression cause formulas more or less identical...? But I guess > nobody publishing sourcewaveforms from multidipole model cares > about it... > > I was a bit "shocked" to see how much this can falsify the results > (the waveforms), I also wouldn't have expected the leadfields (and > filters...) of such rather different sources to be that strongly > correlated. I assume it will be not much different in MEG, cause > they were both tangential dipoles, looking almost identical as in > MEG (apart from 90deg rotation due to field geometry). > My strategy is therefore to either use individual filters of single > dipoles or reduce the dipolar model...any other suggestions ?? > It seems it is really a very ill-posed problem that we're spending > our time with.... > > > thanks and best wishes > Markus > ---------------------------------- > > The aim of this list 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/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 16:41:31 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 15:41:31 +0100 Subject: use of dipoles as spatial filters (for SEP) In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 16:45:16 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 15:45:16 +0100 Subject: even one more dipole question...symmetry constraint... Message-ID: ....what precisely is the consequence of the symmetry constraint on the calculated leadfields for symmetrical sources ? I used the symmetry constraint for fitting two dipoles (for bilat. S2) and looked at the respective leadfields of the corresponding "individual" dipoles - to find out that they rather look not so individual at all... the coefficients of both had bilateral maxima, as the leadfields being a mixture of the two individual dipoles, being symmetric along some axes (y and z ?) and antisymmetric along the others (x?) I do not quite understand this, cause I assumed the symmetry constraint was only used to find the location parameter but the leadfields would then be calculated for each position independently.... but this does not seem to be the case. are there any assumptions about correlations of symmetric sources (dipoles) going in here to suppress the respective other source ? is there a reference to that ? thanks Markus ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 17:07:12 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 16:07:12 +0100 Subject: use of dipoles as spatial filters (for SEP) In-Reply-To: Message-ID: > > Did you consider trying out the beamforming algorithm with multiple > dipoles as a source model? > As opposed to the dipole-fitting (which pinv'es the concatenated > leadfields), the beamformer actually tries to suppress contributions > of the other guys (provided they are not too much correlated in time). > Obviously, the suppression will be more robust against violations of > the temporal uncorrelation-assumption, when the leadfield-columns are > less correlated. another reason why I didn't want to put the beamformer just into a location to estimate the timecourse of the evoked field is that you would have to calculate the covariance matrix-stepwise for each time point (or at least over timeintervals, in a sliding fashion) - otherwise the method is not legitimate - and I assume it will indeed substantially distort the results if one just calculates one covariance matrix over the whole (severely nonstationary) timeperiod where one wants to look at the source-waveform. this problem is more severe for evoked fields than in the frequency doman cause of greater transients, not separated by frequency.... has anyone got more experience with this / investigated more in depth ? my previous experience on this (with ordinary beamformers) wasn't that great m ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From fredericroux at HOTMAIL.DE Fri May 30 16:00:43 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Fri, 30 May 2008 16:00:43 +0200 Subject: strange baseline artefacts Message-ID: Dear Fieldtrippers, I have a very strange activity pattern in my baseline. This artefact only appears in 2 of 3 experimental conditions. Does anyone have an idea were this could come from? Regards, Frederic Dipl. Psych. Frederic Roux Max Planck Institut für Hirnforschung Abteilung Neurophysiologie Deutschordenstr. 46 60528 Frankfurt am Main Tel.: 069 / 6301 83225 Mail: fredericroux at hotmail.de froux at mpih-frankfurt.mpg.de _________________________________________________________________ Die aktuelle Frühjahrsmode - Preise vergleichen bei MSN Shopping http://shopping.msn.de/category/damenbekleidung/bcatid66/forsale?text=category:damenbekleidung&edt=1&ptnrid=230 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: sensorAvg_dB.jpg Type: image/jpeg Size: 105609 bytes Desc: not available URL: From nathanweisz at MAC.COM Fri May 30 22:39:38 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Fri, 30 May 2008 22:39:38 +0200 Subject: job vacancies in konstanz (germany) Message-ID: dear colleagues, 3 positions (1 postdoc, 2 phd) will be available in a newly founded research group (MEG / EEG / TMS) at the university of konstanz, starting earliest august 2008. see attached pdf for details. please pass this on to anyone who may be interested. cheers, nathan -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Emmy_KN08_positions.pdf Type: application/pdf Size: 30237 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue May 6 14:48:00 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 May 2008 14:48:00 +0200 Subject: Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** In-Reply-To: Message-ID: It might be related to the use of a mex file when reading in your data. The mex file then seems to deallocate a piece of memory that is not in use any more, see http://en.wikipedia.org/wiki/Malloc. It does not seem a serious problem, but perhaps you could give more information about your OS, matlab version and fileformat that you are working with, so that potential other problems related to this warning can be investigated. best regards, Robert On 30 Apr 2008, at 13:50, Frederic Roux wrote: > I get this error message every time I try to preprocess my data: > > > *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** > > Does anyone have a clue what this could mean? ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue May 6 14:53:59 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 May 2008 14:53:59 +0200 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Susana, Your problem might well be to the file being exported in a non- standard brainvision format. On 27 Apr 2008, at 0:01, Susana Silva wrote: > My questions are: > - In my position – someone who has eep files and brainvision files, > what is the most simple option: try to use eep or brainvision (at the > moment, I can use neither!) Reading the eep files requires mex files, and that requires additional software from ANT (a librarry with the low0-level routines). Since that software is not open source, it is not possible to recompile the MEX file on your platform. You could complain about the file format with ANT and/or get another Matlab version (an old matlab on windows should work). As such, the brainvision format seems the most pragmatic solution to me. > - Can you give me an example of a trial definition based upon a > brainvision file, let us say s1.eeg (data), s1.vhdr , s1.vmrk, > where ‘s33’ > (eventvalue) is the ‘Stimulus’ (eventtype)? Example trial definitions are given in the documentation on the fieldtrip website. > - In case I can not do the trial definition, how exactly should I > arrange my data so that they are equivalent to the output of > “definetrial”? You should specify a trl matrix as cfg.trl to the preprocessing function, that matrrix is explained in the documentation on the website and in the definetrial function help. 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/fcdonders/fieldtrip. From fredericroux at HOTMAIL.DE Tue May 6 15:07:08 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Tue, 6 May 2008 15:07:08 +0200 Subject: Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 ** In-Reply-To: <2F72F811-B941-4DE1-BECA-37DF9B3FB4D3@fcdonders.ru.nl> Message-ID: Hi Robert, thank you for answering. I found out what the error was related to. It's related to the 'feature accel off' option. When I launch my analysis with that option the bug does not appear. Can you tell me why that is so? I have 2 more questions: 1. Can I contribute to Fieldtrip with my functions? I've written a baseline Correction function that computes Decibeland Z-scores. I've also got other functions that could be useful to other users. 2. When I compute a Wavelet transformation of my MEG signals I get an aquward looking power spectrum that looks like the signal is full of epileptic spikes. It kinda looks like a 'flame pattern'. I remember that you mentioned it during the Fieldtrip toolkit but I can't remember what it was related to. Can you tell me what this means? The funny thing is that this does not happen when I do a multitaper analysis of the same signal. The parameters I used for the wavelet transform are the following: width = 4 and gwidth = 3. Best regards, Frederic Dipl. Psych. Frederic Roux Max Planck Institut für HirnforschungAbteilung NeurophysiologieDeutschordenstr. 4660528 Frankfurt am MainTel.: 069 / 6301 83225Mail: fredericroux at hotmail.de froux at mpih-frankfurt.mpg.de ---------------------------------------- > Date: Tue, 6 May 2008 14:48:00 +0200 > From: r.oostenveld at FCDONDERS.RU.NL > Subject: Re: [FIELDTRIP] Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** > To: FIELDTRIP at NIC.SURFNET.NL > > It might be related to the use of a mex file when reading in your > data. The mex file then seems to deallocate a piece of memory that is > not in use any more, see http://en.wikipedia.org/wiki/Malloc. It does > not seem a serious problem, but perhaps you could give more > information about your OS, matlab version and fileformat that you are > working with, so that potential other problems related to this > warning can be investigated. > > best regards, > Robert > > > On 30 Apr 2008, at 13:50, Frederic Roux wrote: > >> I get this error message every time I try to preprocess my data: >> >> >> *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 *** >> >> Does anyone have a clue what this could mean? > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ Lustige Emoticons für Ihren Messenger! Hier kostenlos downloaden! http://messenger.live.de/mein/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From zanasilva at GMAIL.COM Tue May 6 19:33:57 2008 From: zanasilva at GMAIL.COM (Susana Silva) Date: Tue, 6 May 2008 18:33:57 +0100 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Robert, Thank you very much for the information. In the mean time, I finally succeed in reading all brainvision files (yes, there should have been a problem with bv format, because I had to change the name of a field - to nChans- in the m file). However, after rereading the documentation, I still have a local (and very basic) question on the cfg for definetrial: what is a "dataset" when we are using brainvision files? Can it be replaced by the header file, the data file and the event/marker file? If so, what should bi included in the cfg (cfg.datafile, cfg.headerfile, cfg.event?) I tried that but it did not work out. Concerning the arrangement of data so as to match definetrial output, I also did this, based upon the documentation. However, this solution does not give a prestimulus time, to be seen in each trial as referenced to a negative time (eg: time -0.2 up to time 0) . I believe this is necessary to view the baseline later. Thank you again. Best regards, Susana Silva On 5/6/08, Robert Oostenveld wrote: > > Hi Susana, > > Your problem might well be to the file being exported in a non-standard > brainvision format. > > > On 27 Apr 2008, at 0:01, Susana Silva wrote: > > > My questions are: > > - In my position – someone who has eep files and brainvision > > files, > > what is the most simple option: try to use eep or brainvision (at the > > moment, I can use neither!) > > > > Reading the eep files requires mex files, and that requires additional > software from ANT (a librarry with the low0-level routines). Since that > software is not open source, it is not possible to recompile the MEX file on > your platform. You could complain about the file format with ANT and/or get > another Matlab version (an old matlab on windows should work). As such, the > brainvision format seems the most pragmatic solution to me. > > - Can you give me an example of a trial definition based upon a > > brainvision file, let us say s1.eeg (data), s1.vhdr , s1.vmrk, where > > 's33' > > (eventvalue) is the 'Stimulus' (eventtype)? > > > > Example trial definitions are given in the documentation on the fieldtrip > website. > > - In case I can not do the trial definition, how exactly should I > > arrange my data so that they are equivalent to the output of > > "definetrial"? > > > > You should specify a trl matrix as cfg.trl to the preprocessing function, > that matrrix is explained in the documentation on the website and in the > definetrial function help. > > 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/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathan.dees at UMSL.EDU Wed May 7 00:54:05 2008 From: nathan.dees at UMSL.EDU (Nathan Dees) Date: Wed, 7 May 2008 00:54:05 +0200 Subject: CMCorig data, Coherence Tutorial Message-ID: How can one gain access to the dataset 'CMCorig' discussed in the tutorials, specifically the tutorial on Coherence? This file is not included in the SubjectCMC data posted on the tutorial data section of the website. Has anyone else had trouble running the Coherence tutorial from start to finish - I thought having access to this data might help me get through certain sections? Thank you ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Fri May 9 09:18:19 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 9 May 2008 09:18:19 +0200 Subject: Error message: *** glibc detected *** free(): invalid pointer: 0x00002aab002dadf0 ** In-Reply-To: Message-ID: Hi Frederic On 6 May 2008, at 15:07, Frederic Roux wrote: > I found out what the error was related to. It's related to the > 'feature accel off' option. > > When I launch my analysis with that option the bug does not appear. > Can you tell me why that is so? I don't know what the relatino between "feature accel off" and the emx file is, I have not heard about problems with that before. However, I know that in an older matlab versino (don't recall the exact version number) where that feature wa sintroduced, that there were problems with persistent variables (used underneath the cfg.feedback option in fieldtrip). To fix those matlab bugs, it was also needed to turn accel off. > I have 2 more questions: > > 1. Can I contribute to Fieldtrip with my functions? I've written a > baseline Correction function that computes Decibeland Z-scores. > I've also got other functions that could be useful to other users. The different baselineling options would be interesting to incorporate into the existing freqbaseline function. Would that be doable? If so, then they would automatically be available for plotting (cfg.baselinetype refers to freqbaseline). For the other functions: In the past other people within the Donders have contributed some miscellaneous functions as well. I have added them, but over the years (as they have not been maintained) the functions might have lost their usefullness. Those functions sofar also have not all been included in the external ftp release version of fieldtrip. However, I certainly would like to encourage people to contribute to fieldtrip. If the functions are sufficiently usefull and fieldtrip-like (regarding their interface and documentation) then I am also happy to add them to fieldtrip-main and play an active role in maintaining them. And for small-helper functions I could add a directory fieldtrip/contrib where those functions could go. An example functions that I think would be better of in fieldtrip/ contrib would be source2sparce.m (which is a helper function taht I made myself, but it is not very fieldtrip-like). > 2. When I compute a Wavelet transformation of my MEG signals I get > an aquward looking power spectrum that looks like the signal is > full of epileptic spikes. > It kinda looks like a 'flame pattern'. I remember that you > mentioned it during the Fieldtrip toolkit but I can't remember what > it was related to. Can you tell me what this means? There are probably short and sharp transients in your data (i.e. "blips"). The morlet wavelets for the higher frequencies get shorter and shorter, and increase the frequency bandwith at trhe same time. So a broad-looking blip at a low frequency becomes smaller at higher frequencies, hence the flame pattern. > The funny thing is that this does not happen when I do a multitaper > analysis of the same signal. With multitapers you probably use a longer t_ftimwin for the high frequencies (where the morlet wavelets are short, especially with your cfg.width=4). The increased timewindow together with the multiple tapers results in a more robust power estimate, which is less affected by noise (your blips). 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/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Fri May 9 09:19:34 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 9 May 2008 09:19:34 +0200 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Susana On 6 May 2008, at 19:33, Susana Silva wrote: > In the mean time, I finally succeed in reading all brainvision > files (yes, there should have been a problem with bv format, > because I had to change the name of a field - to nChans- in the m > file). Can you upload one of your problematic files to ftp.fcdonders.nl/pub/ incoming, or if it is less <1MB send it as email attachement to my personal email account? > However, after rereading the documentation, I still have a local > (and very basic) question on the cfg for definetrial: what is a > "dataset" when we are using brainvision files? Can it be replaced > by the header file, the data file and the event/marker file? If so, > what should bi included in the cfg (cfg.datafile, cfg.headerfile, > cfg.event?) I tried that but it did not work out. You can specify cfg.datafile and cfg.headerfile seperately, or in your case you can specify cfg.dataset=yourfile.vhdr. Also for the events (which are read using read_fcdc_event) you can specify the header file, because that file contains the name of the accompanying event file. > Concerning the arrangement of data so as to match definetrial > output, I also did this, based upon the documentation. However, > this solution does not give a prestimulus time, to be seen in each > trial as referenced to a negative time (eg: time -0.2 up to time > 0) . I believe this is necessary to view the baseline later. This is from the definetrial documentation % The trial definition "trl" is an Nx3 matrix, N is the number of trials. % The first column contains the sample-indices of the begin of each trial % relative to the begin of the raw data, the second column contains the % sample-indices of the end of each trial, and the third column contains % the offset of the trigger with respect to the trial. An offset of 0 % means that the first sample of the trial corresponds to the trigger. A % positive offset indicates that the first sample is later than the trigger, % a negative offset indicates that the trial begins before the trigger. The trl matrix is used to read in the interesting segments of the data with the preprocessing function (using the first and second column of trl) and to attach a timeaxis to each trial (using the third column). 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/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Fri May 9 10:39:16 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Fri, 9 May 2008 10:39:16 +0200 Subject: CMCorig data, Coherence Tutorial In-Reply-To: Message-ID: Dear Nathan, Indeed the CMCorig mat-file is missing from the ftp-server, but in principle it can be generated by executing the preceding steps in the tutorial. We will change the tutorial accordingly. Historically, the tutorials have been used at the FCDC toolkit-courses for data analysis, and students had the mat-file available to save some time. However, from your mail I conclude that you had some problems running the tutorial itself, probably unrelated to the (un)availability of the CMCorig file. If so, could you just retry running the tutorial and let us know whether and where specified problems arise? Thanks, Jan-Mathijs On May 7, 2008, at 12:54 AM, Nathan Dees wrote: > How can one gain access to the dataset 'CMCorig' discussed in the > tutorials, specifically the tutorial on Coherence? This file is not > included in the SubjectCMC data posted on the tutorial data section > of the > website. > > Has anyone else had trouble running the Coherence tutorial from > start to > finish - I thought having access to this data might help me get > through > certain sections? > > Thank you > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri May 9 16:55:11 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 9 May 2008 16:55:11 +0200 Subject: strange sensor signals in the baseline Message-ID: Dear Fieldtrippers, I have some data from a 275ch CTF system, that were (in each single subject) preprocessed in Fieldtrip with baseline correction and detrending. If I now look at the grandaverage ERP some sensors have a nonzero signal that is entirely on one side (either completely above or completely below) of the baseline, while most sensors oscillate around zero as I would expect. Is this an effect of detrending, i.e. is detrending performed AFTER baseline correction AND on the whole datapiece, instead of just the specified baseline interval? Any suggestions welcome. 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/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From zanasilva at GMAIL.COM Tue May 13 00:02:18 2008 From: zanasilva at GMAIL.COM (Susana Silva) Date: Mon, 12 May 2008 23:02:18 +0100 Subject: eep and brainvision definetrial In-Reply-To: Message-ID: Hi Robert, On 6 May 2008, at 19:33, Susana Silva wrote: > In the mean time, I finally succeed in reading all brainvision files (yes, > > there should have been a problem with bv format, because I had to change the > > name of a field - to nChans- in the m file). > > > > Can you upload one of your problematic files to ftp.fcdonders.nl/pub/incoming, > or if it is less <1MB send it as email attachement to my personal email > account? I send you a .vhdr file and a .vmrk file from a subject, both as I exported from ASA. The .eeg is too big. Maybe you can figure out quickly if the brainvision format is anyhow problematic for fieldtrip. I remind you that my problem, now, is to use the define trial function. Thank you very much susana ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Tue May 13 09:26:35 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 May 2008 09:26:35 +0200 Subject: 2 Post-doctoral positions at the University of Chieti - MEGMRI Message-ID: 2 Post-doctoral positions at the University of Chieti - Institute of Advanced Biomedical Technologies (ITAB) to work on MEGMRI, a FP7 sponsored project, starting immediately. MEGMRI goal is to produce and validate a hybrid instrument able to perform simultaneous MEG and MRI for obtaining undistorted structural brain images and time-resolved functional maps that are spatially precisely aligned with each other. The project has three main tasks: i) build optimized magnetic femtotesla sensors for MEG and MRI; ii) the production of an MEG-MRI hybrid prototype; iii) pre-clinical validation of MEG-MRI. MEGMRI is a multi-center project involving the following centers: Helsinki University of Technology (Finland, coordinator), Aivon Oy (Finland), CEDRAT (France), Chalmers Tekniska Hoegskola Aktiebolag (Sweden), University of Chieti (Italy), Commissariat à l’energie atomique (France), Elekta AB (Sweden), Associazione Fatebenefratelli per la Ricerca (Italy), Hospital District of Helsinki and Uusimaa (Finland), Imaging Technology Abruzzo (Italy), PTB (Germany), University of Parma (Italy), Valtion teknillinen tutkimuskeskus (Finland) The two positions are for: 1) One position for a post-doc working on MEGMRI instrumentation development. The post-doc is expected to work on a prototype using superconducting devices for the detection of the MEG and MRI signals. Candidates should have a PhD in Physics or Engineering. Candidates should be already familiar either with MEG or MRI hardware. Skills in signal processing as well as computer programming (C++, Matlab) is highly desirable. 2) One position for a post-doc working on MEGMRI software development. The post-doc is expected to work on software for MEG- MRI data integration to produce a toolbox to be included in an MEG analysis software. Candidates should have a PhD in Physics, Engineering, or Computer Science. Candidates should be already familiar either with MEG or MRI methods. Applications should include CV, a research statement, and 2 letters of recommendation. The positions will be assigned on a 2+2 years schedule. Chieti is a university town, located in central Italy, about 15 minutes from the Adriatic coast, 30 minutes from the Parco Nazionale degli Abruzzi, the largest natural reserve in Italy, great skying, hiking, and mountain or seaside activities, only 2 hours from Rome. Please forward the application materials to: Prof. Gian Luca Romani, glromani at itab.unich.it Institute of Advanced Biomedical Technologies University of Chieti 66013 Chieti, ITALY ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue May 13 12:30:41 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 May 2008 12:30:41 +0200 Subject: strange sensor signals in the baseline In-Reply-To: <667272528@web.de> Message-ID: On 9 May 2008, at 16:55, Michael Wibral wrote: > Dear Fieldtrippers, > > I have some data from a 275ch CTF system, that were (in each single > subject) preprocessed in Fieldtrip with baseline correction and > detrending. If I now look at the grandaverage ERP some sensors have > a nonzero signal that is entirely on one side (either completely > above or completely below) of the baseline, while most sensors > oscillate around zero as I would expect. Is this an effect of > detrending, i.e. is detrending performed AFTER baseline correction > AND on the whole datapiece, instead of just the specified baseline > interval? Hi Michael, detrending is done prior to baselinecorrection. See fieldtrip/private/ preproc.m around line 346. Note that for detrending always the whole segment is used (minus the optional filterpadding), whereas for baseline correction you can specify the baseline window. The default for baseline correction is to use the whole segment (also minus the filter padding). If you use filter padding, then it is technically possible to specify a baseline window that extends into (or even is completely in) the padding. Did you use padding, and what did you specify as cfg.blcwindow? However, regardless of the order of detrending and baselinecorrection and assuming that you did not use filter padding, your ERFs should all have an average of zero over the time axis. An easy check is to compute baseline = mean(timelock.avg, 2); or baseline = mean(raw.trial{i}, 2); for each of your trials. This returns a nchansX1 vector that should be zero (or very close to zero) for each channel. 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/fcdonders/fieldtrip. From sdmuthu at CARDIFF.AC.UK Tue May 13 16:57:12 2008 From: sdmuthu at CARDIFF.AC.UK (Suresh Muthukumaraswamy) Date: Tue, 13 May 2008 16:57:12 +0200 Subject: Minimum norm estimates... Message-ID: Hi, I am trying to use sourceanalysis to create minimum norm estimates. The software runs fine but the resulting images I get back are completely dominated by the voxels at the edges of my grid near the sensors. So I am wondering If I have either made a mistake somewhere or if there are some parameters that can be tweaked to improve the reconstructions? My data is 275Ch CTF data and for the purposes of trying out fieldtrip's MNE I am just using a simple VEP dataset, with the headmodel created by localSpheres. There is a simple field pattern in the data which I was hoping to reconstruct. I have used the DICS (power) part of sourceanalysis before and get images that look pretty similar to SAM images made outside of fieldtrip, so I think my MRI/registration stuff in fieldtrip is ok. Thanks, Suresh Here is my code Dataset = '/gpfs/home/sapsm7/Bristol/Day/DC/DC_VSM-VEF_20080409_01.ds'; hdmFile = [Dataset '/default.hdm'] ;%assumes localSpheres has been run mrifile = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.mri'; shapefilename = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.shape'; OutImage = '/gpfs/home/sapsm7/Bristol/Day/DC/testminnorm'; cfg = []; cfg.trialdef.prestim = 2; %How much of the prestim to load in (s) cfg.trialdef.poststim = 2; cfg.trialdef.eventtype = 'High'; cfg.dataset = Dataset cfg.channel = {'MEG'}; %Right V5 and Left V5 sensitive cfg.bpfilter = [0.5 30]; cfg.lpfilter = 30 cfg.blc = 'yes'; cfg.blcwindow = [-0.2 0]; cfg = definetrial(cfg); Data = preprocessing(cfg); save DC_RawData load DC_RawData cfg = []; cfg.latency = [-0.2 1]; DCERF = timelockanalysis(cfg, Data); cfg = []; cfg.baseline = [-0.2 0]; DCERF = timelockbaseline(cfg, DCERF); %At this point the waveform plots and topos in fieldtrip look very nice [XMax, XMin, YMax, YMin, ZMax, ZMin] = shapefilemaxmin (shapefilename) ; %Extract the source reconstruction grid from the shapefile Resolution = 1; cfg = []; cfg.method = 'mne'; cfg.hdmfile = hdmFile; cfg.grid.xgrid = XMin : Resolution : XMax; cfg.grid.ygrid = YMin : Resolution : YMax; cfg.grid.zgrid = ZMin : Resolution : ZMax; [sourcePre] = sourceanalysis(cfg, DCERF); sourcePre.avg.coll = mean(sourcePre.avg.pow(:,169:183), 2); %Grab a time window and put into a variable for sourceint cfg = []; cfg.downsample = 2; sourceInt = sourceinterpolate(cfg, sourcePre, mrifile); sourceInt.avg.coll = sourceInt.avg.coll * 1e10 %upscale to make it easy to visualise in mri3dX %Write the analyse files out DeleteAnalyseFiles(OutImage); cfg = []; cfg.parameter = 'coll'; cfg.filename = OutImage; cfg.filetype = 'spm'; cfg.coordinates = []; cfg.datatype = 'float'; cfg.coordinates = 'ctf'; volumewrite(cfg, sourceInt); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Tue May 13 20:40:28 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 13 May 2008 20:40:28 +0200 Subject: Minimum norm estimates... In-Reply-To: Message-ID: Hi Suresh On 13 May 2008, at 16:57, Suresh Muthukumaraswamy wrote: > I am trying to use sourceanalysis to create minimum norm > estimates. The > software runs fine but the resulting images I get back are completely > dominated by the voxels at the edges of my grid near the sensors. > So I am > wondering If I have either made a mistake somewhere or if there are > some > parameters that can be tweaked to improve the reconstructions? The standard MNE is non-regularised. Since superficial dipoles result in a much stronger leadfield, the superficial sources are able to explain your data with much "smaller" norm, hence the minimum norm solution is very superficial. That is the depth bias inherent to MNE. The minimum norm estimate implementation has the following options % 'noisecov' = Nchan x Nchan matrix with noise covariance % 'sourcecov' = Nsource x Nsource matrix with source covariance (can be empty, the default will then be identity) % 'lambda' = scalar, regularisation parameter (can be empty, it will then be estimated from snr) % 'snr' = scalar, signal to noise ratio % 'reducerank' = reduce the leadfield rank, can be 'no' or a number (e.g. 2) % 'normalize' = normalize the leadfield % 'normalizeparam' = parameter for depth normalization (default = 0.5) These can be passed in sourceanalysis by specifying e.g. cfg.mne.normalize = 'yes'. See also the documentation included in the private functions minimumnormestimate and compute_leadfield. My first guess at the solution to your problem would be normalize and optionally the normalizeparam option. Depth regularization (or "depth weighing") is described in various papers and I recall that the normalizeparam comes from a paper by Wagner and/or Fuchs (Hamburg). I hope this suggestion gets you started. Since we have not used MNE ourselves sofar, I am curious to hear how it performs on your 275ch MEG data and which tweaks are most optimal. best regards, Robert > My data is 275Ch CTF data and for the purposes of trying out > fieldtrip's MNE > I am just using a simple VEP dataset, with the headmodel created by > localSpheres. There is a simple field pattern in the data which I > was hoping > to reconstruct. > I have used the DICS (power) part of sourceanalysis before and > get images > that look pretty similar to SAM images made outside of fieldtrip, > so I think > my MRI/registration stuff in fieldtrip is ok. > > Thanks, > Suresh > > Here is my code > > Dataset = '/gpfs/home/sapsm7/Bristol/Day/DC/DC_VSM- > VEF_20080409_01.ds'; > hdmFile = [Dataset '/default.hdm'] ;%assumes localSpheres has been run > mrifile = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.mri'; > shapefilename = '/gpfs/home/sapsm7/Bristol/Day/DC/DC080409.shape'; > OutImage = '/gpfs/home/sapsm7/Bristol/Day/DC/testminnorm'; > > > cfg = []; > cfg.trialdef.prestim = 2; %How much of the prestim to load in (s) > cfg.trialdef.poststim = 2; > cfg.trialdef.eventtype = 'High'; > cfg.dataset = Dataset > cfg.channel = {'MEG'}; %Right V5 and Left V5 sensitive > cfg.bpfilter = [0.5 30]; > cfg.lpfilter = 30 > cfg.blc = 'yes'; > cfg.blcwindow = [-0.2 0]; > cfg = definetrial(cfg); > Data = preprocessing(cfg); > > save DC_RawData > > load DC_RawData > > cfg = []; > cfg.latency = [-0.2 1]; > DCERF = timelockanalysis(cfg, Data); > > cfg = []; > cfg.baseline = [-0.2 0]; > DCERF = timelockbaseline(cfg, DCERF); > > %At this point the waveform plots and topos in fieldtrip look very > nice > > > [XMax, XMin, YMax, YMin, ZMax, ZMin] = shapefilemaxmin > (shapefilename) ; > %Extract the source reconstruction grid from the shapefile > Resolution = 1; > cfg = []; > cfg.method = 'mne'; > cfg.hdmfile = hdmFile; > cfg.grid.xgrid = XMin : Resolution : XMax; > cfg.grid.ygrid = YMin : Resolution : YMax; > cfg.grid.zgrid = ZMin : Resolution : ZMax; > [sourcePre] = sourceanalysis(cfg, DCERF); > > sourcePre.avg.coll = mean(sourcePre.avg.pow(:,169:183), 2); %Grab a > time > window and put into a variable for sourceint > > cfg = []; > cfg.downsample = 2; > sourceInt = sourceinterpolate(cfg, sourcePre, mrifile); > > > sourceInt.avg.coll = sourceInt.avg.coll * 1e10 %upscale to make it > easy to > visualise in mri3dX > > %Write the analyse files out > DeleteAnalyseFiles(OutImage); > cfg = []; > cfg.parameter = 'coll'; > cfg.filename = OutImage; > cfg.filetype = 'spm'; > cfg.coordinates = []; > cfg.datatype = 'float'; > cfg.coordinates = 'ctf'; > volumewrite(cfg, sourceInt); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From muthuraman10 at HOTMAIL.COM Thu May 15 19:22:30 2008 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Thu, 15 May 2008 17:22:30 +0000 Subject: cross-spectral density matrix is rank deficient! Message-ID: Hello Fieldtrippers, I get the warning "cross-spectral density matrix is rank deficient" when running the sourceanalysis_DICS on simulated data. Any hints due to which the warning comes will be very helpfull, because the channel combination was selected for ''all" in the frequency analysis. Thanking you With regards, M.Muthuraman. _________________________________________________________________ Catch the latest fashion shows, get beauty tips and learn more on fashion and lifestyle. http://video.msn.com/?mkt=en-in ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Thu May 15 20:47:52 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Thu, 15 May 2008 19:47:52 +0100 Subject: cross-spectral density matrix is rank deficient! In-Reply-To: Message-ID: Hi Muthuraman, You are warned for the rank-deficiency of the csd-matrix, because this could lead to numerical instabilities when inverting this matrix. However, since fieldtrip uses pinv instead of inv, this does not lead to crashing scripts. On the other hand, the message basically is the consequence of the fact that: -you used too few trials to simulate the csd (the total number of tapers applied should ideally be > the number of channels), -you did not add enough sensor noise to your simulation. because you typically want to simulate fewer sources than sensors (which by definition makes the true source csd-matrix rank deficient) you really have to add sensor noise, -or both. Good luck Jan-Mathijs Quoting Muthuraman Muthuraman : > > Hello Fieldtrippers, > > I get the warning "cross-spectral density matrix is rank deficient" > when running the sourceanalysis_DICS on simulated data. > Any hints due to which the warning comes will be very helpfull, > because the channel combination was selected for ''all" in the > frequency analysis. > > > Thanking you > > With regards, > M.Muthuraman. > > _________________________________________________________________ > Catch the latest fashion shows, get beauty tips and learn more on > fashion and lifestyle. > http://video.msn.com/?mkt=en-in > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > ------------------------------------------------------------------ The 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/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri May 16 10:35:02 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 16 May 2008 10:35:02 +0200 Subject: cross-spectral density matrix is rank deficient! Message-ID: Hi Muthuraman, could it be that you have removed some channels from your data and did not calculate a new headmodel/leadfield? As far as I remember this will cause a similar error message (although strictly speaking it shouldn't). Michael > -----Ursprüngliche Nachricht----- > Von: FieldTrip discussion list > Gesendet: 15.05.08 20:51:27 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] cross-spectral density matrix is rank deficient! > Hi Muthuraman, > > You are warned for the rank-deficiency of the csd-matrix, because this > could lead to numerical instabilities when inverting this matrix. > However, since fieldtrip uses pinv instead of inv, this does not lead > to crashing scripts. > On the other hand, the message basically is the consequence of the fact that: > > -you used too few trials to simulate the csd (the total number of > tapers applied should ideally be > the number of channels), > -you did not add enough sensor noise to your simulation. because you > typically want to simulate fewer sources than sensors (which by > definition makes the true source csd-matrix rank deficient) you really > have to add sensor noise, > -or both. > > Good luck > > Jan-Mathijs > > Quoting Muthuraman Muthuraman : > > > > > Hello Fieldtrippers, > > > > I get the warning "cross-spectral density matrix is rank deficient" > > when running the sourceanalysis_DICS on simulated data. > > Any hints due to which the warning comes will be very helpfull, > > because the channel combination was selected for ''all" in the > > frequency analysis. > > > > > > Thanking you > > > > With regards, > > M.Muthuraman. > > > > _________________________________________________________________ > > Catch the latest fashion shows, get beauty tips and learn more on > > fashion and lifestyle. > > http://video.msn.com/?mkt=en-in > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > > of the FieldTrip toolbox, to share experiences and to discuss new > > ideas for MEG and EEG analysis. See also > > http://listserv.surfnet.nl/archives/fieldtrip.html and > > http://www.ru.nl/fcdonders/fieldtrip. > > > > > > ------------------------------------------------------------------ > The 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/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From Kooijman at TIFN.NL Fri May 16 12:56:19 2008 From: Kooijman at TIFN.NL (Valesca Kooijman) Date: Fri, 16 May 2008 12:56:19 +0200 Subject: Valesca Kooijman is out of the office. Message-ID: I will be out of the office starting 16-05-2008 and will not return until 08-06-2008. I will respond to your message when I return. For urgent messages, please contact Corine Beemster (beemster at tifn.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/fcdonders/fieldtrip. From Kooijman at TIFN.NL Fri May 16 18:56:32 2008 From: Kooijman at TIFN.NL (Valesca Kooijman) Date: Fri, 16 May 2008 18:56:32 +0200 Subject: Valesca Kooijman is out of the office. Message-ID: I will be out of the office starting Fri 05/16/2008 and will not return until Sun 06/08/2008. I will respond to your message when I return. For urgent messages, please contact Corine Beemster (beemster at tifn.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/fcdonders/fieldtrip. From grion at SISSA.IT Tue May 20 10:47:24 2008 From: grion at SISSA.IT (Natalia Grion) Date: Tue, 20 May 2008 10:47:24 +0200 Subject: Phase- angle In-Reply-To: Message-ID: Dear fieldtrippers, one question about freqdescriptives: I'm computing the phase locking value (and its angle) of 2 electrodes. I want to keep the phase difference of trials (apart from the average; plv), there is no cfg.keeptrials option for freqdescriptives, did anybody implement it? Thanks! Natalia ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Tue May 20 11:20:17 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Tue, 20 May 2008 11:20:17 +0200 Subject: Phase- angle In-Reply-To: <4832901C.2030904@sissa.it> Message-ID: Dear Natalia, Basically, the information you want can already be extracted from the data. However, you do not have to call freqdescriptives in the first place. When you call freqanalysis with cfg.output = 'powandcsd' and cfg.keeptrials = 'yes' and cfg.channelcmb as a cell-array containing the sensor-combination you want to compute the phase-difference from you pretty much have it. The output to freqanalysis will then contain single trial, complex valued cross-spectral densities. The angle can be easily extracted. Hope this helps, Jan-Mathijs On May 20, 2008, at 10:47 AM, Natalia Grion wrote: > Dear fieldtrippers, > one question about freqdescriptives: > I'm computing the phase locking value (and its angle) of 2 > electrodes. I want to keep the phase difference of trials (apart > from the average; plv), there is no cfg.keeptrials option for > freqdescriptives, did anybody implement it? > Thanks! > Natalia > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From grion at SISSA.IT Tue May 20 12:02:10 2008 From: grion at SISSA.IT (Natalia Grion) Date: Tue, 20 May 2008 12:02:10 +0200 Subject: Phase- angle In-Reply-To: <7B4D152D-F472-45F3-A7DC-27994066803A@psy.gla.ac.uk> Message-ID: Thanks Jan-Mathijs! jan-mathijs schoffelen wrote: > Dear Natalia, > > Basically, the information you want can already be extracted from the > data. However, you do not have to call freqdescriptives in the first > place. > When you call freqanalysis with cfg.output = 'powandcsd' and > cfg.keeptrials = 'yes' and cfg.channelcmb as a cell-array containing > the sensor-combination you want to compute the phase-difference from > you pretty much have it. > The output to freqanalysis will then contain single trial, complex > valued cross-spectral densities. The angle can be easily extracted. > > Hope this helps, > > Jan-Mathijs > > On May 20, 2008, at 10:47 AM, Natalia Grion wrote: > >> Dear fieldtrippers, >> one question about freqdescriptives: >> I'm computing the phase locking value (and its angle) of 2 >> electrodes. I want to keep the phase difference of trials (apart >> from the average; plv), there is no cfg.keeptrials option for >> freqdescriptives, did anybody implement it? >> Thanks! >> Natalia >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ >> archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Tue May 20 15:22:55 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Tue, 20 May 2008 15:22:55 +0200 Subject: Baseline Problem Message-ID: Dear Robert, dear Fieldtrippers, I recently reported on some strange sensor signals that were complete on one side of the baseline. I have meanwhile run the checks Robert proposed to get the average fields throughout the baseline and I find values as high as 20fT, which I think is too much!? Maybe it's just something stupid in my code (attached below). Maybe it's related to the fact that we set the threshold for sensor jumps quite high (50)? We chose such a high value because the standard value would report sensor jumps in files where careful visual inspection didn' seem to find any... %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Preprocessing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % File selection pathname = '/data/MEGArchive/data/meg/CTF_Data/MooneyFacesMEEG.proc/DATASETS/'; outpath = '/net/M036-LFS1/srv/data1/home1/ctillman/data/MooneyMEEGFieldtripAnalysis/MEG_Preprocessing/controls_chanjump50/'; % "Design matrix % first Column: subject basefilename % second column: vector of valid run numbers % third column: name of trialfun for that particular subject % fourth column: trial types as defined in the trialfunction (!) % that should be analysed Design = { 'ABA04_MooneyFacesMEEG_20070625_0', [1 2 3 4 5 6], 'mytrialfun_MooneyMEEG_FaceRightButton',[1 4]; }; for subject = 1:size(Design,1) conditions = Design{subject,4}; % These are the correct trials for conditioncount = 1:length(conditions) DataOut = []; OutFileName = strcat(outpath, 'PreprocNew1secbase_',Design{subject,1},'_cond_',... num2str(Design{subject,4}(1,conditioncount)),... '.mat'); for run = 1:size(Design{subject,2},2) filename = strcat(Design{subject,1},num2str(Design{subject,2}(1,run)),'.ds'); fullname = strcat(pathname,filename); disp('working on: '); disp(filename); disp(strcat('# of run in Design is: ',num2str(Design{subject,2}(1,run)))); % Channel selection cfg = []; cfg.channel = {'MEG', '-MLP12', '-MRC14', '-MLT41', '-MRC25', '-MRP56', '-MRT21', '-MLO21', '-MRO44', '-MRT47'}; % added -MLO21 % for compatibility because it is bad in some subjects cfg.channelmeg = {'MEG' ... '-MLP12' '-MRC14' '-MLT41'... '-MRC25' '-MRP56' '-MRT21', '-MLO21','-MRO44','-MRT47'}; cfg.dataset = fullname; % Trial definition cfg.cond = conditions(conditioncount); % selection of one of the 4 possible conditions (see readme.txt) cfg.trialfun = Design{subject,3}; cfg = definetrial(cfg); % Artifact rejection cfg.artfctdef.feedback = 'no'; cfg.artfctdef.eog.sgn = 'MRT41'; % selection of channel MRT41 as the pseudo EOG channel cfg = artifact_eog(cfg); % automatic eye blinks rejection cfg.artfctdef.jump.sgn = cfg.channelmeg; % selection of valid channels cfg.artfctdef.jump.cutoff = 50; cfg = artifact_jump(cfg); % automatic sensor jump rejection cfg.artfctdef.muscle.cutoff = 6; % default = 4 cfg.artfctdef.muscle.sgn = cfg.channelmeg; % selection of valid channels cfg = artifact_muscle(cfg); % automatic muscle activity rejection cfg = rejectartifact(cfg); % Baseline correction cfg.blc = 'yes'; % baseline correction cfg.blcwindow = [-0.5 -0.1]; cfg.detrend = 'yes'; preproc = preprocessing(cfg); % preprocessing % Concatenate the data as necessary if run <=1 DataOut1 = preproc; % buffer DataOut for the first concatenation end if run == 2 cfg = []; DataOut = appenddata(cfg, DataOut1, preproc); end if run > 2 cfg = []; DataOut = appenddata(cfg, DataOut, preproc); end end % end of run-loop % write data for one subject and one condition to disk save(OutFileName, 'DataOut'); end % end of condition loop end % end of subject loop exit; %exit MATLAB to free licence %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % trialfunction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function trl = mytrialfun_MooneyMEEG_FaceRightButton(cfg); hdr = read_fcdc_header(cfg.dataset); event = read_fcdc_event(cfg.dataset); pre = 1; % pretrigger interval in seconds post = 1; % posttrigger interval in seconds off = pre; % trigger offset into datapiece trl1 = []; trl2 = []; trl3 = []; trl4 = []; trl5 = []; trl6 = []; trl7 = []; trl8 = []; for i = 1 : length(event)-2 switch event(i).type case {'Upright'} % it is a stimulus trigger, define a trial begsample = event(i).sample - pre*hdr.Fs; % 1 second prestimulus data endsample = event(i).sample + post*hdr.Fs - 1; % 1 second post stimulus data offset = - off*hdr.Fs; % Position where the trigger initially was found for j = 1 : 1 % change this number if intervening triggers are present k = j % added for faulty datasets from PEGE_... if (strcmp(event(i+k).type,'UPPT001') | strcmp(event(i+k).type,'frontpanel trigger') ) k = k+1 end if (strcmp(event(i+k).type,'frontpanel trigger') | strcmp(event(i+k).type,'UPPT001')) k = k+1 end % see to what condition it belongs by looking at the button press response if strcmp(event(i+k).type,'ButtonNoFace') trl1(end+1,:) = round([begsample endsample offset]); end end % end for case {'Inverted'} % it is a stimulus trigger, define a trial begsample = event(i).sample - pre*hdr.Fs; % 0.5 second prestimulus data endsample = event(i).sample + post*hdr.Fs - 1; % 1 second post stimulus data offset = - off*hdr.Fs; % Position where the trigger initially was found for j = 1 : 1 % change this number if intervening triggers are present k = j % added for faulty datasets from PEGE_... if (strcmp(event(i+k).type,'UPPT001') | strcmp(event(i+k).type,'frontpanel trigger')) k = k+1 end if (strcmp(event(i+k).type,'frontpanel trigger') | strcmp(event(i+k).type,'UPPT001')) k = k+1 end if strcmp(event(i+k).type,'ButtonFace') trl4(end+1,:) = round([begsample endsample offset]); end end % end for end % end switch end % end for trl = eval(strcat('trl',num2str(cfg.cond))); % picking out the condition that was asked in cfg % (not so elegant; TODO: change so that not all arrays trl1 ... trl8 are build at each call of the function) trl = trl(2:end-1,:); % skip the first and last trial for potential boundary problems cfg.trl = trl; % needed for compatibility with some later functions ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 443 bytes Desc: not available URL: From bps231 at NYU.EDU Wed May 21 02:58:14 2008 From: bps231 at NYU.EDU (Bernhard Staresina) Date: Wed, 21 May 2008 02:58:14 +0200 Subject: coherence stats Message-ID: Dear FieldTrip experts, I have a quick question about the statistical assessment of coherence. I first derive coherence values across two channels of interest for condition A and condition B by running (i) FREQ = freqanalysis [with cfg.output = 'powandcsd'] followed by (ii) COH = freqdescriptives(FREQ), separately for each condition. Now, how can I assess whether the coherence values differ significantly between condition A and condition B? First I thought the I can just plug in COH_condition_A and COH_condition_B into freqstatistics (using montecarlo randomizations). But given that COH doesn't contain trial-by-trial data any more, that doesn't seem to work. So, I assume that I should use FREQ_condition_A and FREQ_condition_B instead? But if so, how does the code know what data to choose for the stats (e.g., crsspctrm versus powspctrm)? Any guidance would be appreciated. Best, Bernhard ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From j.schoffelen at PSY.GLA.AC.UK Wed May 21 11:18:32 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 21 May 2008 11:18:32 +0200 Subject: coherence stats In-Reply-To: Message-ID: Dear Bernhard, Indeed, since coherence already is a kind of 'statistic', and computed across observations, you have to walk a different path. Personally I usually perform statistics on coherence between conditions on the group level, but from your question I understand that you want to compare within a subject. If you would want to go for the non-parametric option (which I would strongly encourage) you could have a look at Maris et al. J Neurosci Meth 2007. As such I think that the method is implemented in Fieldtrip. If you prefer to stick to a parametric approach you could for example have a look at Bokil et al J Neurosci Meth 2006, or Amjad J Neurosci Meth 1997. These methods are not readily available in Fieldtrip but Hemant Bokil's double jackknife approach should be present in the Chronux software package. Finally, you could try to compute a condition specific variance of coherence, and perform a simple T-test across the conditions. However, statistically this is not completely correct, because you are violating the t-test's assumption of gaussianity. Anyway, a variance estimate of coherence can be obtained by specifying cfg.jackknife = 'yes' in freqdescriptives after having run freqanalysis with cfg.keeptrials = 'yes'. However, I believe that any T-value computation has to be done outside fieldtrip. Since this is not the path you seem to want to go, I'd suggest that you call freqanalysis with cfg.output = 'fourier'. If you subsequently call freqstatistics with cfg.statistic = 'indepsamplesZcoh', and a further appropriate cfg, I think you are pretty much there. However, I believe statfun_indepsamplesZcoh computes coherence between all channel-combinations between the channels you provide it with, so you can run into memory problems if you have many channels. You could however create a loop in which you feed freqstatistics with a channel pair each time. I would then take care to initialize the random-number generator in the same way prior to every call of freqstatistics, so that the 'random' permutation is the same for all channel-pairs. Hope this helps, Jan-Mathijs On May 21, 2008, at 2:58 AM, Bernhard Staresina wrote: > Dear FieldTrip experts, > > I have a quick question about the statistical assessment of > coherence. I > first derive coherence values across two channels of interest for > condition > A and condition B by running (i) FREQ = freqanalysis [with > cfg.output = > 'powandcsd'] followed by (ii) COH = freqdescriptives(FREQ), > separately for > each condition. > Now, how can I assess whether the coherence values differ > significantly > between condition A and condition B? First I thought the I can just > plug in > COH_condition_A and COH_condition_B into freqstatistics (using > montecarlo > randomizations). But given that COH doesn't contain trial-by-trial > data any > more, that doesn't seem to work. So, I assume that I should use > FREQ_condition_A and FREQ_condition_B instead? But if so, how does > the code > know what data to choose for the stats (e.g., crsspctrm versus > powspctrm)? > > Any guidance would be appreciated. > > Best, > Bernhard > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From grion at SISSA.IT Thu May 22 15:45:29 2008 From: grion at SISSA.IT (Natalia Grion) Date: Thu, 22 May 2008 15:45:29 +0200 Subject: Permut-test- BetweenTrials Message-ID: Dear all, I having a bug when running freqstatistics (montecarlo, indepsamplesT), for difference in power between conditionA and B, (UO:trials). ??? Reference to non-existent field 'label'. Error in ==> statistics_wrapper at 325 stat.label = data.label; Error in ==> freqstatistics at 132 [stat] = statistics_wrapper(cfg, varargin{:}); 'label' refers to the channels from where pow was computed, this structure is in fact present in my data; I have 2 channels: 'H_LFP_1' 'B_LFP_3'. The point is that I cannot figure out which is the origin of the bug. Any help will be appreciated! Natalia PS: This is the code: cfg = []; cfg.channel = {'B_LFP_3'}; %cfg.channelcmb = []; cfg.latency = [-1.5 2]; cfg.method = 'montecarlo'; cfg.statistic = 'indepsamplesT'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.neighbours = []; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg.numrandomization = 100; cfg.correctm = 'cluster'; design = zeros(1,size(freqoutNG6ITrigg.powspctrm,1)+size(freqoutNG6CTrigg.powspctrm,1)); design(1,1:size(freqoutNG6ITrigg.powspctrm,1)) = 1; design(1,(size(freqoutNG6ITrigg.powspctrm,1)+1):(size(freqoutNG6ITrigg.powspctrm,1)+... size(freqoutNG6CTrigg.powspctrm,1)))=2; cfg.design = design; cfg.ivar = 1; [stat] = freqstatistics(cfg, freqoutNG6ITrigg, freqoutNG6CTrigg); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From brian.roach at YALE.EDU Thu May 22 22:14:01 2008 From: brian.roach at YALE.EDU (Brian Roach) Date: Thu, 22 May 2008 13:14:01 -0700 Subject: [Fwd: freqanalysis_wltconvol.m wavelets] Message-ID: -------- Original Message -------- Subject: freqanalysis_wltconvol.m wavelets Date: Thu, 22 May 2008 12:47:11 -0700 From: Brian Roach To: FieldTrip discussion list Hi All, Attached is a plot with 6 iterations of freqanalysis_wltconvol.m run (40Hz wavelet plotted). From top to bottom, these plots show 1. cfg.width = 7, cfg.gwidth = 1 2. cfg.width = 7, cfg.gwidth = 2 3. cfg.width = 7, cfg.gwidth = 3 4. cfg.width = 14, cfg.gwidth = 4 5. cfg.width = 14, cfg.gwidth = 5 6. cfg.width = 14, cfg.gwidth = 6 My question is regarding the peaks of the windowed wavelets - why are they offset from one another? I would think that the peak latencies should not shift, only the number of cycles or the length of the gauss should change with the cfg manipulations above. In addition to that question, I have attached a screen shot from the matlab help on the topic of complex morlet wavelets. There, it looks like the real part should have its peak at the 0 point or middle of the gauss, which does not appear to be the case in any of my 6 examples. Is this peak at 0ms a necessary feature or a morlet wavelet, or is it always plotted this way as a convention, not as a rule? thank you, Brian ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: waveScreen_matlab.png Type: image/png Size: 14881 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 40HzWavelets.png Type: image/png Size: 22188 bytes Desc: not available URL: From Ingmar.Schneider at BIO.UNI-GIESSEN.DE Mon May 26 20:12:07 2008 From: Ingmar.Schneider at BIO.UNI-GIESSEN.DE (Ingmar Schneider) Date: Mon, 26 May 2008 20:12:07 +0200 Subject: Messtermin Probemessung In-Reply-To: <667272528@web.de> Message-ID: Hi Michael, ich weiß nicht, ob du es vorhin noch mitbekommen hast. Für Mittwoch, den 28.05.2008 habe ich die Probemessung im Netz eingetragen. Tahmine hat sich bereit erklärt zwischen 14:00 Uhr und 18:00 Uhr das Versuchskaninchen zu spielen. Viele Grüße, Ingmar ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From Ingmar.Schneider at BIO.UNI-GIESSEN.DE Mon May 26 20:16:51 2008 From: Ingmar.Schneider at BIO.UNI-GIESSEN.DE (Ingmar Schneider) Date: Mon, 26 May 2008 20:16:51 +0200 Subject: Wrong recipient! Message-ID: Dear Fieldtrippers, please just ignore the last mail I sent to the discussionlist. I picked the wrong recipient from my address book. Regards, Ingmar ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From soren.r.christensen at GSK.COM Mon May 26 21:08:25 2008 From: soren.r.christensen at GSK.COM (Soren Rahn Christensen) Date: Mon, 26 May 2008 20:08:25 +0100 Subject: Soren R Christensen is out of the office. Message-ID: I will be out of the office starting 24-May-2008 and will not return until 01-Jun-2008. I'll be back June 2nd. ----------------------------------------------------------- This e-mail was sent by GlaxoSmithKline Services Unlimited (registered in England and Wales No. 1047315), which is a member of the GlaxoSmithKline group of companies. The registered address of GlaxoSmithKline Services Unlimited is 980 Great West Road, Brentford, Middlesex TW8 9GS. ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gregstuarthooper at GMAIL.COM Tue May 27 04:54:36 2008 From: gregstuarthooper at GMAIL.COM (Greg Hooper) Date: Tue, 27 May 2008 04:54:36 +0200 Subject: error Message-ID: Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core system. The header information reads fine, but I get the following error message in Matlab when trying to use read_data ??? Error using ==> fileio-20080526\private\read_24bit this function is implemented as mex file and is not available for this platform Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 buf = read_24bit(filename, offset, epochlength); Error in ==> read_data at 429 dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); I have compiled the read_24bit.c as a mex file but this has not been successful The code is [hdr] = read_header('HHH_123.BDF'); % loads the header successfully dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I read this as as loading 1000 data points from channel 12 - is this correct? thankyou for any help Greg ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Tue May 27 08:52:49 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Tue, 27 May 2008 07:52:49 +0100 Subject: error In-Reply-To: Message-ID: Did you move your compiled file one directory up (into \private) and replace the previous version of the file? Vladimir On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: > Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using > fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core > system. > > The header information reads fine, but > I get the following error message in Matlab when trying to use read_data > > ??? Error using ==> fileio-20080526\private\read_24bit > this function is implemented as mex file and is not available for this platform > > Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 > buf = read_24bit(filename, offset, epochlength); > > Error in ==> read_data at 429 > dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); > > > > I have compiled the read_24bit.c as a mex file but this has not been successful > > The code is > > [hdr] = read_header('HHH_123.BDF'); % loads the header successfully > dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I > read this as as loading 1000 data points from channel 12 - is this correct? > > thankyou for any help > > Greg > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From gregstuarthooper at GMAIL.COM Tue May 27 09:25:46 2008 From: gregstuarthooper at GMAIL.COM (Greg Hooper) Date: Tue, 27 May 2008 17:25:46 +1000 Subject: error In-Reply-To: Message-ID: Thanks for the response Vladimir. Unfortunately moving the file up does not help - once compiled it forms a dll rather than a mex file. Is that where the error lies? On Tue, May 27, 2008 at 4:52 PM, Vladimir Litvak wrote: > Did you move your compiled file one directory up (into \private) and > replace the previous version of the file? > > Vladimir > > On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: >> Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using >> fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core >> system. >> >> The header information reads fine, but >> I get the following error message in Matlab when trying to use read_data >> >> ??? Error using ==> fileio-20080526\private\read_24bit >> this function is implemented as mex file and is not available for this platform >> >> Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 >> buf = read_24bit(filename, offset, epochlength); >> >> Error in ==> read_data at 429 >> dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); >> >> >> >> I have compiled the read_24bit.c as a mex file but this has not been successful >> >> The code is >> >> [hdr] = read_header('HHH_123.BDF'); % loads the header successfully >> dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I >> read this as as loading 1000 data points from channel 12 - is this correct? >> >> thankyou for any help >> >> Greg >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Tue May 27 09:55:17 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Tue, 27 May 2008 08:55:17 +0100 Subject: error In-Reply-To: Message-ID: I think it depends on your Matlab version. I've had this problem many times and recompiling with just 'mex read_24bit.c' in Matlab command line and moving the file up has always solved it for me. Maybe Robert will have some other ideas. Just to make sure - you really compiled it from Matlab command line, not with an external compiler? Best, Vladimir On Tue, May 27, 2008 at 8:25 AM, Greg Hooper wrote: > Thanks for the response Vladimir. Unfortunately moving the file up > does not help - once compiled it forms a dll rather than a mex file. > Is that where the error lies? > > On Tue, May 27, 2008 at 4:52 PM, Vladimir Litvak wrote: >> Did you move your compiled file one directory up (into \private) and >> replace the previous version of the file? >> >> Vladimir >> >> On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: >>> Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using >>> fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core >>> system. >>> >>> The header information reads fine, but >>> I get the following error message in Matlab when trying to use read_data >>> >>> ??? Error using ==> fileio-20080526\private\read_24bit >>> this function is implemented as mex file and is not available for this platform >>> >>> Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 >>> buf = read_24bit(filename, offset, epochlength); >>> >>> Error in ==> read_data at 429 >>> dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); >>> >>> >>> >>> I have compiled the read_24bit.c as a mex file but this has not been successful >>> >>> The code is >>> >>> [hdr] = read_header('HHH_123.BDF'); % loads the header successfully >>> dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I >>> read this as as loading 1000 data points from channel 12 - is this correct? >>> >>> thankyou for any help >>> >>> Greg >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >>> >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From gregstuarthooper at GMAIL.COM Tue May 27 10:18:20 2008 From: gregstuarthooper at GMAIL.COM (Greg Hooper) Date: Tue, 27 May 2008 18:18:20 +1000 Subject: error In-Reply-To: Message-ID: thanks again - yes that is the command i used - i have matlab 7.0.4 Greg On Tue, May 27, 2008 at 5:55 PM, Vladimir Litvak wrote: > I think it depends on your Matlab version. I've had this problem many > times and recompiling with just 'mex read_24bit.c' in Matlab command > line and moving the file up has always solved it for me. Maybe Robert > will have some other ideas. Just to make sure - you really compiled it > from Matlab command line, not with an external compiler? > > Best, > > Vladimir > > On Tue, May 27, 2008 at 8:25 AM, Greg Hooper wrote: >> Thanks for the response Vladimir. Unfortunately moving the file up >> does not help - once compiled it forms a dll rather than a mex file. >> Is that where the error lies? >> >> On Tue, May 27, 2008 at 4:52 PM, Vladimir Litvak wrote: >>> Did you move your compiled file one directory up (into \private) and >>> replace the previous version of the file? >>> >>> Vladimir >>> >>> On Tue, May 27, 2008 at 3:54 AM, Greg Hooper wrote: >>>> Hi, I am new to Fieldtrip and trying to load Biosemi EEG data using >>>> fileio-20080526 and also Fieldtrip. I am using windows XP on a quad core >>>> system. >>>> >>>> The header information reads fine, but >>>> I get the following error message in Matlab when trying to use read_data >>>> >>>> ??? Error using ==> fileio-20080526\private\read_24bit >>>> this function is implemented as mex file and is not available for this platform >>>> >>>> Error in ==> fileio-20080526\private\read_biosemi_bdf at 237 >>>> buf = read_24bit(filename, offset, epochlength); >>>> >>>> Error in ==> read_data at 429 >>>> dat = read_biosemi_bdf(filename, hdr, begsample, endsample, chanindx); >>>> >>>> >>>> >>>> I have compiled the read_24bit.c as a mex file but this has not been successful >>>> >>>> The code is >>>> >>>> [hdr] = read_header('HHH_123.BDF'); % loads the header successfully >>>> dat = read_data('HHH_123.BDF',hdr,1000,2000,12); % which is unsuccessful - I >>>> read this as as loading 1000 data points from channel 12 - is this correct? >>>> >>>> thankyou for any help >>>> >>>> Greg >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >>>> >>>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From florisdelange at GMAIL.COM Tue May 27 16:27:41 2008 From: florisdelange at GMAIL.COM (Floris de Lange) Date: Tue, 27 May 2008 16:27:41 +0200 Subject: ICA and artifact rejection Message-ID: Dear Fieldtrippers, I've started to play with using ICA to remove artifacts from the MEG signal. Now, there's a couple of questions that came to my mind. I hope anyone of you can help me with them. 1) ICA can be pretty slow, and it has been suggested in the Fieldtrip mailing list to use PCA and estimate only the 50 components that explain most variance. However, when I do this to e.g. identify ECG-related artifacts, I run into trouble when trying to decompose the ECG-locked data into the components, using the previously estimated 50 components (in order to calculate the coherence between the components and the ECG signal). The ECG-locked data is 275 channels X number of time points, so it cannot be simply decomposed into 50 components. Does anyone know how to go about this? 2) For EOG I suppose I could do like for ECG, and calculate the coherence with VEOG in order to select components that are artifacts. But this is not so easy for head muscle-related artifacts (jaw and neck movements, etc.), since we typically don't measure neck and jaw muscle EMG. Apart from looking at spatial topography, is there a robust criterion that one could use for detection of EMG artifact components? Or would it be better to use 'classical' artifact rejection routines for these kinds of artifacts? And would ICA also be suitable to remove things like jumps and head movements in the MEG, or is it better/safer to just throw away those kind of data segments? Thanks for your help, Best wishes, Floris ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nicolas.robitaille at UMONTREAL.CA Tue May 27 17:48:32 2008 From: nicolas.robitaille at UMONTREAL.CA (Nicolas Robitaille) Date: Tue, 27 May 2008 15:48:32 +0000 Subject: ICA and artifact rejection In-Reply-To: <483C1A5D.3000408@gmail.com> Message-ID: Dear Floris I used ICA to remove noise from MEG signal. I can share my experience. If calculation time is an issue, I suggest to use FastICA instead of infomaxICA, which is the default. You need to download the toolbox yourself (http://www.cis.hut.fi/projects/ica/fastica/), but Fieldtrip take charge of it afterward, it's a new option in componentanalysis. For both infomaxICA and FastICA you can specify to the routine a specific numbers of components (like 100 instead of 275) to output, which should also reduce computing time. You can also select a subset of your data that contains all the artefacts you are interested to remove, run ICA on that, and apply the signal reconstruction without the artefactual-component to the entire dataset. For artefactual-component identifications, I suggest to look simultaneously at the topography and the time-course of the components. My position is that we do not absolutely need robust objective criteria for artefactual-component identification, unless we want a fully automatize process (that I would not trust for now). Furthermore, it's always a good idea to look at the raw data you have, prior to any signal processing. The EOG and ECG components are obvious, you will pick them easily. Just find a time-window of raw data that shows these artefacts, and look at the time-course of the components. I suppose this would be the same for muscle-related artefact. Others artefacts are more complex for ICA. I would remove segments with jumps and head movements. Breathing artefacts tended, in my MEG data, to spread across severals components, so it was tedious to identify them. You may also consider if the time requiered to spare a noizy subject is worth, comparing to the time (and cost) to test another one. Hope this help, Nicolas ---------------------------------------- > Date: Tue, 27 May 2008 16:27:41 +0200 > From: florisdelange at GMAIL.COM > Subject: [FIELDTRIP] ICA and artifact rejection > To: FIELDTRIP at NIC.SURFNET.NL > > Dear Fieldtrippers, > > I've started to play with using ICA to remove artifacts from the MEG > signal. Now, there's a couple of questions that came to my mind. I hope > anyone of you can help me with them. > > 1) ICA can be pretty slow, and it has been suggested in the Fieldtrip > mailing list to use PCA and estimate only the 50 components that explain > most variance. However, when I do this to e.g. identify ECG-related > artifacts, I run into trouble when trying to decompose the ECG-locked > data into the components, using the previously estimated 50 components > (in order to calculate the coherence between the components and the ECG > signal). The ECG-locked data is 275 channels X number of time points, so > it cannot be simply decomposed into 50 components. Does anyone know how > to go about this? > 2) For EOG I suppose I could do like for ECG, and calculate the > coherence with VEOG in order to select components that are artifacts. > But this is not so easy for head muscle-related artifacts (jaw and neck > movements, etc.), since we typically don't measure neck and jaw muscle > EMG. Apart from looking at spatial topography, is there a robust > criterion that one could use for detection of EMG artifact components? > Or would it be better to use 'classical' artifact rejection routines for > these kinds of artifacts? And would ICA also be suitable to remove > things like jumps and head movements in the MEG, or is it better/safer > to just throw away those kind of data segments? > > Thanks for your help, > Best wishes, > Floris > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. _________________________________________________________________ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 14:57:48 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 13:57:48 +0100 Subject: ICA and artifact rejection In-Reply-To: <483C1A5D.3000408@gmail.com> Message-ID: Hi Floris > 1) ICA can be pretty slow, and it has been suggested in the Fieldtrip > mailing list to use PCA and estimate only the 50 components that > explain most variance. However, when I do this to e.g. identify > ECG-related artifacts, I run into trouble when trying to decompose the > ECG-locked data into the components, using the previously estimated 50 > components (in order to calculate the coherence between the components > and the ECG signal). The ECG-locked data is 275 channels X number of > time points, so it cannot be simply decomposed into 50 components. > Does anyone know how to go about this? I'm not quite sure whether I understand the problem correctly. But obviously, if you have done a PCA first on the data, and do an ICA those principal components, in order to get back to the original data you have to multiply the unmixing matrix obtained from the ICA with that of the PCA. So if you only kept 50 principal components and pruned the others, your PC unmixing matrix will have 275 rows and 50 columns (ICA usually then 50 columns and rows) and in order to get back to your raw data you have to multiply the mixing matrices (i.e. pseudoinverse of the mixing matrix) of ICA and PCA in the correct order. I can provide you some code snippet if that is indeed the problem... > 2) For EOG I suppose I could do like for ECG, and calculate the > coherence with VEOG in order to select components that are artifacts. > But this is not so easy for head muscle-related artifacts (jaw and > neck movements, etc.), since we typically don't measure neck and jaw > muscle EMG. Apart from looking at spatial topography, is there a > robust criterion that one could use for detection of EMG artifact > components? Or would it be better to use 'classical' artifact > rejection routines for these kinds of artifacts? And would ICA also be > suitable to remove things like jumps and head movements in the MEG, or > is it better/safer to just throw away those kind of data segments? I would take out any short-lived non stationary (or non-frequently occuring) phenomena such as short muscle twitches and jumps in any case. For the more tonic muscle phenomena (like the neck and jaw muscles) ICA can do a decent job, but if subjects make movements the topography can each time be quite different - if a subject makes too many movements the whole idea of ICA as spatial filters is pointless cause the MEG sensor array won't follow the movement One problem with muscle artefacts is that there can be these huge variations in high-frequency power (muscle tonus primarily in neck and jaw muscle) over several blocks of trials. These can be detrimental for identifying gamma-oscillations and also for finding a decent rejection criteria for short-muscle artefacts (movements etc). In order to compensate for that we've written in Berlin some own muscle artefact routines that basically apply kind of a low-pass filter on the amplitude envelope of the high-frequency signal (that you use to separate short lived muscle artefacts from the ones with longer time course). You can use that to throw away the movements and leave the more tonic effects in (which may be in half of your trials or so) - to either take care of them by individual trial baseline correction or removing them by ICA. I can give you the scripts - but they use a radically different reading routine. I will also hand them over to Robert, they are written a bit differently than the usual fieldtrip stuff, but maybe he'll like them anyway best Markus PS: Personally, I became sceptical about ICA, cause it's so subjhecttive whether a compoentn is now an artefact component or not, whether to take it out or not. Also, often one and the "same" phenomenon are distributed acroiss components others you would expect to find you don't find. I didn't like that much what I saw ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 16:00:54 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 15:00:54 +0100 Subject: use of dipoles as spatial filters (for SEP) Message-ID: An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Wed May 28 16:15:54 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Wed, 28 May 2008 16:15:54 +0200 Subject: use of dipoles as spatial filters (for SEP) In-Reply-To: <483D6596.7040601@fil.ion.ucl.ac.uk> Message-ID: Hi Markus, Did you consider trying out the beamforming algorithm with multiple dipoles as a source model? As opposed to the dipole-fitting (which pinv'es the concatenated leadfields), the beamformer actually tries to suppress contributions of the other guys (provided they are not too much correlated in time). Obviously, the suppression will be more robust against violations of the temporal uncorrelation-assumption, when the leadfield-columns are less correlated. However, I would guess it's worth a try, and it's exactly what you try to achieve: to avoid mixing up correlated leadfield components. But perhaps I did not grasp the problem completely... ;o) Yours, JM On May 28, 2008, at 4:00 PM, Markus Bauer wrote: > > Hi fieldtrippers (in particular probably Robert) > > I have a few slightly more advanced questions regarding the use of > dipoles as spatial filters and the creation of multi-dipole models > with fieldtrip (questions in bold) > I know that the functionality of fieldtrip is not designed for > multi-dipole models, but neither Beamformer nor MNE worked somewhat > reliably (only worked in rather few subjects and then was usually > pretty smeared still), as often is the case...(for evoked fields in > this case). So I finally decided to once go back to the "gold > standard" of somatosensory EEG/MEG research > > I have used a serial fit-procedure to fit components of the SEP to > EEG data. The early components (50 and 80 ms post response) are > largely determined by two single dipoles, plus a symmetric dipole > later for bilateral S2. So it is kind of ok to fit simple dipoles > to those (though clearly not ideal) > > My first question: > Are there plans to extend the functionality of dipolefitting to > allow for proper serial fit (i.e. adding to be fitted dipoles to > existing ones) ? I guess it would not be that much rewriting to > include a fixed dipole and only fit the parameters of the other? > > Anyway, in order to create spatial filters I have then fitted the > orientation of each dipole (estimated from the moments) and thereby > reduced the leadfield to a onedimensional one. > In order to get to the sourcewaveforms, I have concatenated the > (one dimensional) leadfields associated with each source into a > common leadfield matrix (4 sources corresponding to 4 rows and 124 > columns for each channel) and then took the pseudoinverse of this > combined leadfield matrix - for use as spatial filters to obtain > sourcewaveforms - for the "complete solution". > > When I looked at those filters obtained, however, I realized that > it did not work that nicely, since the filters looked for at least > two components very similar - more similar than the respective > leadfields!! (which is contra-intuitive) > The topographies of the peaks where I fitted dipoles to are > beautiful single dipolar topographies and so are the single > leadfield matrices, but the filters are anything else than clean. > It is clear that they will represent a mixture between the sources > - mutually "supressing" each other. But at least for two of them > (the early sources for 50 and 80 ms with clearly distinct topos, > presumably area3b and area1) they pretty much mixed up. I was > surprised about this cause the topoghraphies look so distinct and I > would have assumed this should come out nicely (also considering > all the Hari-studies) > > Anyway, a look at the correlation matrix of the leadfields showed > that despite the topographies of those dipoles had quite a > different orientation they were correlated at 0.77 (weights over > channels). So I guess what happens is identical to a suppressor > effect in multiple regresion - when the predictors are too > correlated their weights get mixed up.... > > I tend to use the individual spatial filters now - not the > pseudoinverse of the combined source model (consisting of only > four, well identifiable sources). > My question: > > Is this justified - to take individual filters when having a multi- > dipole model ? > > I also realized that when I only included the first two sources > (the ones described above), and take the pseudoinverse the > separation succeeds much better. > > - Might prior regularization of the leadfield help ? > - Are there any standards about this - when to still use a combined > leadfield model ? I guess should be the same as in multiple > regression cause formulas more or less identical...? But I guess > nobody publishing sourcewaveforms from multidipole model cares > about it... > > I was a bit "shocked" to see how much this can falsify the results > (the waveforms), I also wouldn't have expected the leadfields (and > filters...) of such rather different sources to be that strongly > correlated. I assume it will be not much different in MEG, cause > they were both tangential dipoles, looking almost identical as in > MEG (apart from 90deg rotation due to field geometry). > My strategy is therefore to either use individual filters of single > dipoles or reduce the dipolar model...any other suggestions ?? > It seems it is really a very ill-posed problem that we're spending > our time with.... > > > thanks and best wishes > Markus > ---------------------------------- > > The aim of this list 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/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 16:41:31 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 15:41:31 +0100 Subject: use of dipoles as spatial filters (for SEP) In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 16:45:16 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 15:45:16 +0100 Subject: even one more dipole question...symmetry constraint... Message-ID: ....what precisely is the consequence of the symmetry constraint on the calculated leadfields for symmetrical sources ? I used the symmetry constraint for fitting two dipoles (for bilat. S2) and looked at the respective leadfields of the corresponding "individual" dipoles - to find out that they rather look not so individual at all... the coefficients of both had bilateral maxima, as the leadfields being a mixture of the two individual dipoles, being symmetric along some axes (y and z ?) and antisymmetric along the others (x?) I do not quite understand this, cause I assumed the symmetry constraint was only used to find the location parameter but the leadfields would then be calculated for each position independently.... but this does not seem to be the case. are there any assumptions about correlations of symmetric sources (dipoles) going in here to suppress the respective other source ? is there a reference to that ? thanks Markus ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From m.bauer at FIL.ION.UCL.AC.UK Wed May 28 17:07:12 2008 From: m.bauer at FIL.ION.UCL.AC.UK (Markus Bauer) Date: Wed, 28 May 2008 16:07:12 +0100 Subject: use of dipoles as spatial filters (for SEP) In-Reply-To: Message-ID: > > Did you consider trying out the beamforming algorithm with multiple > dipoles as a source model? > As opposed to the dipole-fitting (which pinv'es the concatenated > leadfields), the beamformer actually tries to suppress contributions > of the other guys (provided they are not too much correlated in time). > Obviously, the suppression will be more robust against violations of > the temporal uncorrelation-assumption, when the leadfield-columns are > less correlated. another reason why I didn't want to put the beamformer just into a location to estimate the timecourse of the evoked field is that you would have to calculate the covariance matrix-stepwise for each time point (or at least over timeintervals, in a sliding fashion) - otherwise the method is not legitimate - and I assume it will indeed substantially distort the results if one just calculates one covariance matrix over the whole (severely nonstationary) timeperiod where one wants to look at the source-waveform. this problem is more severe for evoked fields than in the frequency doman cause of greater transients, not separated by frequency.... has anyone got more experience with this / investigated more in depth ? my previous experience on this (with ordinary beamformers) wasn't that great m ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From fredericroux at HOTMAIL.DE Fri May 30 16:00:43 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Fri, 30 May 2008 16:00:43 +0200 Subject: strange baseline artefacts Message-ID: Dear Fieldtrippers, I have a very strange activity pattern in my baseline. This artefact only appears in 2 of 3 experimental conditions. Does anyone have an idea were this could come from? Regards, Frederic Dipl. Psych. Frederic Roux Max Planck Institut für Hirnforschung Abteilung Neurophysiologie Deutschordenstr. 46 60528 Frankfurt am Main Tel.: 069 / 6301 83225 Mail: fredericroux at hotmail.de froux at mpih-frankfurt.mpg.de _________________________________________________________________ Die aktuelle Frühjahrsmode - Preise vergleichen bei MSN Shopping http://shopping.msn.de/category/damenbekleidung/bcatid66/forsale?text=category:damenbekleidung&edt=1&ptnrid=230 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: sensorAvg_dB.jpg Type: image/jpeg Size: 105609 bytes Desc: not available URL: From nathanweisz at MAC.COM Fri May 30 22:39:38 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Fri, 30 May 2008 22:39:38 +0200 Subject: job vacancies in konstanz (germany) Message-ID: dear colleagues, 3 positions (1 postdoc, 2 phd) will be available in a newly founded research group (MEG / EEG / TMS) at the university of konstanz, starting earliest august 2008. see attached pdf for details. please pass this on to anyone who may be interested. cheers, nathan -------------------------------- Dr. Nathan Weisz INSERM - Unité 821 Dynamique cérébrale et cognition Centre Hospitalier Le Vinatier, Bâtiment 452 95 Boulevard Pinel 69500 Bron, France Tel: ++33 - (0)4 - 7213 8915 Email: nathan.weisz at inserm.fr Chat-AV: nathanweisz at mac.com Homepage: http://web.mac.com/nathanweisz Neurotree: http://neurotree.org/neurotree/tree.php?pid=8692 Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Emmy_KN08_positions.pdf Type: application/pdf Size: 30237 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: