From karl.doron at GMAIL.COM Sat May 1 00:22:41 2010 From: karl.doron at GMAIL.COM (Karl Doron) Date: Sat, 1 May 2010 00:22:41 +0200 Subject: Error in ft_megrealign Message-ID: I got this to compile if anyone needs it. -karl doron ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: meg_leadfield1.mexmaci64 Type: application/octet-stream Size: 8856 bytes Desc: not available URL: From ronitibon at GMAIL.COM Mon May 3 17:08:39 2010 From: ronitibon at GMAIL.COM (Roni Tibon) Date: Mon, 3 May 2010 17:08:39 +0200 Subject: Wavelet vs. Multitaper Message-ID: Dear all, I've been trying to analyze the same data using both methods, but I'm getting very different results, depending on the method I'm using. Enclosed is a picture of the results of the analysis in 3 channels, using both methods. In the left column I performed a multitaper analysis for each channel, using the following script: cfg = []; cfg.output = 'pow'; cfg.channel = 'A195'; cfg.method = 'mtmconvol'; cfg.foi = 1:1:50; cfg.t_ftimwin = 2./cfg.foi; cfg.tapsmofrq = 0.4 *cfg.foi; cfg.toi = -0.2:0.05:1; cfg.pad = 'maxperlen'; f12a_a195 = ft_freqanalysis(cfg, data); In the right one, I performed wavelet analysis using: cfg = []; cfg.channel = 'A195'; cfg.method = 'wltconvol'; cfg.output = 'pow'; cfg.foi = 1:1:50; cfg.width = 1; cfg.toi = -0.2:0.05:1; cfg.keeptrials = 'yes'; f12b_a195=freqanalysis(cfg, data); As you can see, channel A106 looks about the same using both methods. However, for channels A176 and A195, the multitaper analysis revealed activation in frequencies ranging from ~15-25, which was not seen in the wavelet analysis. I used a different program (msi) to divide the trial in two (0-500ms and 500-1000ms) and compare activation in this frequency range between the 2 halves, and indeed- there was more activation in the second half, as would be suggested by the multitaper. Can it be that when using wavelet analysis data is lost like this? Am I doing something wrong with the wavelet? Thanks, Roni ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: wavelet.jpg Type: image/jpeg Size: 93156 bytes Desc: not available URL: From r.vandermeij at DONDERS.RU.NL Mon May 3 17:36:45 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Mon, 3 May 2010 17:36:45 +0200 Subject: Wavelet vs. Multitaper In-Reply-To: Message-ID: Hi Roni, I haven't looked in detail at all the other settings you use, but you apparently use a different number of cycles for the wavelets in both methods. For the multitapers, you use 2 cycles per wavelet (which are then convolved with the set of dpss tapers), whereas you use 1 cycle for your Morlet wavelets (which are then convolved with a hanning taper (or something similar)). This will make the time-window for spectral estimation twice as long for the multitapers than for your Morlet wavelets. You could try setting cfg.width = 2 for 'wltconvol'. Hope it helps a bit, Roemer On 5/3/2010 5:08 PM, Roni Tibon wrote: > Dear all, > > I've been trying to analyze the same data using both methods, but I'm > getting very different results, depending on the method I'm using. > > Enclosed is a picture of the results of the analysis in 3 channels, using > both methods. In the left column I performed a multitaper analysis for each > channel, using the following script: > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'A195'; > cfg.method = 'mtmconvol'; > cfg.foi = 1:1:50; > cfg.t_ftimwin = 2./cfg.foi; > cfg.tapsmofrq = 0.4 *cfg.foi; > cfg.toi = -0.2:0.05:1; > cfg.pad = 'maxperlen'; > f12a_a195 = ft_freqanalysis(cfg, data); > > In the right one, I performed wavelet analysis using: > > cfg = []; > cfg.channel = 'A195'; > cfg.method = 'wltconvol'; > cfg.output = 'pow'; > cfg.foi = 1:1:50; > cfg.width = 1; > cfg.toi = -0.2:0.05:1; > cfg.keeptrials = 'yes'; > f12b_a195=freqanalysis(cfg, data); > > As you can see, channel A106 looks about the same using both methods. > However, for channels A176 and A195, the multitaper analysis revealed > activation in frequencies ranging from ~15-25, which was not seen in the > wavelet analysis. > > I used a different program (msi) to divide the trial in two (0-500ms and > 500-1000ms) and compare activation in this frequency range between the 2 > halves, and indeed- there was more activation in the second half, as would > be suggested by the multitaper. > > Can it be that when using wavelet analysis data is lost like this? > Am I doing something wrong with the wavelet? > > Thanks, > Roni > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ronitibon at GMAIL.COM Mon May 3 20:05:19 2010 From: ronitibon at GMAIL.COM (Roni Tibon) Date: Mon, 3 May 2010 21:05:19 +0300 Subject: Wavelet vs. Multitaper In-Reply-To: <4BDEED8D.6000306@donders.ru.nl> Message-ID: Hi, Thanks for the quick response. I tried using the settings you suggested, which, of course, reduced the frequency range, and revealed some activity in ~15-25hz, although it looked minor compared to that seen in the multitaper. I guess my questions now are these: 1. How come when I use multitaper with 1 cycle I see a range starting at 5 hz, but when I use morelet wavelet with 1 cycle, the range starts at 10hz? 2. Can I conclude that when the trial is rather short multitaper will be more accurate, or more sensitive to changes? 3. How come the freq range in the multitaper changes depending on the baseline settings? It started at 5hz when cfg.baseline = [-0.2 -0.05], but started at 10hz when cfg.baseline = [-0.2 -0.1]; Thanks a lot! Roni On 3 May 2010 18:36, Roemer van der Meij wrote: > Hi Roni, > > I haven't looked in detail at all the other settings you use, but you > apparently use a different number of cycles for the wavelets in both > methods. For the multitapers, you use 2 cycles per wavelet (which are then > convolved with the set of dpss tapers), whereas you use 1 cycle for your > Morlet wavelets (which are then convolved with a hanning taper (or something > similar)). This will make the time-window for spectral estimation twice as > long for the multitapers than for your Morlet wavelets. You could try > setting cfg.width = 2 for 'wltconvol'. > > Hope it helps a bit, > > Roemer > > > > > On 5/3/2010 5:08 PM, Roni Tibon wrote: > >> Dear all, >> >> I've been trying to analyze the same data using both methods, but I'm >> getting very different results, depending on the method I'm using. >> >> Enclosed is a picture of the results of the analysis in 3 channels, using >> both methods. In the left column I performed a multitaper analysis for >> each >> channel, using the following script: >> >> cfg = []; >> cfg.output = 'pow'; >> cfg.channel = 'A195'; >> cfg.method = 'mtmconvol'; >> cfg.foi = 1:1:50; >> cfg.t_ftimwin = 2./cfg.foi; >> cfg.tapsmofrq = 0.4 *cfg.foi; >> cfg.toi = -0.2:0.05:1; >> cfg.pad = 'maxperlen'; >> f12a_a195 = ft_freqanalysis(cfg, data); >> >> In the right one, I performed wavelet analysis using: >> >> cfg = []; >> cfg.channel = 'A195'; >> cfg.method = 'wltconvol'; >> cfg.output = 'pow'; >> cfg.foi = 1:1:50; >> cfg.width = 1; >> cfg.toi = -0.2:0.05:1; >> cfg.keeptrials = 'yes'; >> f12b_a195=freqanalysis(cfg, data); >> >> As you can see, channel A106 looks about the same using both methods. >> However, for channels A176 and A195, the multitaper analysis revealed >> activation in frequencies ranging from ~15-25, which was not seen in the >> wavelet analysis. >> >> I used a different program (msi) to divide the trial in two (0-500ms and >> 500-1000ms) and compare activation in this frequency range between the 2 >> halves, and indeed- there was more activation in the second half, as would >> be suggested by the multitaper. >> >> Can it be that when using wavelet analysis data is lost like this? >> Am I doing something wrong with the wavelet? >> >> Thanks, >> Roni >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at MAC.COM Mon May 3 21:06:24 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Mon, 3 May 2010 21:06:24 +0200 Subject: Wavelet vs. Multitaper In-Reply-To: Message-ID: hi roni, > 1. How come when I use multitaper with 1 cycle I see a range starting at 5 hz, but when I use morelet wavelet with 1 cycle, the range starts at 10hz? i'm not sure. what do you mean with "range": the lowest frequency where you get a spectral estimation? just looking at your plots the difference doesn't seem dramatic: the multitaper seems to start somewhere at 6-7, the wavelet at 5. you resolution is set to 1 Hz. > 2. Can I conclude that when the trial is rather short multitaper will be more accurate, or more sensitive to changes? without being an expert: with the multitaper you have more possibilities to do "fine-tuning" (i.e. spectral and temporal resolution can be specified separately). for the have a spectral smoothing of +/- foi*.4. for your wavelet it's +/- foi/1 (your width which for wavelets fixes the temporal AND spectral resolution). this means your frequency resolution in case of the wavelet is *terrible*!! you should take a look here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis in general it seems that for doing "good" time-frequency analysis, your trial lengths are far too short, particularly if you are interested in lower frequency activity. you should be more generous when chopping your data into trials (i usually do +/- 2s or so, do TF-analysis and then home-in into interpretable periods). you can see that in your case you hardly have values in the baseline (particularly <20 Hz). when you do that (i.e. longer epochs) and use sensible m-factors (~5-7; or just use the fieldtrip default), then you will definitely get a completely different picture. i'm not religious about wavelets and multitapers. with proper use both give good and usually very similar results. as said multitapers offer more possibilities for fine-tuning, but more freedom in choice is sometimes a heavy burden :-) > 3. How come the freq range in the multitaper changes depending on the baseline settings? It started at 5hz when cfg.baseline = [-0.2 -0.05], but started at 10hz when cfg.baseline = [-0.2 -0.1]; again: take a look at the pictures. you basically have NaN's everywhere between -.2 and -.1. longer epochs are your friend. good luck, nathan > > Thanks a lot! > Roni > > > > On 3 May 2010 18:36, Roemer van der Meij wrote: > Hi Roni, > > I haven't looked in detail at all the other settings you use, but you apparently use a different number of cycles for the wavelets in both methods. For the multitapers, you use 2 cycles per wavelet (which are then convolved with the set of dpss tapers), whereas you use 1 cycle for your Morlet wavelets (which are then convolved with a hanning taper (or something similar)). This will make the time-window for spectral estimation twice as long for the multitapers than for your Morlet wavelets. You could try setting cfg.width = 2 for 'wltconvol'. > > Hope it helps a bit, > > Roemer > > > > > On 5/3/2010 5:08 PM, Roni Tibon wrote: > Dear all, > > I've been trying to analyze the same data using both methods, but I'm > getting very different results, depending on the method I'm using. > > Enclosed is a picture of the results of the analysis in 3 channels, using > both methods. In the left column I performed a multitaper analysis for each > channel, using the following script: > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'A195'; > cfg.method = 'mtmconvol'; > cfg.foi = 1:1:50; > cfg.t_ftimwin = 2./cfg.foi; > cfg.tapsmofrq = 0.4 *cfg.foi; > cfg.toi = -0.2:0.05:1; > cfg.pad = 'maxperlen'; > f12a_a195 = ft_freqanalysis(cfg, data); > > In the right one, I performed wavelet analysis using: > > cfg = []; > cfg.channel = 'A195'; > cfg.method = 'wltconvol'; > cfg.output = 'pow'; > cfg.foi = 1:1:50; > cfg.width = 1; > cfg.toi = -0.2:0.05:1; > cfg.keeptrials = 'yes'; > f12b_a195=freqanalysis(cfg, data); > > As you can see, channel A106 looks about the same using both methods. > However, for channels A176 and A195, the multitaper analysis revealed > activation in frequencies ranging from ~15-25, which was not seen in the > wavelet analysis. > > I used a different program (msi) to divide the trial in two (0-500ms and > 500-1000ms) and compare activation in this frequency range between the 2 > halves, and indeed- there was more activation in the second half, as would > be suggested by the multitaper. > > Can it be that when using wavelet analysis data is lost like this? > Am I doing something wrong with the wavelet? > > Thanks, > Roni > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > > The aim of this list 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/ > -------------------------------------------- Dr. Nathan Weisz OBOB-Lab University of Konstanz Department of Psychology P.O. Box D23 78457 Konstanz Germany Tel: ++49 - (0)7531 - 88 45 84 Email: nathan.weisz at uni-konstanz.de Homepage: http://www.uni-konstanz.de/obob "Nothing shocks me. I'm a scientist." (Indiana Jones) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zachary.d.cohen at VANDERBILT.EDU Tue May 4 00:01:00 2010 From: zachary.d.cohen at VANDERBILT.EDU (Zachary Daniel Cohen) Date: Mon, 3 May 2010 17:01:00 -0500 Subject: timelockgrandaverage config Message-ID: Hello FieldTrip Community, Let me start off by saying thanks for an amazing analysis package; I've been using it since november with our scalp EEG data analyses and am a huge fan. I recently began looking at grandaverage cluster analyses, and wanted to check in to make sure I'm configuring everything correctly because a few things don't look right. My goal is to compare the pattern of voltage activity across the scalp for taskA vs. taskB I preprocess my scalp eeg voltage data using my own functions, I believe the important details are as follows: 60 subjects, each subject has approx 800 events where they performed taskA and 800 events where they performed taskB, although it varies with each subject. Each event is timelocked from 0ms to 1200ms. I run each subject's taskA data through timelock analysis, and then run timelockgrandaverage on the set of all subjects' taskA averages. I then do the same for taskB. I then run timelockstatistics on the two grandaverages. My cfg is set as follows: layout: 'HCGSN128_nof.sfp' neighbourdist: 0.1300 correctm: 'cluster' clusteralpha: 0.0500 alphathresh: 0.0500 method: 'montecarlo' clusterstatistic: 'maxsum' dimord: 'chan_time' numrandomization: 1000 minnbchan: 1 tail: 0 clustertail: 0 alpha: 0.0500 statistic: 'depsamplesT' uvar: 1 ivar: 2 keepindividual: 'yes' computecritval: 'no' clustercritval: 0.0500 clusterthreshold: 'parametric' cfg.design is a 2X120 double, where the top row contains the subject numbers [1:60 1:60] and the bottom row identifies what condition the data is from (1 for taskA and 2 for taskB). When the script runs, the following gets output: there are on average 9.8 neighbours per channel using "statistics_montecarlo" for the statistical testing using "statfun_depsamplesT" for the single-sample statistics constructing randomized design total number of measurements = 120 total number of variables = 2 number of independent variables = 1 number of unit variables = 1 number of within-cell variables = 0 number of control variables = 0 using a permutation resampling approach repeated measurement in variable 1 over 60 levels number of repeated measurements in each level is 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 using the specified parametric threshold for clustering computing statistic The questions I have are the following: 1. Should the total number of independent variables be 2, and the total number of unit variables be 60? 2. What should the total number of repeated measures in each level be? 3. I'm not sure whether to leave the data in 10ms bins, or to bin it as I would for publication, in say 150ms or 300ms bins, before running it through the cluster analysis. 4. How should I make intelligent decisions about neighbourdist and minnbchan? Right now I have chosen .13 because that leaves a reasonable amount of electrodes defined as neighbours, but I would prefer to base my decision on something more sound, perhaps a methods paper? 5. Finally, would using the computercritval option be a better choice than simply setting the level at .05? Thanks so much for your advice in advance! Reading these forums has helped a great deal in the past. My apologies if I omitted any important information, please let me know if I did. Best, - Zach ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From thomas.hartmann at UNI-KONSTANZ.DE Thu May 6 14:19:00 2010 From: thomas.hartmann at UNI-KONSTANZ.DE (Thomas Hartmann) Date: Thu, 6 May 2010 14:19:00 +0200 Subject: using lcvm-beamformer filter to project time-domain eeg data Message-ID: hi, i would like to use the filters generated by the lcmv-beamformer algorithm to project my plain time-domain eeg data to the sources in the brain. what puzzles me is that my eeg data in microvolts gets scaled by 10^6-10^7 after projection. what kind of unit is this? (if the data still has one...). is this scaling reliable and constant over subjects? thanks in advance for your help, thomas -- Dipl. Psych. Thomas Hartmann OBOB-Lab University of Konstanz Department of Psychology P.O. Box D25 78457 Konstanz Germany Tel.: +49 (0)7531 88 4612 Fax: +49 (0)7531-88 4601 Email: thomas.hartmann at uni-konstanz.de Homepage: http://www.uni-konstanz.de/obob "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan Doyle) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From recasensmarc at GMAIL.COM Thu May 6 20:38:40 2010 From: recasensmarc at GMAIL.COM (Marc Recasens) Date: Thu, 6 May 2010 20:38:40 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Hello, I'm new in Fieldtrip and I find myself needed of some help :) I'm currently analysing some MEG data (4D-Neuroimaging, Magnes 2500WH) and trying to create a Single-Shell headmodel using a segmented mri. . I've read all the documentation on FT website but I'm still stuck. The volume never fits in the correct position inside the sensor helmet. First of all, I create a segmented MRI using Analyse images (.img'), and the segmentation is performed using: cfg.coordinates = 'spm'; cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates\T1.mnc'; segmentedmri = ft_volumesegment (cfg, mri); segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior volumerealign. Then, I do a volumerealign by selecting manually the fiducial points (Nas, Lpa, Rpa), as I actually don't have fiducials on the MRI scans. cfg.method = 'realignfiducial'; cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) cfg.fiducial.lpa = Lpa; cfg.fiducial.rpa = Rpa; segmented_r = ft_volumerealign (cfg, segmentedmri); Finally I create a volume through the ft_prepare_singleshell (cfg, segmented_r) function and plot it. I have the fiducials or head position coils and the scalp registered by means of a Polhemus digitizer.. Though the segment via ft_sourceplot (doing the: segment.avg.pow = segment.gray+...) looks right, the headmodelplot shows that the volume and the headshape don't fit. Is there any possibility to realign the segmented mri according either to the headshape points either to the MEG fiducials? I'm afraid the answer is no in both cases (as the MRI and MEG coordinates are different). I tried to realign the segment interactively by selecting the positions where the coils in the MRI should be... but as the picture shows, it doesn't fit. am I doing something wrong or skipping some important step? Is it possible to transform MRI coordinate system to MEG-head coordinate system? Would it help? [image: singleshell.jpg][image: singleshell2.jpg] I attach a picture of what i've managed to do till now! Thanks for all!!! -- Marc Recasens Tel.: +34 639 24 15 98 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: singleshell2.jpg Type: image/jpeg Size: 31112 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: singleshell.jpg Type: image/jpeg Size: 31681 bytes Desc: not available URL: From jan.schoffelen at DONDERS.RU.NL Fri May 7 09:01:05 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Fri, 7 May 2010 09:01:05 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Dear Marc, It seems to me that there is an issue with the coordinate system in which your original MRI is expressed. This could be related to the order of the steps you take, so I would permute the order and see whether this makes any difference at all (for me it usually works fine as follows:) First do a call to ft_volumerealign using your single subject's MRI. This step should give you the transformation matrix from voxel to headspace according to CTF's convention (which happens to be the same as 4d). Then do a segmentation of the output of ft_volumerealign, but note that you should specify ctf.coordinates = 'ctf'. Then you can proceed to create the single shell volume conductor model (after checking whether the segmentation worked fine with respect to the orientation etc of the resulting volumes; I believe there is some documentation about this on the website) and plot the results. Hopefully this helps, Best, Jan-Mathijs On May 6, 2010, at 8:38 PM, Marc Recasens wrote: > Hello, > > I'm new in Fieldtrip and I find myself needed of some help :) > I'm currently analysing some MEG data (4D-Neuroimaging, Magnes > 2500WH) and trying to create a Single-Shell headmodel using a > segmented mri. > . I've read all the documentation on FT website but I'm still stuck. > The volume never fits in the correct position inside the sensor > helmet. > > First of all, I create a segmented MRI using Analyse images > (.img'), and the segmentation is performed using: > cfg.coordinates = 'spm'; > cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates > \T1.mnc'; > segmentedmri = ft_volumesegment (cfg, mri); > segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior > volumerealign. > > Then, I do a volumerealign by selecting manually the fiducial points > (Nas, Lpa, Rpa), as I actually don't have fiducials on the MRI scans. > cfg.method = 'realignfiducial'; > cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) > cfg.fiducial.lpa = Lpa; > cfg.fiducial.rpa = Rpa; > segmented_r = ft_volumerealign (cfg, segmentedmri); > > > Finally I create a volume through the ft_prepare_singleshell (cfg, > segmented_r) function and plot it. > I have the fiducials or head position coils and the scalp registered > by means of a Polhemus digitizer.. > Though the segment via ft_sourceplot (doing the: segment.avg.pow = > segment.gray+...) looks right, the headmodelplot shows that the > volume and the headshape don't fit. > > Is there any possibility to realign the segmented mri according > either to the headshape points either to the MEG fiducials? I'm > afraid the answer is no in both cases (as the MRI and MEG > coordinates are different). I tried to realign the segment > interactively by selecting the positions where the coils in the MRI > should be... but as the picture shows, it doesn't fit. > am I doing something wrong or skipping some important step? > Is it possible to transform MRI coordinate system to MEG-head > coordinate system? Would it help? > > > > I attach a picture of what i've managed to do till now! > > > > Thanks for all!!! > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > > ---------------------------------- > > The aim of this list 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/ > Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mlindegaard at MSN.COM Fri May 7 14:43:57 2010 From: mlindegaard at MSN.COM (Mette Lindegaard) Date: Fri, 7 May 2010 14:43:57 +0200 Subject: File format and source reconstruction Message-ID: Dear FiledTrip experts, We are two engineering students from the Technical University of Denmark right now writing a bachlor project about EEG source reconstruction. We have EEG-data from 16 patients in the file format .rec. The data is already preprocessed and divided into artefact free segments of approximately 1-3 seconds. We have already converted the data to .mat format, where there is a .mat file for each of the 19 electrodes and segment. Our first challenge is to import the data into something fieldtrip recognizes, whereafter our main goal is to calculate a 3D source reconstruction with the LORETA algorithm. We hope that this isn't a too big question for you to answer. Best regards Sofie Therese Hansen and Mette Lindegaard. _________________________________________________________________ Surfa tryggt med Internet Explorer 8 http://www.microsoft.com/sverige/windows/internet-explorer/default.aspx ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From grion at SISSA.IT Fri May 7 16:06:27 2010 From: grion at SISSA.IT (Natalia Grion) Date: Fri, 7 May 2010 16:06:27 +0200 Subject: Error: checkdata at 381 This function requires raw data as input Message-ID: Dear all, I have this error when running freqanalysis: ??? Error using ==> checkdata at 381 This function requires raw data as input. My data comes from a preprocessing procedure where i just append daily sessions with 8 channel lfp recordings and several trials from the same subject) and it has this shape: hdr: [1x1 struct] label: {8x1 cell} trial: {1x349 cell} time: {1x349 cell} fsample: 2003 cfg: [1x1 struct] when i run checkdata alone I obtain the message i expect: B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset','yes'); the input is raw data with 8 channels and 349 trials This error message sounds odd to me as I never had this problem in the past. I changed to Matlab 2009a in a 64bit win system (Could this info help to solve the problem?) Any idea? Thanks in advance. Natalia ---------------------------------------------------------------- SISSA Webmail https://webmail.sissa.it/ Powered by SquirrelMail http://www.squirrelmail.org/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Fri May 7 16:12:43 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Fri, 7 May 2010 16:12:43 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <58071.147.122.60.164.1273241187.squirrel@webmail.sissa.it> Message-ID: Hi Natalia, Could you post the cfg-settings you use when calling ft_freqanalysis and the full matlab error output? This will help us track down the cause of the error. Also, did you use ft_appenddata for appending your recordings or did you do it by hand? Best, Roemer On 5/7/2010 4:06 PM, Natalia Grion wrote: > Dear all, > I have this error when running freqanalysis: > ??? Error using ==> checkdata at 381 > This function requires raw data as input. > My data comes from a preprocessing procedure where i just append daily > sessions with 8 channel lfp recordings and several trials from the same > subject) and it has this shape: > > hdr: [1x1 struct] > label: {8x1 cell} > trial: {1x349 cell} > time: {1x349 cell} > fsample: 2003 > cfg: [1x1 struct] > > when i run checkdata alone I obtain the message i expect: > B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', > 'hasoffset','yes'); > the input is raw data with 8 channels and 349 trials > This error message sounds odd to me as I never had this problem in the past. > I changed to Matlab 2009a in a 64bit win system (Could this info help to > solve the problem?) > Any idea? > Thanks in advance. > Natalia > > > > > ---------------------------------------------------------------- > SISSA Webmail https://webmail.sissa.it/ > Powered by SquirrelMail http://www.squirrelmail.org/ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jan.schoffelen at DONDERS.RU.NL Fri May 7 16:18:27 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Fri, 7 May 2010 16:18:27 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <4BE41FDB.7060508@donders.ru.nl> Message-ID: Adding to Roemer's questions: What is the fieldtrip version you are using? Next to this, it is also insightful/helpful to look into what causes the error yourself: if you type dbstop if error on the command line, when the function crashes you end up within the local workspace of the crashing function, allowing you to investigate the cause of your error. Best, Jan-Mathijs On May 7, 2010, at 4:12 PM, Roemer van der Meij wrote: > Hi Natalia, > > Could you post the cfg-settings you use when calling ft_freqanalysis > and the full matlab error output? This will help us track down the > cause of the error. Also, did you use ft_appenddata for appending > your recordings or did you do it by hand? > > Best, > Roemer > > > > > On 5/7/2010 4:06 PM, Natalia Grion wrote: >> Dear all, >> I have this error when running freqanalysis: >> ??? Error using ==> checkdata at 381 >> This function requires raw data as input. >> My data comes from a preprocessing procedure where i just append >> daily >> sessions with 8 channel lfp recordings and several trials from the >> same >> subject) and it has this shape: >> >> hdr: [1x1 struct] >> label: {8x1 cell} >> trial: {1x349 cell} >> time: {1x349 cell} >> fsample: 2003 >> cfg: [1x1 struct] >> >> when i run checkdata alone I obtain the message i expect: >> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >> 'hasoffset','yes'); >> the input is raw data with 8 channels and 349 trials >> This error message sounds odd to me as I never had this problem in >> the past. >> I changed to Matlab 2009a in a 64bit win system (Could this info >> help to >> solve the problem?) >> Any idea? >> Thanks in advance. >> Natalia >> >> >> >> >> ---------------------------------------------------------------- >> SISSA Webmail https://webmail.sissa.it/ >> Powered by SquirrelMail http://www.squirrelmail.org/ >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From grion at SISSA.IT Fri May 7 16:28:12 2010 From: grion at SISSA.IT (Natalia Grion) Date: Fri, 7 May 2010 16:28:12 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <4BE41FDB.7060508@donders.ru.nl> Message-ID: Sure. here are the settings, cfgfreqan=[]; cfgfreqan.method= 'wltconvol'; cfgfreqan.output = 'pow'; cfgfreqan.channel = {'H_LFP_1'}; cfgfreqan.keeptrials = 'no'; cfgfreqan.foi = [4:0.1:12]; cfgfreqan.toi = [-2:0.010:2]; cfgfreqan.width = 5; freqout=freqanalysis(cfgfreqan,data); And the full matlab error message: ??? Error using ==> checkdata at 381 This function requires raw data as input. Error in ==> freqanalysis at 165 data = checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset', 'yes'); Error in ==> Spctrgrm_ThetaWlt_AllRats at 25 freqout=freqanalysis(cfgfreqan,data); About appending data: I'm using appenddata function, which generate the structure I wrote in the past mail. Hope this info helps, Natalia > Hi Natalia, > > Could you post the cfg-settings you use when calling ft_freqanalysis and > the full matlab error output? This will help us track down the cause of > the error. Also, did you use ft_appenddata for appending your recordings > or did you do it by hand? > > Best, > Roemer > > > > > On 5/7/2010 4:06 PM, Natalia Grion wrote: >> Dear all, >> I have this error when running freqanalysis: >> ??? Error using ==> checkdata at 381 >> This function requires raw data as input. >> My data comes from a preprocessing procedure where i just append daily >> sessions with 8 channel lfp recordings and several trials from the same >> subject) and it has this shape: >> >> hdr: [1x1 struct] >> label: {8x1 cell} >> trial: {1x349 cell} >> time: {1x349 cell} >> fsample: 2003 >> cfg: [1x1 struct] >> >> when i run checkdata alone I obtain the message i expect: >> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >> 'hasoffset','yes'); >> the input is raw data with 8 channels and 349 trials >> This error message sounds odd to me as I never had this problem in the >> past. >> I changed to Matlab 2009a in a 64bit win system (Could this info help to >> solve the problem?) >> Any idea? >> Thanks in advance. >> Natalia >> >> >> >> >> ---------------------------------------------------------------- >> SISSA Webmail https://webmail.sissa.it/ >> Powered by SquirrelMail http://www.squirrelmail.org/ >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------------------------------------- SISSA Webmail https://webmail.sissa.it/ Powered by SquirrelMail http://www.squirrelmail.org/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From grion at SISSA.IT Fri May 7 16:43:18 2010 From: grion at SISSA.IT (Natalia Grion) Date: Fri, 7 May 2010 16:43:18 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: Message-ID: I'm being running fieldtrip-20090629, but i also test this problem for a newest version (fieldtrip-20100418) that gave me the same error. I also tried to go into the error to see which is the cause: when inspecting checkdata result on the line israw = datatype(data, 'raw'); gives me israw= 0 which is not the case on my data as it has all the fields and types necessary to be classified as "israw" israw = isfield(data, 'label') && isfield(data, 'time') && isa(data.time, 'cell') && isfield(data, 'trial') && isa(data.trial, 'cell'); I explained before that when running checkdata independently of freqanalysis it works. hope this info also helps, natalia > Adding to Roemer's questions: > > What is the fieldtrip version you are using? > Next to this, it is also insightful/helpful to look into what causes > the error yourself: if you type dbstop if error on the command line, > when the function crashes you end up within the local workspace of the > crashing function, allowing you to investigate the cause of your error. > > Best, > > Jan-Mathijs > > On May 7, 2010, at 4:12 PM, Roemer van der Meij wrote: > >> Hi Natalia, >> >> Could you post the cfg-settings you use when calling ft_freqanalysis >> and the full matlab error output? This will help us track down the >> cause of the error. Also, did you use ft_appenddata for appending >> your recordings or did you do it by hand? >> >> Best, >> Roemer >> >> >> >> >> On 5/7/2010 4:06 PM, Natalia Grion wrote: >>> Dear all, >>> I have this error when running freqanalysis: >>> ??? Error using ==> checkdata at 381 >>> This function requires raw data as input. >>> My data comes from a preprocessing procedure where i just append >>> daily >>> sessions with 8 channel lfp recordings and several trials from the >>> same >>> subject) and it has this shape: >>> >>> hdr: [1x1 struct] >>> label: {8x1 cell} >>> trial: {1x349 cell} >>> time: {1x349 cell} >>> fsample: 2003 >>> cfg: [1x1 struct] >>> >>> when i run checkdata alone I obtain the message i expect: >>> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >>> 'hasoffset','yes'); >>> the input is raw data with 8 channels and 349 trials >>> This error message sounds odd to me as I never had this problem in >>> the past. >>> I changed to Matlab 2009a in a 64bit win system (Could this info >>> help to >>> solve the problem?) >>> Any idea? >>> Thanks in advance. >>> Natalia >>> >>> >>> >>> >>> ---------------------------------------------------------------- >>> SISSA Webmail https://webmail.sissa.it/ >>> Powered by SquirrelMail http://www.squirrelmail.org/ >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> -- >> Roemer van der Meij MSc >> Scientific Programmer& Data-Analyst >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3612631 >> E-mail: r.vandermeij at donders.ru.nl >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. > > Dr. J.M. (Jan-Mathijs) Schoffelen > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > J.Schoffelen at donders.ru.nl > Telephone: 0031-24-3668063 > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------------------------------------- SISSA Webmail https://webmail.sissa.it/ Powered by SquirrelMail http://www.squirrelmail.org/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From recasensmarc at GMAIL.COM Fri May 7 16:59:03 2010 From: recasensmarc at GMAIL.COM (Marc Recasens) Date: Fri, 7 May 2010 16:59:03 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Thanks Jan for the rapid response, I followed the steps using ctf coords and the segmented volume fits perfectly well in the skull using sourceplot. The volume seems to fit better into the headshape. However, as can be seen in the picture, there's still a big space from the posterior part of the brain to the posterior part of the head shape. I suppose this Can be due to a bad realignment (?). As I mentioned, I have no fiducial points in the MRI scans, so I have to select the nas, lpa and rpa with no physical reference. I guess there is no alternative in this case but using another volume or trying to align the volume manually until it fits in the headshape, isn't it? Can the volume segment be aligned in connection to the headshape automatically? thank you for the help! Bests, [image: CTFvolume.jpg] On Fri, May 7, 2010 at 9:01 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Dear Marc, > > It seems to me that there is an issue with the coordinate system in which > your original MRI is expressed. This could be related to the order of the > steps you take, so I would permute the order and see whether this makes any > difference at all (for me it usually works fine as follows:) > > First do a call to ft_volumerealign using your single subject's MRI. This > step should give you the transformation matrix from voxel to headspace > according to CTF's convention (which happens to be the same as 4d). > Then do a segmentation of the output of ft_volumerealign, but note that you > should specify ctf.coordinates = 'ctf'. > Then you can proceed to create the single shell volume conductor model > (after checking whether the segmentation worked fine with respect to the > orientation etc of the resulting volumes; I believe there is some > documentation about this on the website) and plot the results. > > Hopefully this helps, > > Best, > > Jan-Mathijs > > On May 6, 2010, at 8:38 PM, Marc Recasens wrote: > > Hello, > > I'm new in Fieldtrip and I find myself needed of some help :) > I'm currently analysing some MEG data (4D-Neuroimaging, Magnes 2500WH) and > trying to create a Single-Shell headmodel using a segmented mri. > . I've read all the documentation on FT website but I'm still stuck. The > volume never fits in the correct position inside the sensor helmet. > > First of all, I create a segmented MRI using Analyse images (.img'), and > the segmentation is performed using: > cfg.coordinates = 'spm'; > cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates\T1.mnc'; > segmentedmri = ft_volumesegment (cfg, mri); > segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior > volumerealign. > > Then, I do a volumerealign by selecting manually the fiducial points (Nas, > Lpa, Rpa), as I actually don't have fiducials on the MRI scans. > cfg.method = 'realignfiducial'; > cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) > cfg.fiducial.lpa = Lpa; > cfg.fiducial.rpa = Rpa; > segmented_r = ft_volumerealign (cfg, segmentedmri); > > > Finally I create a volume through the ft_prepare_singleshell (cfg, > segmented_r) function and plot it. > I have the fiducials or head position coils and the scalp registered by > means of a Polhemus digitizer.. > Though the segment via ft_sourceplot (doing the: segment.avg.pow = > segment.gray+...) looks right, the headmodelplot shows that the volume and > the headshape don't fit. > > Is there any possibility to realign the segmented mri according either to > the headshape points either to the MEG fiducials? I'm afraid the answer is > no in both cases (as the MRI and MEG coordinates are different). I tried to > realign the segment interactively by selecting the positions where the coils > in the MRI should be... but as the picture shows, it doesn't fit. > am I doing something wrong or skipping some important step? > Is it possible to transform MRI coordinate system to MEG-head coordinate > system? Would it help? > > > > > I attach a picture of what i've managed to do till now! > > > > Thanks for all!!! > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > > ---------------------------------- > > The aim of this list 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/ > > > Dr. J.M. (Jan-Mathijs) Schoffelen > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > J.Schoffelen at donders.ru.nl > Telephone: 0031-24-3668063 > > ---------------------------------- > > The aim of this list 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/ > -- Marc Recasens Tel.: +34 639 24 15 98 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CTFvolume.jpg Type: image/jpeg Size: 28004 bytes Desc: not available URL: From nathanweisz at MAC.COM Fri May 7 17:24:25 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Fri, 7 May 2010 17:24:25 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Dear Marc, we use nutmeg to do co-registration. http://nutmeg.berkeley.edu/index.php?title=Main_Page in a first step we define fiducials manually, similar to volumerealign. in a second step -with the help of a magic button doing "complex things" (or was it stuff)- you can use the headshape to get even some better matching. then from the command line: global nuts st %mri is the MRI structure read into firldtrip with read_fcdc_mri mri.transform=inv(nuts.coreg.meg2mri_tfm)*st.vols{1}.mat; from there on you can continue with your forward modeling as before. good luck, nathan On 07.05.2010, at 16:59, Marc Recasens wrote: > Thanks Jan for the rapid response, > > I followed the steps using ctf coords and the segmented volume fits perfectly well in the skull using sourceplot. The volume seems to fit better into the headshape. However, as can be seen in the picture, there's still a big space from the posterior part of the brain to the posterior part of the head shape. I suppose this Can be due to a bad realignment (?). As I mentioned, I have no fiducial points in the MRI scans, so I have to select the nas, lpa and rpa with no physical reference. I guess there is no alternative in this case but using another volume or trying to align the volume manually until it fits in the headshape, isn't it? Can the volume segment be aligned in connection to the headshape automatically? > > thank you for the help! > > Bests, > > > > > > On Fri, May 7, 2010 at 9:01 AM, jan-mathijs schoffelen wrote: > Dear Marc, > > It seems to me that there is an issue with the coordinate system in which your original MRI is expressed. This could be related to the order of the steps you take, so I would permute the order and see whether this makes any difference at all (for me it usually works fine as follows:) > > First do a call to ft_volumerealign using your single subject's MRI. This step should give you the transformation matrix from voxel to headspace according to CTF's convention (which happens to be the same as 4d). > Then do a segmentation of the output of ft_volumerealign, but note that you should specify ctf.coordinates = 'ctf'. > Then you can proceed to create the single shell volume conductor model (after checking whether the segmentation worked fine with respect to the orientation etc of the resulting volumes; I believe there is some documentation about this on the website) and plot the results. > > Hopefully this helps, > > Best, > > Jan-Mathijs > > On May 6, 2010, at 8:38 PM, Marc Recasens wrote: > >> Hello, >> >> I'm new in Fieldtrip and I find myself needed of some help :) >> I'm currently analysing some MEG data (4D-Neuroimaging, Magnes 2500WH) and trying to create a Single-Shell headmodel using a segmented mri. >> . I've read all the documentation on FT website but I'm still stuck. The volume never fits in the correct position inside the sensor helmet. >> >> First of all, I create a segmented MRI using Analyse images (.img'), and the segmentation is performed using: >> cfg.coordinates = 'spm'; >> cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates\T1.mnc'; >> segmentedmri = ft_volumesegment (cfg, mri); >> segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior volumerealign. >> >> Then, I do a volumerealign by selecting manually the fiducial points (Nas, Lpa, Rpa), as I actually don't have fiducials on the MRI scans. >> cfg.method = 'realignfiducial'; >> cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) >> cfg.fiducial.lpa = Lpa; >> cfg.fiducial.rpa = Rpa; >> segmented_r = ft_volumerealign (cfg, segmentedmri); >> >> >> Finally I create a volume through the ft_prepare_singleshell (cfg, segmented_r) function and plot it. >> I have the fiducials or head position coils and the scalp registered by means of a Polhemus digitizer.. >> Though the segment via ft_sourceplot (doing the: segment.avg.pow = segment.gray+...) looks right, the headmodelplot shows that the volume and the headshape don't fit. >> >> Is there any possibility to realign the segmented mri according either to the headshape points either to the MEG fiducials? I'm afraid the answer is no in both cases (as the MRI and MEG coordinates are different). I tried to realign the segment interactively by selecting the positions where the coils in the MRI should be... but as the picture shows, it doesn't fit. >> am I doing something wrong or skipping some important step? >> Is it possible to transform MRI coordinate system to MEG-head coordinate system? Would it help? >> >> >> >> >> I attach a picture of what i've managed to do till now! >> >> >> >> Thanks for all!!! >> >> >> >> -- >> Marc Recasens >> Tel.: +34 639 24 15 98 >> >> ---------------------------------- >> >> The aim of this list 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/ >> > > Dr. J.M. (Jan-Mathijs) Schoffelen > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > J.Schoffelen at donders.ru.nl > Telephone: 0031-24-3668063 > > ---------------------------------- > > The aim of this list 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/ > > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.doron at GMAIL.COM Sat May 8 19:04:05 2010 From: karl.doron at GMAIL.COM (Karl Doron) Date: Sat, 8 May 2010 19:04:05 +0200 Subject: redefinetrial on freq output Message-ID: Hello, Is it possible to use redefine trial on data from freqanalysis? I need to do the frequency analysis on long segments of data to recover low frequencies, but am interested in comparing one cycle of alpha at two non-overlapping time segments within each trial. Thanks, karl doron ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From nathanweisz at MAC.COM Sat May 8 21:55:23 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Sat, 8 May 2010 21:55:23 +0200 Subject: redefinetrial on freq output In-Reply-To: Message-ID: hi, the documentation of ft_redefinetrial says that it wants the output of preprocessing.m. however, using nearest.m it should be very easy to make your home-made "redefinefreq" function. good luck, nathan On 08.05.2010, at 19:04, Karl Doron wrote: > Hello, > > Is it possible to use redefine trial on data from freqanalysis? I need to do the frequency > analysis on long segments of data to recover low frequencies, but am interested in > comparing one cycle of alpha at two non-overlapping time segments within each trial. > > Thanks, > karl doron > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Mon May 10 09:27:21 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Mon, 10 May 2010 09:27:21 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <58253.147.122.60.164.1273243398.squirrel@webmail.sissa.it> Message-ID: Hi Natalia, Thanks for all the extra information, that really helps in getting to the bottom of the bug. I still can't see any reason though why you should get the errors you're getting. Could you perhaps append a small bit of the data (e.g. 2 or 3 trials, a few MB's max) so I can track the data as it goes through the code using the settings you already provided? Best, Roemer On 5/7/2010 4:43 PM, Natalia Grion wrote: > I'm being running fieldtrip-20090629, but i also test this problem for a > newest version (fieldtrip-20100418) that gave me the same error. I also > tried to go into the error to see which is the cause: when inspecting > checkdata result on the line > israw = datatype(data, 'raw'); > gives me israw= 0 > which is not the case on my data as it has all the fields and types > necessary to be classified as "israw" > israw = isfield(data, 'label')&& isfield(data, 'time')&& > isa(data.time, 'cell')&& isfield(data, 'trial')&& isa(data.trial, > 'cell'); > I explained before that when running checkdata independently of > freqanalysis it works. > hope this info also helps, > natalia > > > >> Adding to Roemer's questions: >> >> What is the fieldtrip version you are using? >> Next to this, it is also insightful/helpful to look into what causes >> the error yourself: if you type dbstop if error on the command line, >> when the function crashes you end up within the local workspace of the >> crashing function, allowing you to investigate the cause of your error. >> >> Best, >> >> Jan-Mathijs >> >> On May 7, 2010, at 4:12 PM, Roemer van der Meij wrote: >> >> >>> Hi Natalia, >>> >>> Could you post the cfg-settings you use when calling ft_freqanalysis >>> and the full matlab error output? This will help us track down the >>> cause of the error. Also, did you use ft_appenddata for appending >>> your recordings or did you do it by hand? >>> >>> Best, >>> Roemer >>> >>> >>> >>> >>> On 5/7/2010 4:06 PM, Natalia Grion wrote: >>> >>>> Dear all, >>>> I have this error when running freqanalysis: >>>> ??? Error using ==> checkdata at 381 >>>> This function requires raw data as input. >>>> My data comes from a preprocessing procedure where i just append >>>> daily >>>> sessions with 8 channel lfp recordings and several trials from the >>>> same >>>> subject) and it has this shape: >>>> >>>> hdr: [1x1 struct] >>>> label: {8x1 cell} >>>> trial: {1x349 cell} >>>> time: {1x349 cell} >>>> fsample: 2003 >>>> cfg: [1x1 struct] >>>> >>>> when i run checkdata alone I obtain the message i expect: >>>> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >>>> 'hasoffset','yes'); >>>> the input is raw data with 8 channels and 349 trials >>>> This error message sounds odd to me as I never had this problem in >>>> the past. >>>> I changed to Matlab 2009a in a 64bit win system (Could this info >>>> help to >>>> solve the problem?) >>>> Any idea? >>>> Thanks in advance. >>>> Natalia >>>> >>>> >>>> >>>> >>>> ---------------------------------------------------------------- >>>> SISSA Webmail https://webmail.sissa.it/ >>>> Powered by SquirrelMail http://www.squirrelmail.org/ >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between users >>>> of the FieldTrip toolbox, to share experiences and to discuss new >>>> ideas for MEG and EEG analysis. See also >>>> http://listserv.surfnet.nl/archives/fieldtrip.html >>>> and http://www.ru.nl/neuroimaging/fieldtrip. >>>> >>>> >>> -- >>> Roemer van der Meij MSc >>> Scientific Programmer& Data-Analyst >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognition >>> P.O. Box 9104 >>> 6500 HE Nijmegen >>> The Netherlands >>> Tel: +31(0)24 3612631 >>> E-mail: r.vandermeij at donders.ru.nl >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> Dr. J.M. (Jan-Mathijs) Schoffelen >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> J.Schoffelen at donders.ru.nl >> Telephone: 0031-24-3668063 >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > > ---------------------------------------------------------------- > SISSA Webmail https://webmail.sissa.it/ > Powered by SquirrelMail http://www.squirrelmail.org/ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From tadel at USC.EDU Mon May 10 22:55:42 2010 From: tadel at USC.EDU (=?ISO-8859-1?Q?Fran=E7ois_Tadel?=) Date: Mon, 10 May 2010 13:55:42 -0700 Subject: Engineer position at USC, Los Angeles, January 2011 Message-ID: Dear all, Below is the description of a position opening at USC, Los Angeles, in January 2011. Thanks for spreading the word. Francois Tadel ------------------------------------------------------------------------ Research Programmer, University of Southern California, Los Angeles, USA The Department of Electrical Engineering at the University of Southern California is seeking a research programmer to participate in the development, distribution and support of software for functional brain mapping. The programmer will be responsible for implementing software for all phases of the analysis of magnetoencephalograpy (MEG) and electroencephalography (EEG) data and its integration of other functional and structural imaging modalities. The resulting software, which will be developed under grant support from the National Institutes of Health, will be distributed to researchers throughout the US and the rest of the world, for analysis of data collected in cognitive neuroscience and clinical research studies. This project will be conducted under the supervision of Professor Richard Leahy in the Department of Electrical Engineering and will involve close collaboration with researchers at USC and other institutions. Responsibilities * Play a leading role in developing common workflow, data structures, and file formats for use in analysis of MEG and EEG data. * Develop and document code to implement algorithms for analysis and display of M/EEG data. * Development of procedures for automated testing of software and software updates. * Develop and support procedures for distribution and documentation of new software. * Participate in training of users * Participate in research meetings and interact with PhD students, postdocs and research faculty in Dr. Leahy's lab in the development of new approaches to the analysis of MEG and EEG data. * Work with collaborators who are also developing software to facilitate interoperability between software packages with the ultimate goal of producing a single software package for EEG and MEG data analysis. * More information about Brainstorm, the existing software package: http://neuroimage.usc.edu/brainstorm Minimum qualifications * Masters Degree in Computer Science or Electrical Engineering * 2 years post graduate experience * Knowledge of the basic principles underlying EEG and MEG signal processing * Programming experience with Matlab and Java Conditions of employment * Starting from January 2011 * Duration: position available for a minimum of two years * Salary: depends on experience and qualifications * USC has excellent benefits, including health benefits and retirement plans with employer contributions after six months. * The University of Southern California values diversity and is committed to equal opportunity in employment. Application * To apply, please send an email to Francois Tadel, main developer of the Brainstorm software: tadel at usc.edu. * Your application should include: your CV, a description of your programming skills, a detailed description of your previous software development projects. * Application deadline: Open until filled. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aardesta at UCLA.EDU Thu May 13 00:44:42 2010 From: aardesta at UCLA.EDU (Allen Ardestani) Date: Wed, 12 May 2010 15:44:42 -0700 Subject: Error in timelockstatistics Message-ID: Hi everyone, I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: method: 'montecarlo' statistic: 'indepsamplesT' correctm: 'cluster' clusteralpha: 0.0500 clusterstatistic: 'maxsum' tail: 0 clustertail: 0 alpha: 0.0250 numrandomization: 100 design: [1x267 double] channel: 'F1' minnbchan: 0 layout: 'layout.mat' ivar: 1 I get the following error message: ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. Error in ==> findcluster at 89 [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); Error in ==> clusterstat at 194 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> statistics_montecarlo at 321 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 285 [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); Error in ==> ft_timelockstatistics at 96 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I'm assuming that part of the problem is that I don't have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I'm a new user, so any advice is much appreciated. Thanks in advance! ____________________________________________________________________________ ______ Allen Ardestani Email: aardesta at ucla.edu Phone: (310) 825-5528 Medical Scientist Training Program David Geffen School of Medicine at UCLA Semel Institute for Neuroscience and Human Behavior 760 Westwood Plaza Los Angeles, CA 90095-1759 USA ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at MAC.COM Thu May 13 10:21:45 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Thu, 13 May 2010 10:21:45 +0200 Subject: Error in timelockstatistics In-Reply-To: <000c01caf224$b705de40$25119ac0$@edu> Message-ID: Dear Allen, you need bwlabeln anyhow, no matter how you want to cluster (the function can cluster in n-dimensions). so getting the Image Processing Toolbox may be a good investment if you decide to use fieldtrip statistics in future. an -untested- alternative may be to use the octave version of bwlabeln. usually the code is very compatible to matlab, i.e. if it does not run out-of-the-box it usually just needs a little tweaking. however it may be a lot slower. http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/image/bwlabel.m http://www.gnu.org/software/octave/index.html good luck, nathan On 13.05.2010, at 00:44, Allen Ardestani wrote: > Hi everyone, > I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: > > method: 'montecarlo' > statistic: 'indepsamplesT' > correctm: 'cluster' > clusteralpha: 0.0500 > clusterstatistic: 'maxsum' > tail: 0 > clustertail: 0 > alpha: 0.0250 > numrandomization: 100 > design: [1x267 double] > channel: 'F1' > minnbchan: 0 > layout: 'layout.mat' > ivar: 1 > > > I get the following error message: > > ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. > > Error in ==> findcluster at 89 > [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); > > Error in ==> clusterstat at 194 > posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); > > Error in ==> statistics_montecarlo at 321 > [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); > > Error in ==> statistics_wrapper at 285 > [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); > > Error in ==> ft_timelockstatistics at 96 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > I’m assuming that part of the problem is that I don’t have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I’m a new user, so any advice is much appreciated. > > Thanks in advance! > __________________________________________________________________________________ > Allen Ardestani Email: aardesta at ucla.edu > Phone: (310) 825-5528 > Medical Scientist Training Program > David Geffen School of Medicine at UCLA > Semel Institute for Neuroscience and Human Behavior > 760 Westwood Plaza > Los Angeles, CA 90095-1759 > USA > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From teristam at GMAIL.COM Wed May 19 05:59:16 2010 From: teristam at GMAIL.COM (teris tam) Date: Wed, 19 May 2010 11:59:16 +0800 Subject: Some suggestion for improving performance in reading buffer event in ft_read_event Message-ID: Dear all, When I am profiling the performance of reading buffer event in ft_read_event, in around line 710, I see the following code causing a performance neck: for i=1:length(evt) % convert the field "type" into the Matlab representation this_type = type{evt(i).type_type+1}; this_size = wordsize{evt(i).type_type+1} * evt(i).type_numel; sel = 1:this_size; if strcmp(this_type, 'char') event(i).type = char(evt(i).buf(sel)); else event(i).type = typecast(evt(i).buf(sel), this_type); end . . . end If I understand correctly, what the code is currently doing is to read a maximum of 100 events (the number 100 was obtained from my observation when the code was running) from the buffer and then typcast all of them. Filtering of the event is then done by ft_filter_event. However, event(i) is growing inside a loop and has significant negative impact on performance. The impact is even larger in real-time processing because very often we need to keep polling the event information from the buffer. In most of the case, reading such a large number of event to search for the required event type is not necessary because there is only a handful of states in the experimental paradigm. So I suggest we add a "maxsearch" option to let the user set how many total events they want to read from the buffer to search for the required event: *In ft_read_event, after:* flt_mintimestamp = keyval('mintimestamp', varargin); flt_maxtimestamp = keyval('maxtimestamp', varargin); flt_minnumber = keyval('minnumber', varargin); flt_maxnumber = keyval('maxnumber', varargin); *add:* flt_maxsearch = keyval('maxsearch',varargin); *then around line 710, before:* for i=1:length(evt) % convert the field "type" into the Matlab representation this_type = type{evt(i).type_type+1}; this_size = wordsize{evt(i).type_type+1} * evt(i).type_numel; sel = 1:this_size; if strcmp(this_type, 'char') event(i).type = char(evt(i).buf(sel)); else event(i).type = typecast(evt(i).buf(sel), this_type); end . . . end *add:* if(~isempty(flt_maxsearch)) evt=evt((end-flt_maxsearch+1):end); end I have done some profiling and it does improve the performance. Hope that helps. Best regards, Teris ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fraschini at UNICA.IT Wed May 19 15:51:51 2010 From: fraschini at UNICA.IT (Matteo Fraschini) Date: Wed, 19 May 2010 15:51:51 +0200 Subject: Clusterplot problem Message-ID: Dear all, I am currently working on a study involving Activation vs Baseline paradigm on MEG data. By using FT preprocessing, analysis and plotting functions I really can see what I expected to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation tests on time-frequency data following the web tutorial. The analysis shows significative cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with ft_clusterplot) is significative cluster but in region/channels with no frequency differences from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference is more evident. Looks like channels are not correctly placed in the plot. Any suggestions? Thank you very much, Matteo ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jan.schoffelen at DONDERS.RU.NL Wed May 19 16:37:06 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Wed, 19 May 2010 16:37:06 +0200 Subject: use of spm within fieldtrip Message-ID: Dear all, I just made some changes to the fieldtrip code relating to the spm- version used for spatial normalisation, segmentation and smoothing. These changes affect the functions ft_volumesegment, ft_volumenormalise and ft_volumedownsample. Up until now, fieldtrip relied on spm2 to do the morphological operations on anatomical MRIs (and actually crashed when trying to use spm8). I changed the default spm-version to be used into spm8. This means that in order for this to work you need spm8 on your matlab path. People who would prefer to keep using spm2 for spatial normalisation and segmentation should specify cfg.spmversion = 'spm2' before calling ft_volumenormalise or ft_volumesegment. Cheers, Jan-Mathijs Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Thu May 20 10:24:07 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Thu, 20 May 2010 10:24:07 +0200 Subject: Clusterplot problem In-Reply-To: Message-ID: Hi Matteo, What FieldTrip version are you using? There have been some changes in the past few months in the functions you use. Could you post all the cfg-settings you used (from statistical analysis onwards)? Best, Roemer On 5/19/2010 3:51 PM, wrote: > Dear all, > I am currently working on a study involving Activation vs Baseline paradigm on MEG data. > By using FT preprocessing, analysis and plotting functions I really can see what I expected > to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation > tests on time-frequency data following the web tutorial. The analysis shows significative > cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with > ft_clusterplot) is significative cluster but in region/channels with no frequency differences > from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference > is more evident. Looks like channels are not correctly placed in the plot. > Any suggestions? > Thank you very much, > Matteo > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From karl.doron at GMAIL.COM Thu May 20 20:41:09 2010 From: karl.doron at GMAIL.COM (Karl Doron) Date: Thu, 20 May 2010 20:41:09 +0200 Subject: averaging Hilbert amplitudes Message-ID: Hello, I wonder if anyone can help me understand (or point me to a reference) the practical consequences of getting the analytic amplitudes of individual trials and then averaging those vs. averaging band pass filtered data, and then getting the analytic amplitude. Many thanks, karl doron ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From adrian.m.bartlett at GMAIL.COM Thu May 20 20:53:35 2010 From: adrian.m.bartlett at GMAIL.COM (Adrian Bartlett) Date: Thu, 20 May 2010 14:53:35 -0400 Subject: averaging Hilbert amplitudes In-Reply-To: Message-ID: Hi Karl, In short, the former method gives you a mixture of time-locked power changes and and the inter-trial phase coherence, since departures from perfect phase locking will attenuate the amplitude of the average of your trials in the time domain. Taking the hilbert amplitude envelope of single trials and then averaging will yield the closest we can get the 'induced' response, or time-locked power changes. To reiterate, averaging in the time domain confounds power changes and phase differences between trials. A good paper that touches on these topics is Makeig et al. (2004) "Mining event-related brain dynamics". I'm sure my comments on single-trial power as the 'induced' response will cause a stir here, and if you look in the archives there are extensive past discussions on the topic of isolating the 'induced' response from the 'evoked' (phase-locked) Hope that helps some, - Adrian M. Bartlett Department of Psychology (MA Candidate) Neuroscience Graduate Diploma Program Perception & Plasticity Laboratory Centre for Vision Research York University http://www.yorku.ca/~khoffman/ On Thu, May 20, 2010 at 2:41 PM, Karl Doron wrote: > Hello, > > I wonder if anyone can help me understand (or point me to a reference) the > practical > consequences of getting the analytic amplitudes of individual trials and > then averaging those > vs. averaging band pass filtered data, and then getting the analytic > amplitude. > > Many thanks, > karl doron > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fraschini at UNICA.IT Fri May 21 13:09:21 2010 From: fraschini at UNICA.IT (Matteo Fraschini) Date: Fri, 21 May 2010 13:09:21 +0200 Subject: Clusterplot problem In-Reply-To: <4BF4F1A7.30203@donders.ru.nl> Message-ID: Hi Roemer, I tried using the last FT version with same results. This is the code for statistic: function [stat]=withinSubjs(GA_act,GA_bl) cfg = []; cfg.channel = {'MEG','-MLT22','-MLT27','-MLO42','-MLO43','-MRT22','-MRT27','-MRO42','-MRO43'}; cfg.frequency = [4 7]; cfg.avgovertime = 'yes'; cfg.avgoverfreq = 'yes'; cfg.method = 'montecarlo'; cfg.statistic = 'actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg.numrandomization = 500; n_subjs=size(GA_act.powspctrm); n_subjs=n_subjs(1); design = zeros(2,2*n_subjs); for i = 1:n_subjs design(1,i) = i; end for i = 1:n_subjs design(1,n_subjs+i) = i; end design(2,1:n_subjs) = 1; design(2,n_subjs+1:2*n_subjs) = 2; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; stat = ft_freqstatistics(cfg,GA_act,GA_bl) You can see the ft_topoplot (with absolute baseline correction) and ft_clusterplot (same time) figures here: http://192.167.154.14/ft/topo.jpg http://192.167.154.14/ft/cluster.jpg I also tried using 'ctf_old' specification when preprocessing my data but an error occurs in ft_megplanar: ??? Index exceeds matrix dimensions. Error in ==> channelposition at 53 sens.pnt = sens.pnt(used,:); Error in ==> megplanar_sincos at 26 [pnt, ori, lab] = channelposition(grad); Any suggestion? Thank you very much, Matteo Il giorno 20/mag/2010, alle ore 10.24, Roemer van der Meij ha scritto: > Hi Matteo, > > What FieldTrip version are you using? There have been some changes in the past few months in the functions you use. > Could you post all the cfg-settings you used (from statistical analysis onwards)? > > Best, > Roemer > > > On 5/19/2010 3:51 PM, wrote: >> Dear all, >> I am currently working on a study involving Activation vs Baseline paradigm on MEG data. >> By using FT preprocessing, analysis and plotting functions I really can see what I expected >> to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation >> tests on time-frequency data following the web tutorial. The analysis shows significative >> cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with >> ft_clusterplot) is significative cluster but in region/channels with no frequency differences >> from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference >> is more evident. Looks like channels are not correctly placed in the plot. >> Any suggestions? >> Thank you very much, >> Matteo >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Fri May 21 13:21:00 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Fri, 21 May 2010 13:21:00 +0200 Subject: Problem with brainvision files Message-ID: Hi fildtrippers! After I've updated fieldtrip I got some problems reading brainvision files I didn't got before. Here are the errors (the only differences in this script are ft_definetrial and ft_preprocessing that before were only definetrial and preprocessing): cfg=[]; cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; cfg.trialdef.eventtype='Stimulus'; cfg.trialdef.eventvalue='S 55'; cfg.trialdef.prestim=2; cfg.trialdef.poststim=1.999; cfg=ft_definetrial(cfg); data=ft_preprocessing(cfg); Warning: no trialfun was specified, using trialfun_general > In ft_definetrial at 95 evaluating trialfunction 'trialfun_general' reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' found 256 events created 41 trials processing channel { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } reading and preprocessing reading and preprocessing trial 1 from 41 Warning: could not open L001_Artifact_Rejection_FeedPos_Bl_1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 390 In ft_read_data at 205 In ft_preprocessing at 466 Warning: could not open L001_Artifact_Rejection_FeedPos_Bl_1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 395 In ft_read_data at 205 In ft_preprocessing at 466 ??? Error using ==> fseek Invalid file identifier. Use fopen to generate a valid file identifier. Error in ==> read_brainvision_eeg at 52 fseek(fid, hdr.NumberOfChannels*4*(begsample-1), 'cof'); Error in ==> ft_read_data at 442 dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample); Error in ==> ft_preprocessing at 466 dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) If I'm trying to use another file that is an average (so no trial to select) and I treat as a continous file I got these other problems: cfg=[]; cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; data=ft_preprocessing(cfg); Warning: cannot determine number of samples for this sub-fileformat > In fileio\private\read_brainvision_vhdr at 95 In ft_read_header at 367 In ft_preprocessing at 294 processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } reading and preprocessing reading and preprocessing trial 1 from 1 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 390 In ft_read_data at 205 In ft_preprocessing at 466 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 395 In ft_read_data at 205 In ft_preprocessing at 466 ??? Error using ==> zeros NaN and Inf not allowed. Error in ==> read_brainvision_eeg at 76 dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); Error in ==> ft_read_data at 442 dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample); Error in ==> ft_preprocessing at 466 dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) do I miss something? regards Marco ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri May 21 14:55:21 2010 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 21 May 2010 13:55:21 +0100 Subject: Problem with brainvision files In-Reply-To: Message-ID: Hi Marco, I've done some changes recently trying to improve the recognition of Brainvision files. These might or might not be related to your problem. Could you perhaps do: dbstop if error and try to get some idea about why the error in filetype_check_header happens. There is some problem with opening the .eeg file but it's not clear what it is. I tried to use code similar to yours on a different brainvision dataset and there is no problem so it may be something that happens on your system for some reason. If you can't figure it out, send me an example dataset via yousendit.com and I'll try to look at it. Best, Vladimir On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: > Hi fildtrippers! > After I've updated fieldtrip I got some problems reading brainvision files I didn't > got before. > > Here are the errors (the only differences in this script are ft_definetrial and > ft_preprocessing that before were only definetrial and preprocessing): > > cfg=[]; > cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; > cfg.trialdef.eventtype='Stimulus'; > cfg.trialdef.eventvalue='S 55'; > cfg.trialdef.prestim=2; > cfg.trialdef.poststim=1.999; > cfg=ft_definetrial(cfg); > data=ft_preprocessing(cfg); > > Warning: no trialfun was specified, using > trialfun_general >> In ft_definetrial at 95 > evaluating trialfunction 'trialfun_general' > reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' > found 256 events > created 41 trials > processing channel > { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' > TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } > reading and preprocessing > reading and preprocessing trial 1 from 41 > Warning: could not open > L001_Artifact_Rejection_FeedPos_Bl_1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 390 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > Warning: could not open > L001_Artifact_Rejection_FeedPos_Bl_1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 395 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > ??? Error using ==> fseek > Invalid file identifier.  Use fopen to generate a valid > file identifier. > > Error in ==> read_brainvision_eeg at 52 >  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >  'cof'); > > Error in ==> ft_read_data at 442 >    dat = read_brainvision_eeg(filename, hdr.orig, >    begsample, endsample); > > Error in ==> ft_preprocessing at 466 >      dat = ft_read_data(cfg.datafile, 'header', hdr, >      'begsample', begsample, 'endsample', endsample, >      'chanindx', rawindx, 'checkboundary', >      strcmp(cfg.continuous, 'no'), 'dataformat', >      cfg.dataformat) > > > If I'm trying to use another file that is an average (so no trial to select) and I > treat as a continous file I got these other problems: > > cfg=[]; > cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; > data=ft_preprocessing(cfg); > Warning: cannot determine number of samples for this > sub-fileformat >> In fileio\private\read_brainvision_vhdr at 95 >  In ft_read_header at 367 >  In ft_preprocessing at 294 > processing channel > { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 > ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } > reading and preprocessing > reading and preprocessing trial 1 from 1 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 390 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 395 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > ??? Error using ==> zeros > NaN and Inf not allowed. > > Error in ==> read_brainvision_eeg at 76 >  dat = zeros(endsample-begsample+1, >  hdr.NumberOfChannels); > > Error in ==> ft_read_data at 442 >    dat = read_brainvision_eeg(filename, hdr.orig, >    begsample, endsample); > > Error in ==> ft_preprocessing at 466 >      dat = ft_read_data(cfg.datafile, 'header', hdr, >      'begsample', begsample, 'endsample', endsample, >      'chanindx', rawindx, 'checkboundary', >      strcmp(cfg.continuous, 'no'), 'dataformat', >      cfg.dataformat) > > do I miss something? > > regards > > Marco > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From gauthierb.ens at GMAIL.COM Fri May 21 16:14:39 2010 From: gauthierb.ens at GMAIL.COM (Baptiste Gauthier) Date: Fri, 21 May 2010 16:14:39 +0200 Subject: Recent update for volume handling Message-ID: Dear Fieldtrip users, I recently try to use the tutorial for creating normalized grid in a purpose of source reconstruction for Neuromag data. It used to work fine, but recently, the segmentation step seems to produce odd results. I have to precise that I changed parameters relative to recent update of volume handling fonction that are now using SPM8. So I wonder If this tutorial stay compatible to this recent update. Has someone experimented the same problems? Best regards, Baptiste Gauthier ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grayseg_SPM8.png Type: image/png Size: 250884 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: whiteseg_SPM8.png Type: image/png Size: 256368 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: csfseg_SPM8.png Type: image/png Size: 198483 bytes Desc: not available URL: From gordon at CCS.FAU.EDU Fri May 21 20:50:46 2010 From: gordon at CCS.FAU.EDU (Reyna L. Gordon) Date: Fri, 21 May 2010 13:50:46 -0500 Subject: issue with cfg.interplimits Message-ID: Dear Fieldtrippers, I am having an issue with creating topoplots of time-frequency data acquired on an EGI system and processed in Fieldtrip, and I was wondering if anyone could help. Everything works great (this toolbox has been wonderful to use in general!) except that the colors that represent power are not interpolating to electrodes that are lower than the origin. Unfortunately, using the default option for cfg.projection = 'orthographic' for ft_prepare_layout, seems to greatly distort the layout for these data, probably because I have too few electrodes. A better option for me seems to be cfg.projection = 'polar', and I am fine with those few electrodes appearing outside of the head. However, the data corresponding to those electrodes is not there - I suspect that there is a problem at the level of cfg.interplimits. This is the code I'm using: cfg = []; cfg.rotate = 0; cfg.projection = 'polar'; newlay=ft_prepare_layout(cfg, bin1); cfg = []; cfg.layout = newlay; cfg.yparam = 'freq'; cfg.xlim= [0.150 0.150]; cfg.ylim= [13 30]; cfg.zlim = [-0.10 0.10]; cfg.highlight = 'on'; cfg.baseline = 'no'; cfg.commentpos = 'title'; cfg.shading = 'interp'; cfg.interplimits = 'electrodes'; %Should work here? cfg.style = 'straight'; cfg.zparam = 'powspctrm'; cfg.fontsize = 12; cfg.gridscale = 100; ft_topoplotTFR(cfg, bin1); According to the documentation, specifying cfg.interplimits = 'electrodes' should achieve what I want here, but it still does not interpolate the plot outside of the head. Attached are some images generated with different cfg.interplimits and cfg.projection options. I have tried upgrading to the most recent release of FT, but it doesn't change the outcome. Any and all insight would be greatly appreciated. Best, Reyna ----------------------- Reyna L. Gordon PhD Candidate Center for Complex Systems & Brain Sciences Florida Atlantic University gordon at ccs.fau.edu ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: polar_head.jpg Type: image/jpeg Size: 23385 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sopro_new_montage_noCz.sfp Type: application/octet-stream Size: 1532 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: orthographic.jpg Type: image/jpeg Size: 21647 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: polar_electrodes.jpg Type: image/jpeg Size: 22977 bytes Desc: not available URL: -------------- next part -------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Sat May 22 12:48:46 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Sat, 22 May 2010 12:48:46 +0200 Subject: Problem with brainvision files In-Reply-To: Message-ID: I've tried to set a brackpoint but stoped at line 76 of read_brainvision_eeg Maybe I exported them in a wrog way? Marco 2010/5/21 Vladimir Litvak : >  Hi Marco, > > I've done some changes recently trying to improve the recognition of > Brainvision files. These might or might not be related to your > problem. Could you perhaps do: > > dbstop if error > > and try to get some idea about why the error in filetype_check_header > happens. There is some problem with opening the .eeg file but it's not > clear what it is. I tried to use code similar to yours on a different > brainvision dataset and there is no problem so it may be something > that happens on your system for some reason. If you can't figure it > out, send me an example dataset via yousendit.com and I'll try to look > at it. > > Best, > > Vladimir > > On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >> Hi fildtrippers! >> After I've updated fieldtrip I got some problems reading brainvision files I didn't >> got before. >> >> Here are the errors (the only differences in this script are ft_definetrial and >> ft_preprocessing that before were only definetrial and preprocessing): >> >> cfg=[]; >> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >> cfg.trialdef.eventtype='Stimulus'; >> cfg.trialdef.eventvalue='S 55'; >> cfg.trialdef.prestim=2; >> cfg.trialdef.poststim=1.999; >> cfg=ft_definetrial(cfg); >> data=ft_preprocessing(cfg); >> >> Warning: no trialfun was specified, using >> trialfun_general >>> In ft_definetrial at 95 >> evaluating trialfunction 'trialfun_general' >> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >> found 256 events >> created 41 trials >> processing channel >> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 41 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> fseek >> Invalid file identifier.  Use fopen to generate a valid >> file identifier. >> >> Error in ==> read_brainvision_eeg at 52 >>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>  'cof'); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> >> If I'm trying to use another file that is an average (so no trial to select) and I >> treat as a continous file I got these other problems: >> >> cfg=[]; >> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >> data=ft_preprocessing(cfg); >> Warning: cannot determine number of samples for this >> sub-fileformat >>> In fileio\private\read_brainvision_vhdr at 95 >>  In ft_read_header at 367 >>  In ft_preprocessing at 294 >> processing channel >> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 1 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> zeros >> NaN and Inf not allowed. >> >> Error in ==> read_brainvision_eeg at 76 >>  dat = zeros(endsample-begsample+1, >>  hdr.NumberOfChannels); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> do I miss something? >> >> regards >> >> Marco >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Sat May 22 12:52:04 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Sat, 22 May 2010 12:52:04 +0200 Subject: Problem with brainvision files In-Reply-To: Message-ID: Sorry... I maybe you could have a better idea with the errors ;-) >> dbstop if error >> cfg=[]; cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; data=ft_preprocessing(cfg); Warning: cannot determine number of samples for this sub-fileformat > In fileio\private\read_brainvision_vhdr at 95 In ft_read_header at 367 In ft_preprocessing at 294 processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } reading and preprocessing reading and preprocessing trial 1 from 1 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 390 In ft_read_data at 205 In ft_preprocessing at 466 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 395 In ft_read_data at 205 In ft_preprocessing at 466 ??? Error using ==> zeros NaN and Inf not allowed. Error in ==> read_brainvision_eeg at 76 dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); Error in ==> ft_read_data at 442 dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample); Error in ==> ft_preprocessing at 466 dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) 76 dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); K>> read_brainvision_eeg ??? Input argument "hdr" is undefined. Error in ==> read_brainvision_eeg at 32 if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') 32 if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') K>> Maybe the problem is about the multiplexed so the way I exported the data? 2010/5/21 Vladimir Litvak : >  Hi Marco, > > I've done some changes recently trying to improve the recognition of > Brainvision files. These might or might not be related to your > problem. Could you perhaps do: > > dbstop if error > > and try to get some idea about why the error in filetype_check_header > happens. There is some problem with opening the .eeg file but it's not > clear what it is. I tried to use code similar to yours on a different > brainvision dataset and there is no problem so it may be something > that happens on your system for some reason. If you can't figure it > out, send me an example dataset via yousendit.com and I'll try to look > at it. > > Best, > > Vladimir > > On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >> Hi fildtrippers! >> After I've updated fieldtrip I got some problems reading brainvision files I didn't >> got before. >> >> Here are the errors (the only differences in this script are ft_definetrial and >> ft_preprocessing that before were only definetrial and preprocessing): >> >> cfg=[]; >> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >> cfg.trialdef.eventtype='Stimulus'; >> cfg.trialdef.eventvalue='S 55'; >> cfg.trialdef.prestim=2; >> cfg.trialdef.poststim=1.999; >> cfg=ft_definetrial(cfg); >> data=ft_preprocessing(cfg); >> >> Warning: no trialfun was specified, using >> trialfun_general >>> In ft_definetrial at 95 >> evaluating trialfunction 'trialfun_general' >> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >> found 256 events >> created 41 trials >> processing channel >> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 41 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> fseek >> Invalid file identifier.  Use fopen to generate a valid >> file identifier. >> >> Error in ==> read_brainvision_eeg at 52 >>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>  'cof'); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> >> If I'm trying to use another file that is an average (so no trial to select) and I >> treat as a continous file I got these other problems: >> >> cfg=[]; >> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >> data=ft_preprocessing(cfg); >> Warning: cannot determine number of samples for this >> sub-fileformat >>> In fileio\private\read_brainvision_vhdr at 95 >>  In ft_read_header at 367 >>  In ft_preprocessing at 294 >> processing channel >> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 1 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> zeros >> NaN and Inf not allowed. >> >> Error in ==> read_brainvision_eeg at 76 >>  dat = zeros(endsample-begsample+1, >>  hdr.NumberOfChannels); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> do I miss something? >> >> regards >> >> Marco >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From sklein at BERKELEY.EDU Sat May 22 13:17:11 2010 From: sklein at BERKELEY.EDU (Stanley Klein) Date: Sat, 22 May 2010 04:17:11 -0700 Subject: Filters local in time while rejecting low frequencies Message-ID: Dear Fieldtrip, We would like to do time-frequency plots using filters that are quite local in time (less than about 2 cycles) and yet have relatively low sensitivity to low temporal frequencies. For example, filters defined on log frequency might do the job in being insensitive to low frequencies, but are they sufficiently local in time? thanks, Stan Klein ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.litvak at ION.UCL.AC.UK Sat May 22 22:49:49 2010 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Sat, 22 May 2010 21:49:49 +0100 Subject: Problem with brainvision files In-Reply-To: Message-ID: Hi Marco, There are two separate problems. One has to do with my mistake and one doesn't. The problem with the example you sent me is indeed that the data is ASCII multiplexed. I suggest that you export the data as binary. The second problem was introduced by my fix and I hope that it'll be fixed if you put the attached file in fileio. I also checked it in. Let me know if you still have problems. Best, Vladimir On Sat, May 22, 2010 at 11:52 AM, Marco Rotonda wrote: > Sorry... > I maybe you could have a better idea with the errors ;-) > >>> dbstop if error >>> cfg=[]; > cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; > data=ft_preprocessing(cfg); > Warning: cannot determine number of samples for this > sub-fileformat >> In fileio\private\read_brainvision_vhdr at 95 >  In ft_read_header at 367 >  In ft_preprocessing at 294 > processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' > 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' > 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } > reading and preprocessing > reading and preprocessing trial 1 from 1 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 390 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 395 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > ??? Error using ==> zeros > NaN and Inf not allowed. > > Error in ==> read_brainvision_eeg at 76 >  dat = zeros(endsample-begsample+1, >  hdr.NumberOfChannels); > > Error in ==> ft_read_data at 442 >    dat = read_brainvision_eeg(filename, hdr.orig, >    begsample, endsample); > > Error in ==> ft_preprocessing at 466 >      dat = ft_read_data(cfg.datafile, 'header', hdr, >      'begsample', begsample, 'endsample', endsample, >      'chanindx', rawindx, 'checkboundary', >      strcmp(cfg.continuous, 'no'), 'dataformat', >      cfg.dataformat) > 76    dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); > K>> read_brainvision_eeg > ??? Input argument "hdr" is undefined. > > Error in ==> read_brainvision_eeg at 32 > if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, > 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') > > 32  if strcmpi(hdr.DataFormat, 'binary') && > strcmpi(hdr.DataOrientation, 'multiplexed') && > strcmpi(hdr.BinaryFormat, 'int_16') > K>> > > > Maybe the problem is about the multiplexed so the way I exported the data? > > > > 2010/5/21 Vladimir Litvak : >>  Hi Marco, >> >> I've done some changes recently trying to improve the recognition of >> Brainvision files. These might or might not be related to your >> problem. Could you perhaps do: >> >> dbstop if error >> >> and try to get some idea about why the error in filetype_check_header >> happens. There is some problem with opening the .eeg file but it's not >> clear what it is. I tried to use code similar to yours on a different >> brainvision dataset and there is no problem so it may be something >> that happens on your system for some reason. If you can't figure it >> out, send me an example dataset via yousendit.com and I'll try to look >> at it. >> >> Best, >> >> Vladimir >> >> On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >>> Hi fildtrippers! >>> After I've updated fieldtrip I got some problems reading brainvision files I didn't >>> got before. >>> >>> Here are the errors (the only differences in this script are ft_definetrial and >>> ft_preprocessing that before were only definetrial and preprocessing): >>> >>> cfg=[]; >>> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >>> cfg.trialdef.eventtype='Stimulus'; >>> cfg.trialdef.eventvalue='S 55'; >>> cfg.trialdef.prestim=2; >>> cfg.trialdef.poststim=1.999; >>> cfg=ft_definetrial(cfg); >>> data=ft_preprocessing(cfg); >>> >>> Warning: no trialfun was specified, using >>> trialfun_general >>>> In ft_definetrial at 95 >>> evaluating trialfunction 'trialfun_general' >>> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >>> found 256 events >>> created 41 trials >>> processing channel >>> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >>> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>> reading and preprocessing >>> reading and preprocessing trial 1 from 41 >>> Warning: could not open >>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 390 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> Warning: could not open >>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 395 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> ??? Error using ==> fseek >>> Invalid file identifier.  Use fopen to generate a valid >>> file identifier. >>> >>> Error in ==> read_brainvision_eeg at 52 >>>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>>  'cof'); >>> >>> Error in ==> ft_read_data at 442 >>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>    begsample, endsample); >>> >>> Error in ==> ft_preprocessing at 466 >>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>      'begsample', begsample, 'endsample', endsample, >>>      'chanindx', rawindx, 'checkboundary', >>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>      cfg.dataformat) >>> >>> >>> If I'm trying to use another file that is an average (so no trial to select) and I >>> treat as a continous file I got these other problems: >>> >>> cfg=[]; >>> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >>> data=ft_preprocessing(cfg); >>> Warning: cannot determine number of samples for this >>> sub-fileformat >>>> In fileio\private\read_brainvision_vhdr at 95 >>>  In ft_read_header at 367 >>>  In ft_preprocessing at 294 >>> processing channel >>> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >>> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>> reading and preprocessing >>> reading and preprocessing trial 1 from 1 >>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 390 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 395 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> ??? Error using ==> zeros >>> NaN and Inf not allowed. >>> >>> Error in ==> read_brainvision_eeg at 76 >>>  dat = zeros(endsample-begsample+1, >>>  hdr.NumberOfChannels); >>> >>> Error in ==> ft_read_data at 442 >>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>    begsample, endsample); >>> >>> Error in ==> ft_preprocessing at 466 >>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>      'begsample', begsample, 'endsample', endsample, >>>      'chanindx', rawindx, 'checkboundary', >>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>      cfg.dataformat) >>> >>> do I miss something? >>> >>> regards >>> >>> Marco >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>> >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_filetype.m Type: application/octet-stream Size: 41199 bytes Desc: not available URL: From marco.rotonda at GMAIL.COM Mon May 24 11:15:10 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Mon, 24 May 2010 11:15:10 +0200 Subject: Problem with brainvision files In-Reply-To: Message-ID: Hi Vladimir! Everything went fine! Thank you! Marco 2010/5/22 Vladimir Litvak : > Hi Marco, > > There are two separate problems. One has to do with my mistake and one > doesn't. The problem with the example you sent me is indeed that the > data is ASCII multiplexed. I suggest that you export the data as > binary. > > The second problem was introduced by my fix and I hope that it'll be > fixed if you put the attached file in fileio. I also checked it in. > > Let me know if you still have problems. > > Best, > > Vladimir > > On Sat, May 22, 2010 at 11:52 AM, Marco Rotonda wrote: >> Sorry... >> I maybe you could have a better idea with the errors ;-) >> >>>> dbstop if error >>>> cfg=[]; >> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >> data=ft_preprocessing(cfg); >> Warning: cannot determine number of samples for this >> sub-fileformat >>> In fileio\private\read_brainvision_vhdr at 95 >>  In ft_read_header at 367 >>  In ft_preprocessing at 294 >> processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' >> 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' >> 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 1 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> zeros >> NaN and Inf not allowed. >> >> Error in ==> read_brainvision_eeg at 76 >>  dat = zeros(endsample-begsample+1, >>  hdr.NumberOfChannels); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> 76    dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); >> K>> read_brainvision_eeg >> ??? Input argument "hdr" is undefined. >> >> Error in ==> read_brainvision_eeg at 32 >> if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, >> 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') >> >> 32  if strcmpi(hdr.DataFormat, 'binary') && >> strcmpi(hdr.DataOrientation, 'multiplexed') && >> strcmpi(hdr.BinaryFormat, 'int_16') >> K>> >> >> >> Maybe the problem is about the multiplexed so the way I exported the data? >> >> >> >> 2010/5/21 Vladimir Litvak : >>>  Hi Marco, >>> >>> I've done some changes recently trying to improve the recognition of >>> Brainvision files. These might or might not be related to your >>> problem. Could you perhaps do: >>> >>> dbstop if error >>> >>> and try to get some idea about why the error in filetype_check_header >>> happens. There is some problem with opening the .eeg file but it's not >>> clear what it is. I tried to use code similar to yours on a different >>> brainvision dataset and there is no problem so it may be something >>> that happens on your system for some reason. If you can't figure it >>> out, send me an example dataset via yousendit.com and I'll try to look >>> at it. >>> >>> Best, >>> >>> Vladimir >>> >>> On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >>>> Hi fildtrippers! >>>> After I've updated fieldtrip I got some problems reading brainvision files I didn't >>>> got before. >>>> >>>> Here are the errors (the only differences in this script are ft_definetrial and >>>> ft_preprocessing that before were only definetrial and preprocessing): >>>> >>>> cfg=[]; >>>> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >>>> cfg.trialdef.eventtype='Stimulus'; >>>> cfg.trialdef.eventvalue='S 55'; >>>> cfg.trialdef.prestim=2; >>>> cfg.trialdef.poststim=1.999; >>>> cfg=ft_definetrial(cfg); >>>> data=ft_preprocessing(cfg); >>>> >>>> Warning: no trialfun was specified, using >>>> trialfun_general >>>>> In ft_definetrial at 95 >>>> evaluating trialfunction 'trialfun_general' >>>> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >>>> found 256 events >>>> created 41 trials >>>> processing channel >>>> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >>>> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>>> reading and preprocessing >>>> reading and preprocessing trial 1 from 41 >>>> Warning: could not open >>>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 390 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> Warning: could not open >>>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 395 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> ??? Error using ==> fseek >>>> Invalid file identifier.  Use fopen to generate a valid >>>> file identifier. >>>> >>>> Error in ==> read_brainvision_eeg at 52 >>>>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>>>  'cof'); >>>> >>>> Error in ==> ft_read_data at 442 >>>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>>    begsample, endsample); >>>> >>>> Error in ==> ft_preprocessing at 466 >>>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>>      'begsample', begsample, 'endsample', endsample, >>>>      'chanindx', rawindx, 'checkboundary', >>>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>>      cfg.dataformat) >>>> >>>> >>>> If I'm trying to use another file that is an average (so no trial to select) and I >>>> treat as a continous file I got these other problems: >>>> >>>> cfg=[]; >>>> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >>>> data=ft_preprocessing(cfg); >>>> Warning: cannot determine number of samples for this >>>> sub-fileformat >>>>> In fileio\private\read_brainvision_vhdr at 95 >>>>  In ft_read_header at 367 >>>>  In ft_preprocessing at 294 >>>> processing channel >>>> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >>>> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>>> reading and preprocessing >>>> reading and preprocessing trial 1 from 1 >>>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 390 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 395 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> ??? Error using ==> zeros >>>> NaN and Inf not allowed. >>>> >>>> Error in ==> read_brainvision_eeg at 76 >>>>  dat = zeros(endsample-begsample+1, >>>>  hdr.NumberOfChannels); >>>> >>>> Error in ==> ft_read_data at 442 >>>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>>    begsample, endsample); >>>> >>>> Error in ==> ft_preprocessing at 466 >>>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>>      'begsample', begsample, 'endsample', endsample, >>>>      'chanindx', rawindx, 'checkboundary', >>>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>>      cfg.dataformat) >>>> >>>> do I miss something? >>>> >>>> regards >>>> >>>> Marco >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>>> >>>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Tue May 25 11:52:12 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Tue, 25 May 2010 11:52:12 +0200 Subject: Clusterplot problem In-Reply-To: Message-ID: Hi Matteo, How do your ft_topoplot's look if you average over frequency and average over time (averaging before baseline correcting)? That could be one of the causes for your different outputs. I do not expect something to be wrong with the stat.mask field as you mentioned, as it does fit really well to the plotted t-value spectrum. Could you also post your ft_topoplot and ft_clusterplot settings, just to be sure? Best, Roemer On 5/21/2010 1:09 PM, Matteo Fraschini wrote: > Hi Roemer, > I tried using the last FT version with same results. > > This is the code for statistic: > > function [stat]=withinSubjs(GA_act,GA_bl) > cfg = []; > cfg.channel = {'MEG','-MLT22','-MLT27','-MLO42','-MLO43','-MRT22','-MRT27','-MRO42','-MRO43'}; > cfg.frequency = [4 7]; > cfg.avgovertime = 'yes'; > cfg.avgoverfreq = 'yes'; > cfg.method = 'montecarlo'; > cfg.statistic = 'actvsblT'; > cfg.correctm = 'cluster'; > cfg.clusteralpha = 0.05; > cfg.clusterstatistic = 'maxsum'; > cfg.minnbchan = 2; > cfg.tail = 0; > cfg.clustertail = 0; > cfg.alpha = 0.05; > cfg.numrandomization = 500; > n_subjs=size(GA_act.powspctrm); > n_subjs=n_subjs(1); > design = zeros(2,2*n_subjs); > for i = 1:n_subjs > design(1,i) = i; > end > for i = 1:n_subjs > design(1,n_subjs+i) = i; > end > design(2,1:n_subjs) = 1; > design(2,n_subjs+1:2*n_subjs) = 2; > cfg.design = design; > cfg.uvar = 1; > cfg.ivar = 2; > stat = ft_freqstatistics(cfg,GA_act,GA_bl) > > You can see the ft_topoplot (with absolute baseline correction) and ft_clusterplot (same time) figures here: > http://192.167.154.14/ft/topo.jpg > http://192.167.154.14/ft/cluster.jpg > > I also tried using 'ctf_old' specification when preprocessing my data but an error occurs in ft_megplanar: > > ??? Index exceeds matrix dimensions. > Error in ==> channelposition at 53 > sens.pnt = sens.pnt(used,:); > Error in ==> megplanar_sincos at 26 > [pnt, ori, lab] = channelposition(grad); > > Any suggestion? > Thank you very much, > Matteo > > > Il giorno 20/mag/2010, alle ore 10.24, Roemer van der Meij ha scritto: > > >> Hi Matteo, >> >> What FieldTrip version are you using? There have been some changes in the past few months in the functions you use. >> Could you post all the cfg-settings you used (from statistical analysis onwards)? >> >> Best, >> Roemer >> >> >> On 5/19/2010 3:51 PM, wrote: >> >>> Dear all, >>> I am currently working on a study involving Activation vs Baseline paradigm on MEG data. >>> By using FT preprocessing, analysis and plotting functions I really can see what I expected >>> to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation >>> tests on time-frequency data following the web tutorial. The analysis shows significative >>> cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with >>> ft_clusterplot) is significative cluster but in region/channels with no frequency differences >>> from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference >>> is more evident. Looks like channels are not correctly placed in the plot. >>> Any suggestions? >>> Thank you very much, >>> Matteo >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>> >>> >>> >> -- >> Roemer van der Meij MSc >> Scientific Programmer& Data-Analyst >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3612631 >> E-mail: r.vandermeij at donders.ru.nl >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From michael.wibral at WEB.DE Tue May 25 17:54:56 2010 From: michael.wibral at WEB.DE (Michael Wibral) Date: Tue, 25 May 2010 17:54:56 +0200 Subject: Error in the description of funcolorlim ?? Message-ID: Dear Listusers, I am trying to plot just the negative values of my sourcestatistics, and it seems difficult to achieve this so that the parts in the data.outside region and the part outside of the head are transparent. Does anybody know how to do this? The other thing that I am wondering about is if the documentation of funcolorlim in ft_sourceplot is entirely correct. In the help it says: cfg.funcolorlim = color range of the functional data (default = 'auto') [min max] 'maxabs', from -max(abs(funparameter)) to +max(abs(funparameter)) 'zeromax', from 0 to max(abs(funparameter)) 'minzero', from min(abs(funparameter)) to 0 'auto', if funparameter values are all positive: 'zeromax', all negative: 'minzero', both possitive and negative: 'maxabs' What I am wondering about is that when values are all negative (say from -6 to -0.1) it chooses 'minzero'. This would, according to the above description result in values from min(abs(funparameter))=+0.1 to 0 being plotted, i.e. if this were corrcet it would try to plot small positive values... . I guess this is an error in the documentation, with the 'abs' being wrong. Any comments on this would be appreciated. Michael ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 628 bytes Desc: not available URL: From balazs at COGPSYPHY.HU Wed May 26 00:47:01 2010 From: balazs at COGPSYPHY.HU (=?ISO-8859-1?Q?Bal=E1zs_L=E1szl=F3?=) Date: Wed, 26 May 2010 00:47:01 +0200 Subject: IOP conference - extended deadline for submissions Message-ID: Dear listmembers, Deadline for submissions to the 15th World Congress of Pschophysiology (IOP 2010) is extended until the end of May. Please read the information in attachment. Looking forward to see you in Budapest. Kind regards, Laszlo -- Laszlo Balazs, Ph.D. / dr. Balázs László Institute for Psychology HAS / MTA Pszichológiai Kutatóintézet P O B 398, Budapest, Hungary, H-1394 Tel:+36(1)354-2410 | Fax:+36(1)354-2416 http://www.cogpsyphy.hu/balazs __________ Information from ESET NOD32 Antivirus, version of virus signature database 5133 (20100520) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: IOP_?rtes?t?_email.pdf Type: application/octet-stream Size: 51077 bytes Desc: not available URL: From zaifengg at GMAIL.COM Wed May 26 10:53:09 2010 From: zaifengg at GMAIL.COM (gao zai) Date: Wed, 26 May 2010 11:53:09 +0300 Subject: Questions on Dipole fitting Message-ID: Dear all, Currently I am trying to do the Dipole fitting on the MEG data. I have 1 problem that puzzled me, in particular, When I did dipole on individual subject,I used the scripts according to to one posted in the Fieldtrip website, it runs ok but I get only null result (naked MRI picture without any dipole inside.) I was told that "Local minimum possible. fminunc stopped because the size of the current step is less than the default value of the step size tolerance." However, the same data I used SPM8, I get can get dipole. So I wonder is there anything wrong with my scripts? I hope I can get your kind help. Thanks very much in advance. -- load s2TL42 figure plot(1000*s2TL42.time, s2TL42.avg) % convert time to ms xlabel('time (ms)') ylabel('field amplitude (T)') axis tight grid on cfg = []; cfg.xlim = 0.1:0.025:0.2; cfg.colorbar = 'no'; cfg.comment = ''; cfg.showxlim = 'no'; cfg.showzlim = 'no'; cfg.layout = '4D248.lay'; cfg.zlim = [-1.5 1.5] * 1e-13; figure ft_topoplotER(cfg, s2TL42); cfg = []; cfg.latency = [0.15 0.18]; % specify latency window around M165 peak cfg.numdipoles = 1; cfg.vol = vol; cfg.feedback = 'textbar'; cfg.resolution = 2; dip = ft_dipolefitting(cfg, s2TL42); sMRI = read_mri(fullfile(spm('dir'), 'canonical', 'single_subj_T1.nii')); % the source is expressed in cm cfg = []; cfg.location = dip.dip.pos*10; % convert from cm to mm cfg.interactive='yes'; figure; ft_sourceplot(cfg, sMRI); --------------- Best, Feng ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ab_saad at LIVE.COM Wed May 26 12:09:44 2010 From: ab_saad at LIVE.COM (W. Saad) Date: Wed, 26 May 2010 06:09:44 -0400 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... Message-ID: Hi, I am new to matlab and FieldTrip - so bare with me and thanks for your feedback in advance :) I have a csv file containing readings for 25 electrode EEG trial. There are 129,908 readings in the file (sampling rate is 256 - approx. 507 seconds) The file is 25 columns by 129,908 rows. I would like to calculate power for each of the 5 wave types for each channel. Also, I would like to find the coherence for all intra-hemispheric and inter-hemispheric pairwise combination of the 25 channels (300 in total). I am trying the following code but getting a memory error and other errors (code is mostly based on the samples I have found in FieldTrip website). %-------------------------------------------------------------- fieldtripdefs; filename='recall.dat'; filelength=129908; rdata=csvread(filename); rdata=rdata'; % cell-array containing strings, Nchan X 1 data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' 'E12' 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' 'E23' 'E24' 'E25' 'E26'}; % sampling frequency in Hz, single number data.fsample = 256; % cell-array containing a data matrix for each trial (1 X Ntrial), each data matrix is Nchan X Nsamples data.trial = {rdata}; % cell-array containing a time axis for each trial (1 X Ntrial), each time axis is a 1 X Nsamples vector timevector = [1:filelength]; data.time = { timevector }; cfg = []; cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [0.5 50]; cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'all' }; cfg.channelcmb = {'all' 'all'}; freq = ft_freqanalysis(cfg, data); cfg = []; cfg.method = 'coh'; cfg.channelcmb = {'all' 'all'}; fd = ft_connectivityanalysis(cfg, freq); % Let us not draw for now.. %cfg = []; %cfg.xparam = 'freq'; %cfg.zparam = 'cohspctrm'; %cfg.xlim = [5 80]; %cfg.cohrefchannel = 'EMGlft'; %cfg.layout = 'CTF151.lay'; %cfg.showlabels = 'yes'; %figure; ft_multiplotER(cfg, fd) ----------------------------------------------------------------- The messages/error I get is: the input is raw data with 25 channels and 1 trials ??? Maximum variable size allowed by the program is exceeded. Error in ==> dpss>dpsscalc at 127 E = zeros(N,k(2)-k(1)+1); Error in ==> dpss at 54 [E,V] = dpsscalc(N,NW,k); Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 tap = dpss(double(a), double(b), varargin{:}); Error in ==> ft_freqanalysis_mtmfft at 249 tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; Error in ==> ft_freqanalysis at 75 [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg, data); Error in ==> saad_fieldtrip at 29 freq = ft_freqanalysis(cfg, data); ----------------------------------------------------------------- I have been looking around in the discussion board trying to find how to read a csv file with no success (though it looks to me it was read successfully since Fieldtrip detected it has 25 channels). Also, I am worried about the message ??? Maximum variable size allowed by the program is exceeded. Because most of my trials are huge in size, in fact the biggest file size I have is 25 columns x 250,000 rows (~60MB). Your input is highly appreciated. Thanks. _________________________________________________________________ 30 days of prizes to be won with Hotmail. Enter Here. http://go.microsoft.com/?linkid=9729709 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at DONDERS.RU.NL Wed May 26 14:31:55 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Wed, 26 May 2010 14:31:55 +0200 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... In-Reply-To: Message-ID: Dear W.Saad, Could it be that there is a typo in how you define data.time? You define it in sample numbers but it should be in seconds: data.time{1} = [1:filelength]./daga.fsample; I guess this may help. Best, Jan-Mathijs On May 26, 2010, at 12:09 PM, W. Saad wrote: > Hi, > > I am new to matlab and FieldTrip - so bare with me and thanks for > your feedback in advance :) > > I have a csv file containing readings for 25 electrode EEG trial. > There are 129,908 readings in > the file (sampling rate is 256 - approx. 507 seconds) The file is 25 > columns by 129,908 rows. > > I would like to calculate power for each of the 5 wave types for > each channel. Also, I would > like to find the coherence for all intra-hemispheric and inter- > hemispheric pairwise > combination of the 25 channels (300 in total). > > I am trying the following code but getting a memory error and other > errors (code is mostly based > on the samples I have found in FieldTrip website). > > > %-------------------------------------------------------------- > > fieldtripdefs; > > filename='recall.dat'; > filelength=129908; > rdata=csvread(filename); > rdata=rdata'; > > % cell-array containing strings, Nchan X 1 > data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' > 'E12' 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' > 'E23' 'E24' 'E25' 'E26'}; > > % sampling frequency in Hz, single number > data.fsample = 256; > > % cell-array containing a data matrix for each trial (1 X Ntrial), > each data matrix is Nchan X Nsamples > data.trial = {rdata}; > > % cell-array containing a time axis for each trial (1 X Ntrial), > each time axis is a 1 X Nsamples vector > timevector = [1:filelength]; > data.time = { timevector }; > > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmfft'; > cfg.foilim = [0.5 50]; > cfg.tapsmofrq = 5; > cfg.keeptrials = 'yes'; > cfg.channel = {'all' }; > cfg.channelcmb = {'all' 'all'}; > freq = ft_freqanalysis(cfg, data); > > cfg = []; > cfg.method = 'coh'; > cfg.channelcmb = {'all' 'all'}; > fd = ft_connectivityanalysis(cfg, freq); > > % Let us not draw for now.. > %cfg = []; > %cfg.xparam = 'freq'; > %cfg.zparam = 'cohspctrm'; > %cfg.xlim = [5 80]; > %cfg.cohrefchannel = 'EMGlft'; > %cfg.layout = 'CTF151.lay'; > %cfg.showlabels = 'yes'; > %figure; ft_multiplotER(cfg, fd) > > ----------------------------------------------------------------- > > The messages/error I get is: > > the input is raw data with 25 channels and 1 trials > ??? Maximum variable size allowed by the program is exceeded. > > Error in ==> dpss>dpsscalc at 127 > E = zeros(N,k(2)-k(1)+1); > > Error in ==> dpss at 54 > [E,V] = dpsscalc(N,NW,k); > > Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 > tap = dpss(double(a), double(b), varargin{:}); > > Error in ==> ft_freqanalysis_mtmfft at 249 > tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./ > data.fsample))'; > > Error in ==> ft_freqanalysis at 75 > [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), > cfg, data); > > Error in ==> saad_fieldtrip at 29 > freq = ft_freqanalysis(cfg, data); > > ----------------------------------------------------------------- > > I have been looking around in the discussion board trying to find > how to read a csv file with no success (though it looks to me it > was read successfully since Fieldtrip detected it has 25 channels). > > Also, I am worried about the message > ??? Maximum variable size allowed by the program is exceeded. > Because most of my trials are huge in size, in fact the biggest file > size I have is 25 columns x 250,000 rows (~60MB). > > Your input is highly appreciated. > > Thanks. > 30 days of prizes: Hotmail makes your day easier! Enter now > ---------------------------------- > The aim of this list 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/ Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ab_saad at LIVE.COM Wed May 26 21:51:19 2010 From: ab_saad at LIVE.COM (Saad AB) Date: Wed, 26 May 2010 21:51:19 +0200 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... Message-ID: Hi, Thanks for your response. That definitely helped! However, I am still getting an error that does not make a lot of sense to me. I don't think it has to do with my files size being big since the tutorial in the following link works with files 4 times bigger than mine (208MB): http://fieldtrip.fcdonders.nl/tutorial/coherence Here is the code again for anyone willing to help: %----------------------------------------------- fieldtripdefs; filename='recall.dat'; filelength=129908; rdata=csvread(filename); rdata=rdata'; % cell-array containing strings, Nchan X 1 data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' 'E12' 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' 'E23' 'E24' 'E25' 'E26'}; % sampling frequency in Hz, single number data.fsample = 256; % cell-array containing a data matrix for each trial (1 X Ntrial), each data matrix is Nchan X Nsamples data.trial = {rdata}; % cell-array containing a time axis for each trial (1 X Ntrial), each time axis is a 1 X Nsamples vector data.time{1} = [1:filelength]./data.fsample; cfg = []; cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [0.5 50]; cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'all' }; cfg.channelcmb = {'all' 'all'}; freq = ft_freqanalysis(cfg, data); cfg = []; cfg.method = 'coh'; cfg.channelcmb = {'all' 'all'}; fd = ft_connectivityanalysis(cfg, freq); %----------------------------------------------- and the error: the input is raw data with 25 channels and 1 trials ??? Maximum variable size allowed by the program is exceeded. Error in ==> dpss>dpsscalc at 127 E = zeros(N,k(2)-k(1)+1); Error in ==> dpss at 54 [E,V] = dpsscalc(N,NW,k); Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 tap = dpss(double(a), double(b), varargin{:}); Error in ==> ft_freqanalysis_mtmfft at 249 tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; Error in ==> ft_freqanalysis at 75 [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg, data); Error in ==> saad_fieldtrip at 30 freq = ft_freqanalysis(cfg, data); %------------------------------------------- Thanks in advance for your input. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jan.schoffelen at DONDERS.RU.NL Thu May 27 09:05:01 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Thu, 27 May 2010 09:05:01 +0200 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... In-Reply-To: Message-ID: Dear W. Saad, It seems you call ft_freqanalysis with only one quite long data trial in the input. This leads to a frequency tranform which has a very high spectral resolution. The number of tapers used in multitapering (for a given requested half- bandwidth cfg.tapsmofrq) is a function of the spectral resolution. In other words, the higher the spectral resolution, the more tapers are needed. In your case you have approx. 500 seconds of data, yielding a spectral resolution of 1/500 Hz. To achieve a spectral smoothing of 5 Hz you need approximately 1000 tapers. Besides the fact that this is rather meaningless, it will totally exceed your memory limits when the tapers are constructed. The remedy here is to cut your data into shorter segments. The length of these segments will be determined by your experimental question. Best, Jan-Mathijs On May 26, 2010, at 9:51 PM, Saad AB wrote: > Hi, > > Thanks for your response. That definitely helped! > > However, I am still getting an error that does not make a lot of > sense to me. > > I don't think it has to do with my files size being big since the > tutorial > in the following link works with files 4 times bigger than mine > (208MB): > http://fieldtrip.fcdonders.nl/tutorial/coherence > > Here is the code again for anyone willing to help: > %----------------------------------------------- > fieldtripdefs; > filename='recall.dat'; > filelength=129908; > rdata=csvread(filename); > rdata=rdata'; > > % cell-array containing strings, Nchan X 1 > data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' > 'E12' > 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' 'E23' > 'E24' > 'E25' 'E26'}; > > % sampling frequency in Hz, single number > data.fsample = 256; > > % cell-array containing a data matrix for each trial (1 X Ntrial), > each data > matrix is Nchan X Nsamples > data.trial = {rdata}; > > % cell-array containing a time axis for each trial (1 X Ntrial), > each time > axis is a 1 X Nsamples vector > data.time{1} = [1:filelength]./data.fsample; > > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmfft'; > cfg.foilim = [0.5 50]; > cfg.tapsmofrq = 5; > cfg.keeptrials = 'yes'; > cfg.channel = {'all' }; > cfg.channelcmb = {'all' 'all'}; > freq = ft_freqanalysis(cfg, data); > > cfg = []; > cfg.method = 'coh'; > cfg.channelcmb = {'all' 'all'}; > fd = ft_connectivityanalysis(cfg, freq); > > > %----------------------------------------------- > > and the error: > > the input is raw data with 25 channels and 1 trials > ??? Maximum variable size allowed by the program is exceeded. > > Error in ==> dpss>dpsscalc at 127 > E = zeros(N,k(2)-k(1)+1); > > Error in ==> dpss at 54 > [E,V] = dpsscalc(N,NW,k); > > Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 > tap = dpss(double(a), double(b), varargin{:}); > > Error in ==> ft_freqanalysis_mtmfft at 249 > tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./ > data.fsample))'; > > Error in ==> ft_freqanalysis at 75 > [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), > cfg, data); > > Error in ==> saad_fieldtrip at 30 > freq = ft_freqanalysis(cfg, data); > > %------------------------------------------- > > Thanks in advance for your input. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From aardesta at UCLA.EDU Fri May 28 21:07:17 2010 From: aardesta at UCLA.EDU (Allen Ardestani) Date: Fri, 28 May 2010 12:07:17 -0700 Subject: Error in timelockstatistics In-Reply-To: <69C15B57-9A50-41D0-B276-561116F5AB0D@mac.com> Message-ID: Thank you very much for the input - I got the Image Processing Toolbox and am now able to make use of the clustering function. I do have remaining questions about the cluster analysis. I tried looking at the code but still can't figure out what type of clustering approach (e.g., k-means, fuzzy logic, etc) is being used and how to adjust its clustering sensitivity, independent of the cluster thresholding alpha. Any help would be much appreciated! From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Thursday, May 13, 2010 1:22 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Error in timelockstatistics Dear Allen, you need bwlabeln anyhow, no matter how you want to cluster (the function can cluster in n-dimensions). so getting the Image Processing Toolbox may be a good investment if you decide to use fieldtrip statistics in future. an -untested- alternative may be to use the octave version of bwlabeln. usually the code is very compatible to matlab, i.e. if it does not run out-of-the-box it usually just needs a little tweaking. however it may be a lot slower. http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/image/bwlabel.m http://www.gnu.org/software/octave/index.html good luck, nathan On 13.05.2010, at 00:44, Allen Ardestani wrote: Hi everyone, I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: method: 'montecarlo' statistic: 'indepsamplesT' correctm: 'cluster' clusteralpha: 0.0500 clusterstatistic: 'maxsum' tail: 0 clustertail: 0 alpha: 0.0250 numrandomization: 100 design: [1x267 double] channel: 'F1' minnbchan: 0 layout: 'layout.mat' ivar: 1 I get the following error message: ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. Error in ==> findcluster at 89 [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); Error in ==> clusterstat at 194 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> statistics_montecarlo at 321 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 285 [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); Error in ==> ft_timelockstatistics at 96 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I'm assuming that part of the problem is that I don't have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I'm a new user, so any advice is much appreciated. Thanks in advance! ____________________________________________________________________________ ______ Allen Ardestani Email: aardesta at ucla.edu Phone: (310) 825-5528 Medical Scientist Training Program David Geffen School of Medicine at UCLA Semel Institute for Neuroscience and Human Behavior 760 Westwood Plaza Los Angeles, CA 90095-1759 USA ---------------------------------- The aim of this list 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. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at DONDERS.RU.NL Fri May 28 23:29:27 2010 From: e.maris at DONDERS.RU.NL (Eric Maris) Date: Fri, 28 May 2010 23:29:27 +0200 Subject: Error in timelockstatistics In-Reply-To: <015501cafe98$fd6f14c0$f84d3e40$@edu> Message-ID: Hi Allen, Thank you very much for the input - I got the Image Processing Toolbox and am now able to make use of the clustering function. I do have remaining questions about the cluster analysis. I tried looking at the code but still can't figure out what type of clustering approach (e.g., k-means, fuzzy logic, etc) is being used and how to adjust its clustering sensitivity, independent of the cluster thresholding alpha. Any help would be much appreciated! I know it's a bit pretentious to refer to one's own papers, but this is a case where the question forces me: Maris & Oostenveld (2007). Journal of Neuroscience Methods. Good luck, Eric dr. Eric Maris Donders Institute for Brain, Cognition and Behavior Center for Cognition and F.C. Donders Center for Cognitive Neuroimaging Radboud University P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 Mobile: 06 39584581 F:+31 24 3616066 E: e. maris at donders.ru.nl From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Thursday, May 13, 2010 1:22 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Error in timelockstatistics Dear Allen, you need bwlabeln anyhow, no matter how you want to cluster (the function can cluster in n-dimensions). so getting the Image Processing Toolbox may be a good investment if you decide to use fieldtrip statistics in future. an -untested- alternative may be to use the octave version of bwlabeln. usually the code is very compatible to matlab, i.e. if it does not run out-of-the-box it usually just needs a little tweaking. however it may be a lot slower. http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/image/bwlabel.m http://www.gnu.org/software/octave/index.html good luck, nathan On 13.05.2010, at 00:44, Allen Ardestani wrote: Hi everyone, I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: method: 'montecarlo' statistic: 'indepsamplesT' correctm: 'cluster' clusteralpha: 0.0500 clusterstatistic: 'maxsum' tail: 0 clustertail: 0 alpha: 0.0250 numrandomization: 100 design: [1x267 double] channel: 'F1' minnbchan: 0 layout: 'layout.mat' ivar: 1 I get the following error message: ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. Error in ==> findcluster at 89 [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); Error in ==> clusterstat at 194 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> statistics_montecarlo at 321 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 285 [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); Error in ==> ft_timelockstatistics at 96 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I'm assuming that part of the problem is that I don't have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I'm a new user, so any advice is much appreciated. Thanks in advance! ____________________________________________________________________________ ______ Allen Ardestani Email: aardesta at ucla.edu Phone: (310) 825-5528 Medical Scientist Training Program David Geffen School of Medicine at UCLA Semel Institute for Neuroscience and Human Behavior 760 Westwood Plaza Los Angeles, CA 90095-1759 USA ---------------------------------- The aim of this list 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. 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. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.rotonda at GMAIL.COM Sat May 29 18:53:08 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Sat, 29 May 2010 18:53:08 +0200 Subject: cohrefchannel Message-ID: Hi there! I'm trying to plot some coherence analysis I did but I have to specify the reference channel. The point is that I've taken it away in previous analysis done in brainvision and to have it back I have to discard a lot of work. There is a way to bypass this cfg parameter? why is needed? I need only to visualize the coherence indexes I've found... regards Marco ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Mon May 31 10:43:54 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Mon, 31 May 2010 10:43:54 +0200 Subject: issue with cfg.interplimits In-Reply-To: <1D084D6F-BC7F-4DFA-81EB-2684F409E0CA@ccs.fau.edu> Message-ID: Hi Reyna, Sorry for my late reply. I added your bug to our new bug-database, you can track it here if you wish: http://bugzilla.fcdonders.nl/show_bug.cgi?id=86 I'll try to work out a fix in the following days. It probably doesn't have anything to do with your specific ft_prepare_layout options. There has been a reorganization of the plotting-functions several months back, which may have caused this problem. Are you by the way using the most recent fieldtrip version? Best, Roemer On 5/21/2010 8:50 PM, Reyna L. Gordon wrote: > Dear Fieldtrippers, > > I am having an issue with creating topoplots of time-frequency data > acquired on an EGI system and processed in Fieldtrip, and I was > wondering if anyone could help. > > Everything works great (this toolbox has been wonderful to use in > general!) except that the colors that represent power are not > interpolating to electrodes that are lower than the origin. > Unfortunately, using the default option for cfg.projection = > 'orthographic' for ft_prepare_layout, seems to greatly distort the > layout for these data, probably because I have too few electrodes. A > better option for me seems to be cfg.projection = 'polar', and I am > fine with those few electrodes appearing outside of the head. > > However, the data corresponding to those electrodes is not there - I > suspect that there is a problem at the level of cfg.interplimits. > This is the code I'm using: > > cfg = []; > cfg.rotate = 0; > cfg.projection = 'polar'; > newlay=ft_prepare_layout(cfg, bin1); > cfg = []; > > cfg.layout = newlay; > cfg.yparam = 'freq'; > cfg.xlim= [0.150 0.150]; > cfg.ylim= [13 30]; > cfg.zlim = [-0.10 0.10]; > cfg.highlight = 'on'; > cfg.baseline = 'no'; > cfg.commentpos = 'title'; > cfg.shading = 'interp'; > cfg.interplimits = 'electrodes'; %Should work here? > cfg.style = 'straight'; > cfg.zparam = 'powspctrm'; > cfg.fontsize = 12; > cfg.gridscale = 100; > ft_topoplotTFR(cfg, bin1); > > According to the documentation, specifying cfg.interplimits = > 'electrodes' should achieve what I want here, but it still does not > interpolate the plot outside of the head. > Attached are some images generated with different cfg.interplimits and > cfg.projection options. I have tried upgrading to the most recent > release of FT, but it doesn't change the outcome. > > Any and all insight would be greatly appreciated. > Best, > Reyna > > ----------------------- > Reyna L. Gordon > PhD Candidate > Center for Complex Systems & Brain Sciences > Florida Atlantic University > gordon at ccs.fau.edu > > > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > > > > > > > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From sklein at BERKELEY.EDU Mon May 31 21:43:49 2010 From: sklein at BERKELEY.EDU (Stanley Klein) Date: Mon, 31 May 2010 12:43:49 -0700 Subject: issue with cfg.interplimits In-Reply-To: <4C0376CA.1010205@donders.ru.nl> Message-ID: On Reyna Gordon's comment about interpolation between electrodes. A number of years ago we modified a topo plot so that rather than showing a smooth interpolation it plotted each electrode as a tiny disk with the voltage shown as the color of the disk The disks were made large enough so that with a dense electrode array they would overlap maybe 40%. Three close electrodes could have triple overlap as I recall. The cute thing about the algorithm is that in the overlap regions we would plot the mean of the overlapping electrodes. It produced a very nice plot with cute smoothing and yet one could identify the location of each electrode. I'm sorry I haven't been able to locate that old topoplot code. But here is a crude matlab simulation similar to what we did for the interpolation. elec=[0 1 1 1 1 0 0 0 0 0 ; 0 0 1 1 1 1 0 0 0 0; 0 0 0 0 1 1 1 1 0 0]; V = [1 3 5] [Nelec,Npix]=size(elec) topo=zeros(1,Npix); for i=1:Npix for j=1:Nelec; topo(i)=topo(i)+V(j)*elec(j,i); N=sum(elec(:,i)~=0); end if N>0, topo(i)=topo(i)/N;end end topo where elec is the topographic image where '1' indicates the electrode locations and V is the voltages on the electrodes. The "interpolated" topoplot is topo. As I recall the algorithm we had only worried about 2 electrode overlaps in which case there was a really simple way to do the algorithm without any FOR loops, using a set intersect command from Matlab. I think it would be nifty if this type of option could be included in Fieldtrip so that one sees the electrode locations as well as getting good enough interpolation/smoothing. Stan On Mon, May 31, 2010 at 1:43 AM, Roemer van der Meij wrote: > > Hi Reyna, > > Sorry for my late reply. I added your bug to our new bug-database, you can track it here if you wish: > http://bugzilla.fcdonders.nl/show_bug.cgi?id=86 > > I'll try to work out a fix in the following days. It probably doesn't have anything to do with your specific ft_prepare_layout options. There has been a reorganization of the plotting-functions several months back, which may have caused this problem. > Are you by the way using the most recent fieldtrip version? > > Best, > Roemer > > > > On 5/21/2010 8:50 PM, Reyna L. Gordon wrote: >> >> Dear Fieldtrippers, >> >> I am having an issue with creating topoplots of time-frequency data acquired on an EGI system and processed in Fieldtrip, and I was wondering if anyone could help. >> >> Everything works great (this toolbox has been wonderful to use in general!) except that the colors that represent power are not interpolating to electrodes that are lower than the origin. Unfortunately, using the default option for cfg.projection = 'orthographic' for ft_prepare_layout, seems to greatly distort the layout for these data, probably because I have too few electrodes. A better option for me seems to be cfg.projection = 'polar', and I am fine with those few electrodes appearing outside of the head. >> >> However, the data corresponding to those electrodes is not there - I suspect that there is a problem at the level of cfg.interplimits. >> This is the code I'm using: >> >> cfg = []; >> cfg.rotate = 0; >> cfg.projection = 'polar'; >> newlay=ft_prepare_layout(cfg, bin1); >> cfg = []; >> >> cfg.layout  = newlay; >> cfg.yparam = 'freq'; >> cfg.xlim= [0.150 0.150]; >> cfg.ylim= [13 30]; >> cfg.zlim = [-0.10 0.10]; >> cfg.highlight          = 'on'; >> cfg.baseline = 'no'; >> cfg.commentpos = 'title'; >> cfg.shading    = 'interp'; >> cfg.interplimits = 'electrodes'; %Should work here? >> cfg.style = 'straight'; >> cfg.zparam   = 'powspctrm'; >> cfg.fontsize = 12; >> cfg.gridscale = 100; >> ft_topoplotTFR(cfg, bin1); >> >> According to the documentation,  specifying cfg.interplimits = 'electrodes' should achieve what I want here, but it still does not interpolate the plot outside of the head. >> Attached are some images generated with different cfg.interplimits and cfg.projection options. I have tried upgrading to the most recent release of FT, but it doesn't change the outcome. >> >> Any and all insight would be greatly appreciated. >> Best, >> Reyna >> >> ----------------------- >> Reyna L. Gordon >> PhD Candidate >> Center for Complex Systems & Brain Sciences >> Florida Atlantic University >> gordon at ccs.fau.edu >> >> >> >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> >> >> >> >> >> >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > -- > Roemer van der Meij MSc > Scientific Programmer&  Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From karl.doron at GMAIL.COM Sat May 1 00:22:41 2010 From: karl.doron at GMAIL.COM (Karl Doron) Date: Sat, 1 May 2010 00:22:41 +0200 Subject: Error in ft_megrealign Message-ID: I got this to compile if anyone needs it. -karl doron ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: meg_leadfield1.mexmaci64 Type: application/octet-stream Size: 8856 bytes Desc: not available URL: From ronitibon at GMAIL.COM Mon May 3 17:08:39 2010 From: ronitibon at GMAIL.COM (Roni Tibon) Date: Mon, 3 May 2010 17:08:39 +0200 Subject: Wavelet vs. Multitaper Message-ID: Dear all, I've been trying to analyze the same data using both methods, but I'm getting very different results, depending on the method I'm using. Enclosed is a picture of the results of the analysis in 3 channels, using both methods. In the left column I performed a multitaper analysis for each channel, using the following script: cfg = []; cfg.output = 'pow'; cfg.channel = 'A195'; cfg.method = 'mtmconvol'; cfg.foi = 1:1:50; cfg.t_ftimwin = 2./cfg.foi; cfg.tapsmofrq = 0.4 *cfg.foi; cfg.toi = -0.2:0.05:1; cfg.pad = 'maxperlen'; f12a_a195 = ft_freqanalysis(cfg, data); In the right one, I performed wavelet analysis using: cfg = []; cfg.channel = 'A195'; cfg.method = 'wltconvol'; cfg.output = 'pow'; cfg.foi = 1:1:50; cfg.width = 1; cfg.toi = -0.2:0.05:1; cfg.keeptrials = 'yes'; f12b_a195=freqanalysis(cfg, data); As you can see, channel A106 looks about the same using both methods. However, for channels A176 and A195, the multitaper analysis revealed activation in frequencies ranging from ~15-25, which was not seen in the wavelet analysis. I used a different program (msi) to divide the trial in two (0-500ms and 500-1000ms) and compare activation in this frequency range between the 2 halves, and indeed- there was more activation in the second half, as would be suggested by the multitaper. Can it be that when using wavelet analysis data is lost like this? Am I doing something wrong with the wavelet? Thanks, Roni ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: wavelet.jpg Type: image/jpeg Size: 93156 bytes Desc: not available URL: From r.vandermeij at DONDERS.RU.NL Mon May 3 17:36:45 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Mon, 3 May 2010 17:36:45 +0200 Subject: Wavelet vs. Multitaper In-Reply-To: Message-ID: Hi Roni, I haven't looked in detail at all the other settings you use, but you apparently use a different number of cycles for the wavelets in both methods. For the multitapers, you use 2 cycles per wavelet (which are then convolved with the set of dpss tapers), whereas you use 1 cycle for your Morlet wavelets (which are then convolved with a hanning taper (or something similar)). This will make the time-window for spectral estimation twice as long for the multitapers than for your Morlet wavelets. You could try setting cfg.width = 2 for 'wltconvol'. Hope it helps a bit, Roemer On 5/3/2010 5:08 PM, Roni Tibon wrote: > Dear all, > > I've been trying to analyze the same data using both methods, but I'm > getting very different results, depending on the method I'm using. > > Enclosed is a picture of the results of the analysis in 3 channels, using > both methods. In the left column I performed a multitaper analysis for each > channel, using the following script: > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'A195'; > cfg.method = 'mtmconvol'; > cfg.foi = 1:1:50; > cfg.t_ftimwin = 2./cfg.foi; > cfg.tapsmofrq = 0.4 *cfg.foi; > cfg.toi = -0.2:0.05:1; > cfg.pad = 'maxperlen'; > f12a_a195 = ft_freqanalysis(cfg, data); > > In the right one, I performed wavelet analysis using: > > cfg = []; > cfg.channel = 'A195'; > cfg.method = 'wltconvol'; > cfg.output = 'pow'; > cfg.foi = 1:1:50; > cfg.width = 1; > cfg.toi = -0.2:0.05:1; > cfg.keeptrials = 'yes'; > f12b_a195=freqanalysis(cfg, data); > > As you can see, channel A106 looks about the same using both methods. > However, for channels A176 and A195, the multitaper analysis revealed > activation in frequencies ranging from ~15-25, which was not seen in the > wavelet analysis. > > I used a different program (msi) to divide the trial in two (0-500ms and > 500-1000ms) and compare activation in this frequency range between the 2 > halves, and indeed- there was more activation in the second half, as would > be suggested by the multitaper. > > Can it be that when using wavelet analysis data is lost like this? > Am I doing something wrong with the wavelet? > > Thanks, > Roni > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ronitibon at GMAIL.COM Mon May 3 20:05:19 2010 From: ronitibon at GMAIL.COM (Roni Tibon) Date: Mon, 3 May 2010 21:05:19 +0300 Subject: Wavelet vs. Multitaper In-Reply-To: <4BDEED8D.6000306@donders.ru.nl> Message-ID: Hi, Thanks for the quick response. I tried using the settings you suggested, which, of course, reduced the frequency range, and revealed some activity in ~15-25hz, although it looked minor compared to that seen in the multitaper. I guess my questions now are these: 1. How come when I use multitaper with 1 cycle I see a range starting at 5 hz, but when I use morelet wavelet with 1 cycle, the range starts at 10hz? 2. Can I conclude that when the trial is rather short multitaper will be more accurate, or more sensitive to changes? 3. How come the freq range in the multitaper changes depending on the baseline settings? It started at 5hz when cfg.baseline = [-0.2 -0.05], but started at 10hz when cfg.baseline = [-0.2 -0.1]; Thanks a lot! Roni On 3 May 2010 18:36, Roemer van der Meij wrote: > Hi Roni, > > I haven't looked in detail at all the other settings you use, but you > apparently use a different number of cycles for the wavelets in both > methods. For the multitapers, you use 2 cycles per wavelet (which are then > convolved with the set of dpss tapers), whereas you use 1 cycle for your > Morlet wavelets (which are then convolved with a hanning taper (or something > similar)). This will make the time-window for spectral estimation twice as > long for the multitapers than for your Morlet wavelets. You could try > setting cfg.width = 2 for 'wltconvol'. > > Hope it helps a bit, > > Roemer > > > > > On 5/3/2010 5:08 PM, Roni Tibon wrote: > >> Dear all, >> >> I've been trying to analyze the same data using both methods, but I'm >> getting very different results, depending on the method I'm using. >> >> Enclosed is a picture of the results of the analysis in 3 channels, using >> both methods. In the left column I performed a multitaper analysis for >> each >> channel, using the following script: >> >> cfg = []; >> cfg.output = 'pow'; >> cfg.channel = 'A195'; >> cfg.method = 'mtmconvol'; >> cfg.foi = 1:1:50; >> cfg.t_ftimwin = 2./cfg.foi; >> cfg.tapsmofrq = 0.4 *cfg.foi; >> cfg.toi = -0.2:0.05:1; >> cfg.pad = 'maxperlen'; >> f12a_a195 = ft_freqanalysis(cfg, data); >> >> In the right one, I performed wavelet analysis using: >> >> cfg = []; >> cfg.channel = 'A195'; >> cfg.method = 'wltconvol'; >> cfg.output = 'pow'; >> cfg.foi = 1:1:50; >> cfg.width = 1; >> cfg.toi = -0.2:0.05:1; >> cfg.keeptrials = 'yes'; >> f12b_a195=freqanalysis(cfg, data); >> >> As you can see, channel A106 looks about the same using both methods. >> However, for channels A176 and A195, the multitaper analysis revealed >> activation in frequencies ranging from ~15-25, which was not seen in the >> wavelet analysis. >> >> I used a different program (msi) to divide the trial in two (0-500ms and >> 500-1000ms) and compare activation in this frequency range between the 2 >> halves, and indeed- there was more activation in the second half, as would >> be suggested by the multitaper. >> >> Can it be that when using wavelet analysis data is lost like this? >> Am I doing something wrong with the wavelet? >> >> Thanks, >> Roni >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at MAC.COM Mon May 3 21:06:24 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Mon, 3 May 2010 21:06:24 +0200 Subject: Wavelet vs. Multitaper In-Reply-To: Message-ID: hi roni, > 1. How come when I use multitaper with 1 cycle I see a range starting at 5 hz, but when I use morelet wavelet with 1 cycle, the range starts at 10hz? i'm not sure. what do you mean with "range": the lowest frequency where you get a spectral estimation? just looking at your plots the difference doesn't seem dramatic: the multitaper seems to start somewhere at 6-7, the wavelet at 5. you resolution is set to 1 Hz. > 2. Can I conclude that when the trial is rather short multitaper will be more accurate, or more sensitive to changes? without being an expert: with the multitaper you have more possibilities to do "fine-tuning" (i.e. spectral and temporal resolution can be specified separately). for the have a spectral smoothing of +/- foi*.4. for your wavelet it's +/- foi/1 (your width which for wavelets fixes the temporal AND spectral resolution). this means your frequency resolution in case of the wavelet is *terrible*!! you should take a look here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis in general it seems that for doing "good" time-frequency analysis, your trial lengths are far too short, particularly if you are interested in lower frequency activity. you should be more generous when chopping your data into trials (i usually do +/- 2s or so, do TF-analysis and then home-in into interpretable periods). you can see that in your case you hardly have values in the baseline (particularly <20 Hz). when you do that (i.e. longer epochs) and use sensible m-factors (~5-7; or just use the fieldtrip default), then you will definitely get a completely different picture. i'm not religious about wavelets and multitapers. with proper use both give good and usually very similar results. as said multitapers offer more possibilities for fine-tuning, but more freedom in choice is sometimes a heavy burden :-) > 3. How come the freq range in the multitaper changes depending on the baseline settings? It started at 5hz when cfg.baseline = [-0.2 -0.05], but started at 10hz when cfg.baseline = [-0.2 -0.1]; again: take a look at the pictures. you basically have NaN's everywhere between -.2 and -.1. longer epochs are your friend. good luck, nathan > > Thanks a lot! > Roni > > > > On 3 May 2010 18:36, Roemer van der Meij wrote: > Hi Roni, > > I haven't looked in detail at all the other settings you use, but you apparently use a different number of cycles for the wavelets in both methods. For the multitapers, you use 2 cycles per wavelet (which are then convolved with the set of dpss tapers), whereas you use 1 cycle for your Morlet wavelets (which are then convolved with a hanning taper (or something similar)). This will make the time-window for spectral estimation twice as long for the multitapers than for your Morlet wavelets. You could try setting cfg.width = 2 for 'wltconvol'. > > Hope it helps a bit, > > Roemer > > > > > On 5/3/2010 5:08 PM, Roni Tibon wrote: > Dear all, > > I've been trying to analyze the same data using both methods, but I'm > getting very different results, depending on the method I'm using. > > Enclosed is a picture of the results of the analysis in 3 channels, using > both methods. In the left column I performed a multitaper analysis for each > channel, using the following script: > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'A195'; > cfg.method = 'mtmconvol'; > cfg.foi = 1:1:50; > cfg.t_ftimwin = 2./cfg.foi; > cfg.tapsmofrq = 0.4 *cfg.foi; > cfg.toi = -0.2:0.05:1; > cfg.pad = 'maxperlen'; > f12a_a195 = ft_freqanalysis(cfg, data); > > In the right one, I performed wavelet analysis using: > > cfg = []; > cfg.channel = 'A195'; > cfg.method = 'wltconvol'; > cfg.output = 'pow'; > cfg.foi = 1:1:50; > cfg.width = 1; > cfg.toi = -0.2:0.05:1; > cfg.keeptrials = 'yes'; > f12b_a195=freqanalysis(cfg, data); > > As you can see, channel A106 looks about the same using both methods. > However, for channels A176 and A195, the multitaper analysis revealed > activation in frequencies ranging from ~15-25, which was not seen in the > wavelet analysis. > > I used a different program (msi) to divide the trial in two (0-500ms and > 500-1000ms) and compare activation in this frequency range between the 2 > halves, and indeed- there was more activation in the second half, as would > be suggested by the multitaper. > > Can it be that when using wavelet analysis data is lost like this? > Am I doing something wrong with the wavelet? > > Thanks, > Roni > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > > The aim of this list 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/ > -------------------------------------------- Dr. Nathan Weisz OBOB-Lab University of Konstanz Department of Psychology P.O. Box D23 78457 Konstanz Germany Tel: ++49 - (0)7531 - 88 45 84 Email: nathan.weisz at uni-konstanz.de Homepage: http://www.uni-konstanz.de/obob "Nothing shocks me. I'm a scientist." (Indiana Jones) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zachary.d.cohen at VANDERBILT.EDU Tue May 4 00:01:00 2010 From: zachary.d.cohen at VANDERBILT.EDU (Zachary Daniel Cohen) Date: Mon, 3 May 2010 17:01:00 -0500 Subject: timelockgrandaverage config Message-ID: Hello FieldTrip Community, Let me start off by saying thanks for an amazing analysis package; I've been using it since november with our scalp EEG data analyses and am a huge fan. I recently began looking at grandaverage cluster analyses, and wanted to check in to make sure I'm configuring everything correctly because a few things don't look right. My goal is to compare the pattern of voltage activity across the scalp for taskA vs. taskB I preprocess my scalp eeg voltage data using my own functions, I believe the important details are as follows: 60 subjects, each subject has approx 800 events where they performed taskA and 800 events where they performed taskB, although it varies with each subject. Each event is timelocked from 0ms to 1200ms. I run each subject's taskA data through timelock analysis, and then run timelockgrandaverage on the set of all subjects' taskA averages. I then do the same for taskB. I then run timelockstatistics on the two grandaverages. My cfg is set as follows: layout: 'HCGSN128_nof.sfp' neighbourdist: 0.1300 correctm: 'cluster' clusteralpha: 0.0500 alphathresh: 0.0500 method: 'montecarlo' clusterstatistic: 'maxsum' dimord: 'chan_time' numrandomization: 1000 minnbchan: 1 tail: 0 clustertail: 0 alpha: 0.0500 statistic: 'depsamplesT' uvar: 1 ivar: 2 keepindividual: 'yes' computecritval: 'no' clustercritval: 0.0500 clusterthreshold: 'parametric' cfg.design is a 2X120 double, where the top row contains the subject numbers [1:60 1:60] and the bottom row identifies what condition the data is from (1 for taskA and 2 for taskB). When the script runs, the following gets output: there are on average 9.8 neighbours per channel using "statistics_montecarlo" for the statistical testing using "statfun_depsamplesT" for the single-sample statistics constructing randomized design total number of measurements = 120 total number of variables = 2 number of independent variables = 1 number of unit variables = 1 number of within-cell variables = 0 number of control variables = 0 using a permutation resampling approach repeated measurement in variable 1 over 60 levels number of repeated measurements in each level is 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 using the specified parametric threshold for clustering computing statistic The questions I have are the following: 1. Should the total number of independent variables be 2, and the total number of unit variables be 60? 2. What should the total number of repeated measures in each level be? 3. I'm not sure whether to leave the data in 10ms bins, or to bin it as I would for publication, in say 150ms or 300ms bins, before running it through the cluster analysis. 4. How should I make intelligent decisions about neighbourdist and minnbchan? Right now I have chosen .13 because that leaves a reasonable amount of electrodes defined as neighbours, but I would prefer to base my decision on something more sound, perhaps a methods paper? 5. Finally, would using the computercritval option be a better choice than simply setting the level at .05? Thanks so much for your advice in advance! Reading these forums has helped a great deal in the past. My apologies if I omitted any important information, please let me know if I did. Best, - Zach ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From thomas.hartmann at UNI-KONSTANZ.DE Thu May 6 14:19:00 2010 From: thomas.hartmann at UNI-KONSTANZ.DE (Thomas Hartmann) Date: Thu, 6 May 2010 14:19:00 +0200 Subject: using lcvm-beamformer filter to project time-domain eeg data Message-ID: hi, i would like to use the filters generated by the lcmv-beamformer algorithm to project my plain time-domain eeg data to the sources in the brain. what puzzles me is that my eeg data in microvolts gets scaled by 10^6-10^7 after projection. what kind of unit is this? (if the data still has one...). is this scaling reliable and constant over subjects? thanks in advance for your help, thomas -- Dipl. Psych. Thomas Hartmann OBOB-Lab University of Konstanz Department of Psychology P.O. Box D25 78457 Konstanz Germany Tel.: +49 (0)7531 88 4612 Fax: +49 (0)7531-88 4601 Email: thomas.hartmann at uni-konstanz.de Homepage: http://www.uni-konstanz.de/obob "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan Doyle) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From recasensmarc at GMAIL.COM Thu May 6 20:38:40 2010 From: recasensmarc at GMAIL.COM (Marc Recasens) Date: Thu, 6 May 2010 20:38:40 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Hello, I'm new in Fieldtrip and I find myself needed of some help :) I'm currently analysing some MEG data (4D-Neuroimaging, Magnes 2500WH) and trying to create a Single-Shell headmodel using a segmented mri. . I've read all the documentation on FT website but I'm still stuck. The volume never fits in the correct position inside the sensor helmet. First of all, I create a segmented MRI using Analyse images (.img'), and the segmentation is performed using: cfg.coordinates = 'spm'; cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates\T1.mnc'; segmentedmri = ft_volumesegment (cfg, mri); segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior volumerealign. Then, I do a volumerealign by selecting manually the fiducial points (Nas, Lpa, Rpa), as I actually don't have fiducials on the MRI scans. cfg.method = 'realignfiducial'; cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) cfg.fiducial.lpa = Lpa; cfg.fiducial.rpa = Rpa; segmented_r = ft_volumerealign (cfg, segmentedmri); Finally I create a volume through the ft_prepare_singleshell (cfg, segmented_r) function and plot it. I have the fiducials or head position coils and the scalp registered by means of a Polhemus digitizer.. Though the segment via ft_sourceplot (doing the: segment.avg.pow = segment.gray+...) looks right, the headmodelplot shows that the volume and the headshape don't fit. Is there any possibility to realign the segmented mri according either to the headshape points either to the MEG fiducials? I'm afraid the answer is no in both cases (as the MRI and MEG coordinates are different). I tried to realign the segment interactively by selecting the positions where the coils in the MRI should be... but as the picture shows, it doesn't fit. am I doing something wrong or skipping some important step? Is it possible to transform MRI coordinate system to MEG-head coordinate system? Would it help? [image: singleshell.jpg][image: singleshell2.jpg] I attach a picture of what i've managed to do till now! Thanks for all!!! -- Marc Recasens Tel.: +34 639 24 15 98 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: singleshell2.jpg Type: image/jpeg Size: 31112 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: singleshell.jpg Type: image/jpeg Size: 31681 bytes Desc: not available URL: From jan.schoffelen at DONDERS.RU.NL Fri May 7 09:01:05 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Fri, 7 May 2010 09:01:05 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Dear Marc, It seems to me that there is an issue with the coordinate system in which your original MRI is expressed. This could be related to the order of the steps you take, so I would permute the order and see whether this makes any difference at all (for me it usually works fine as follows:) First do a call to ft_volumerealign using your single subject's MRI. This step should give you the transformation matrix from voxel to headspace according to CTF's convention (which happens to be the same as 4d). Then do a segmentation of the output of ft_volumerealign, but note that you should specify ctf.coordinates = 'ctf'. Then you can proceed to create the single shell volume conductor model (after checking whether the segmentation worked fine with respect to the orientation etc of the resulting volumes; I believe there is some documentation about this on the website) and plot the results. Hopefully this helps, Best, Jan-Mathijs On May 6, 2010, at 8:38 PM, Marc Recasens wrote: > Hello, > > I'm new in Fieldtrip and I find myself needed of some help :) > I'm currently analysing some MEG data (4D-Neuroimaging, Magnes > 2500WH) and trying to create a Single-Shell headmodel using a > segmented mri. > . I've read all the documentation on FT website but I'm still stuck. > The volume never fits in the correct position inside the sensor > helmet. > > First of all, I create a segmented MRI using Analyse images > (.img'), and the segmentation is performed using: > cfg.coordinates = 'spm'; > cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates > \T1.mnc'; > segmentedmri = ft_volumesegment (cfg, mri); > segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior > volumerealign. > > Then, I do a volumerealign by selecting manually the fiducial points > (Nas, Lpa, Rpa), as I actually don't have fiducials on the MRI scans. > cfg.method = 'realignfiducial'; > cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) > cfg.fiducial.lpa = Lpa; > cfg.fiducial.rpa = Rpa; > segmented_r = ft_volumerealign (cfg, segmentedmri); > > > Finally I create a volume through the ft_prepare_singleshell (cfg, > segmented_r) function and plot it. > I have the fiducials or head position coils and the scalp registered > by means of a Polhemus digitizer.. > Though the segment via ft_sourceplot (doing the: segment.avg.pow = > segment.gray+...) looks right, the headmodelplot shows that the > volume and the headshape don't fit. > > Is there any possibility to realign the segmented mri according > either to the headshape points either to the MEG fiducials? I'm > afraid the answer is no in both cases (as the MRI and MEG > coordinates are different). I tried to realign the segment > interactively by selecting the positions where the coils in the MRI > should be... but as the picture shows, it doesn't fit. > am I doing something wrong or skipping some important step? > Is it possible to transform MRI coordinate system to MEG-head > coordinate system? Would it help? > > > > I attach a picture of what i've managed to do till now! > > > > Thanks for all!!! > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > > ---------------------------------- > > The aim of this list 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/ > Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mlindegaard at MSN.COM Fri May 7 14:43:57 2010 From: mlindegaard at MSN.COM (Mette Lindegaard) Date: Fri, 7 May 2010 14:43:57 +0200 Subject: File format and source reconstruction Message-ID: Dear FiledTrip experts, We are two engineering students from the Technical University of Denmark right now writing a bachlor project about EEG source reconstruction. We have EEG-data from 16 patients in the file format .rec. The data is already preprocessed and divided into artefact free segments of approximately 1-3 seconds. We have already converted the data to .mat format, where there is a .mat file for each of the 19 electrodes and segment. Our first challenge is to import the data into something fieldtrip recognizes, whereafter our main goal is to calculate a 3D source reconstruction with the LORETA algorithm. We hope that this isn't a too big question for you to answer. Best regards Sofie Therese Hansen and Mette Lindegaard. _________________________________________________________________ Surfa tryggt med Internet Explorer 8 http://www.microsoft.com/sverige/windows/internet-explorer/default.aspx ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From grion at SISSA.IT Fri May 7 16:06:27 2010 From: grion at SISSA.IT (Natalia Grion) Date: Fri, 7 May 2010 16:06:27 +0200 Subject: Error: checkdata at 381 This function requires raw data as input Message-ID: Dear all, I have this error when running freqanalysis: ??? Error using ==> checkdata at 381 This function requires raw data as input. My data comes from a preprocessing procedure where i just append daily sessions with 8 channel lfp recordings and several trials from the same subject) and it has this shape: hdr: [1x1 struct] label: {8x1 cell} trial: {1x349 cell} time: {1x349 cell} fsample: 2003 cfg: [1x1 struct] when i run checkdata alone I obtain the message i expect: B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset','yes'); the input is raw data with 8 channels and 349 trials This error message sounds odd to me as I never had this problem in the past. I changed to Matlab 2009a in a 64bit win system (Could this info help to solve the problem?) Any idea? Thanks in advance. Natalia ---------------------------------------------------------------- SISSA Webmail https://webmail.sissa.it/ Powered by SquirrelMail http://www.squirrelmail.org/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Fri May 7 16:12:43 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Fri, 7 May 2010 16:12:43 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <58071.147.122.60.164.1273241187.squirrel@webmail.sissa.it> Message-ID: Hi Natalia, Could you post the cfg-settings you use when calling ft_freqanalysis and the full matlab error output? This will help us track down the cause of the error. Also, did you use ft_appenddata for appending your recordings or did you do it by hand? Best, Roemer On 5/7/2010 4:06 PM, Natalia Grion wrote: > Dear all, > I have this error when running freqanalysis: > ??? Error using ==> checkdata at 381 > This function requires raw data as input. > My data comes from a preprocessing procedure where i just append daily > sessions with 8 channel lfp recordings and several trials from the same > subject) and it has this shape: > > hdr: [1x1 struct] > label: {8x1 cell} > trial: {1x349 cell} > time: {1x349 cell} > fsample: 2003 > cfg: [1x1 struct] > > when i run checkdata alone I obtain the message i expect: > B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', > 'hasoffset','yes'); > the input is raw data with 8 channels and 349 trials > This error message sounds odd to me as I never had this problem in the past. > I changed to Matlab 2009a in a 64bit win system (Could this info help to > solve the problem?) > Any idea? > Thanks in advance. > Natalia > > > > > ---------------------------------------------------------------- > SISSA Webmail https://webmail.sissa.it/ > Powered by SquirrelMail http://www.squirrelmail.org/ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jan.schoffelen at DONDERS.RU.NL Fri May 7 16:18:27 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Fri, 7 May 2010 16:18:27 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <4BE41FDB.7060508@donders.ru.nl> Message-ID: Adding to Roemer's questions: What is the fieldtrip version you are using? Next to this, it is also insightful/helpful to look into what causes the error yourself: if you type dbstop if error on the command line, when the function crashes you end up within the local workspace of the crashing function, allowing you to investigate the cause of your error. Best, Jan-Mathijs On May 7, 2010, at 4:12 PM, Roemer van der Meij wrote: > Hi Natalia, > > Could you post the cfg-settings you use when calling ft_freqanalysis > and the full matlab error output? This will help us track down the > cause of the error. Also, did you use ft_appenddata for appending > your recordings or did you do it by hand? > > Best, > Roemer > > > > > On 5/7/2010 4:06 PM, Natalia Grion wrote: >> Dear all, >> I have this error when running freqanalysis: >> ??? Error using ==> checkdata at 381 >> This function requires raw data as input. >> My data comes from a preprocessing procedure where i just append >> daily >> sessions with 8 channel lfp recordings and several trials from the >> same >> subject) and it has this shape: >> >> hdr: [1x1 struct] >> label: {8x1 cell} >> trial: {1x349 cell} >> time: {1x349 cell} >> fsample: 2003 >> cfg: [1x1 struct] >> >> when i run checkdata alone I obtain the message i expect: >> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >> 'hasoffset','yes'); >> the input is raw data with 8 channels and 349 trials >> This error message sounds odd to me as I never had this problem in >> the past. >> I changed to Matlab 2009a in a 64bit win system (Could this info >> help to >> solve the problem?) >> Any idea? >> Thanks in advance. >> Natalia >> >> >> >> >> ---------------------------------------------------------------- >> SISSA Webmail https://webmail.sissa.it/ >> Powered by SquirrelMail http://www.squirrelmail.org/ >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From grion at SISSA.IT Fri May 7 16:28:12 2010 From: grion at SISSA.IT (Natalia Grion) Date: Fri, 7 May 2010 16:28:12 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <4BE41FDB.7060508@donders.ru.nl> Message-ID: Sure. here are the settings, cfgfreqan=[]; cfgfreqan.method= 'wltconvol'; cfgfreqan.output = 'pow'; cfgfreqan.channel = {'H_LFP_1'}; cfgfreqan.keeptrials = 'no'; cfgfreqan.foi = [4:0.1:12]; cfgfreqan.toi = [-2:0.010:2]; cfgfreqan.width = 5; freqout=freqanalysis(cfgfreqan,data); And the full matlab error message: ??? Error using ==> checkdata at 381 This function requires raw data as input. Error in ==> freqanalysis at 165 data = checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset', 'yes'); Error in ==> Spctrgrm_ThetaWlt_AllRats at 25 freqout=freqanalysis(cfgfreqan,data); About appending data: I'm using appenddata function, which generate the structure I wrote in the past mail. Hope this info helps, Natalia > Hi Natalia, > > Could you post the cfg-settings you use when calling ft_freqanalysis and > the full matlab error output? This will help us track down the cause of > the error. Also, did you use ft_appenddata for appending your recordings > or did you do it by hand? > > Best, > Roemer > > > > > On 5/7/2010 4:06 PM, Natalia Grion wrote: >> Dear all, >> I have this error when running freqanalysis: >> ??? Error using ==> checkdata at 381 >> This function requires raw data as input. >> My data comes from a preprocessing procedure where i just append daily >> sessions with 8 channel lfp recordings and several trials from the same >> subject) and it has this shape: >> >> hdr: [1x1 struct] >> label: {8x1 cell} >> trial: {1x349 cell} >> time: {1x349 cell} >> fsample: 2003 >> cfg: [1x1 struct] >> >> when i run checkdata alone I obtain the message i expect: >> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >> 'hasoffset','yes'); >> the input is raw data with 8 channels and 349 trials >> This error message sounds odd to me as I never had this problem in the >> past. >> I changed to Matlab 2009a in a 64bit win system (Could this info help to >> solve the problem?) >> Any idea? >> Thanks in advance. >> Natalia >> >> >> >> >> ---------------------------------------------------------------- >> SISSA Webmail https://webmail.sissa.it/ >> Powered by SquirrelMail http://www.squirrelmail.org/ >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------------------------------------- SISSA Webmail https://webmail.sissa.it/ Powered by SquirrelMail http://www.squirrelmail.org/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From grion at SISSA.IT Fri May 7 16:43:18 2010 From: grion at SISSA.IT (Natalia Grion) Date: Fri, 7 May 2010 16:43:18 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: Message-ID: I'm being running fieldtrip-20090629, but i also test this problem for a newest version (fieldtrip-20100418) that gave me the same error. I also tried to go into the error to see which is the cause: when inspecting checkdata result on the line israw = datatype(data, 'raw'); gives me israw= 0 which is not the case on my data as it has all the fields and types necessary to be classified as "israw" israw = isfield(data, 'label') && isfield(data, 'time') && isa(data.time, 'cell') && isfield(data, 'trial') && isa(data.trial, 'cell'); I explained before that when running checkdata independently of freqanalysis it works. hope this info also helps, natalia > Adding to Roemer's questions: > > What is the fieldtrip version you are using? > Next to this, it is also insightful/helpful to look into what causes > the error yourself: if you type dbstop if error on the command line, > when the function crashes you end up within the local workspace of the > crashing function, allowing you to investigate the cause of your error. > > Best, > > Jan-Mathijs > > On May 7, 2010, at 4:12 PM, Roemer van der Meij wrote: > >> Hi Natalia, >> >> Could you post the cfg-settings you use when calling ft_freqanalysis >> and the full matlab error output? This will help us track down the >> cause of the error. Also, did you use ft_appenddata for appending >> your recordings or did you do it by hand? >> >> Best, >> Roemer >> >> >> >> >> On 5/7/2010 4:06 PM, Natalia Grion wrote: >>> Dear all, >>> I have this error when running freqanalysis: >>> ??? Error using ==> checkdata at 381 >>> This function requires raw data as input. >>> My data comes from a preprocessing procedure where i just append >>> daily >>> sessions with 8 channel lfp recordings and several trials from the >>> same >>> subject) and it has this shape: >>> >>> hdr: [1x1 struct] >>> label: {8x1 cell} >>> trial: {1x349 cell} >>> time: {1x349 cell} >>> fsample: 2003 >>> cfg: [1x1 struct] >>> >>> when i run checkdata alone I obtain the message i expect: >>> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >>> 'hasoffset','yes'); >>> the input is raw data with 8 channels and 349 trials >>> This error message sounds odd to me as I never had this problem in >>> the past. >>> I changed to Matlab 2009a in a 64bit win system (Could this info >>> help to >>> solve the problem?) >>> Any idea? >>> Thanks in advance. >>> Natalia >>> >>> >>> >>> >>> ---------------------------------------------------------------- >>> SISSA Webmail https://webmail.sissa.it/ >>> Powered by SquirrelMail http://www.squirrelmail.org/ >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> -- >> Roemer van der Meij MSc >> Scientific Programmer& Data-Analyst >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3612631 >> E-mail: r.vandermeij at donders.ru.nl >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. > > Dr. J.M. (Jan-Mathijs) Schoffelen > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > J.Schoffelen at donders.ru.nl > Telephone: 0031-24-3668063 > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------------------------------------- SISSA Webmail https://webmail.sissa.it/ Powered by SquirrelMail http://www.squirrelmail.org/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From recasensmarc at GMAIL.COM Fri May 7 16:59:03 2010 From: recasensmarc at GMAIL.COM (Marc Recasens) Date: Fri, 7 May 2010 16:59:03 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Thanks Jan for the rapid response, I followed the steps using ctf coords and the segmented volume fits perfectly well in the skull using sourceplot. The volume seems to fit better into the headshape. However, as can be seen in the picture, there's still a big space from the posterior part of the brain to the posterior part of the head shape. I suppose this Can be due to a bad realignment (?). As I mentioned, I have no fiducial points in the MRI scans, so I have to select the nas, lpa and rpa with no physical reference. I guess there is no alternative in this case but using another volume or trying to align the volume manually until it fits in the headshape, isn't it? Can the volume segment be aligned in connection to the headshape automatically? thank you for the help! Bests, [image: CTFvolume.jpg] On Fri, May 7, 2010 at 9:01 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Dear Marc, > > It seems to me that there is an issue with the coordinate system in which > your original MRI is expressed. This could be related to the order of the > steps you take, so I would permute the order and see whether this makes any > difference at all (for me it usually works fine as follows:) > > First do a call to ft_volumerealign using your single subject's MRI. This > step should give you the transformation matrix from voxel to headspace > according to CTF's convention (which happens to be the same as 4d). > Then do a segmentation of the output of ft_volumerealign, but note that you > should specify ctf.coordinates = 'ctf'. > Then you can proceed to create the single shell volume conductor model > (after checking whether the segmentation worked fine with respect to the > orientation etc of the resulting volumes; I believe there is some > documentation about this on the website) and plot the results. > > Hopefully this helps, > > Best, > > Jan-Mathijs > > On May 6, 2010, at 8:38 PM, Marc Recasens wrote: > > Hello, > > I'm new in Fieldtrip and I find myself needed of some help :) > I'm currently analysing some MEG data (4D-Neuroimaging, Magnes 2500WH) and > trying to create a Single-Shell headmodel using a segmented mri. > . I've read all the documentation on FT website but I'm still stuck. The > volume never fits in the correct position inside the sensor helmet. > > First of all, I create a segmented MRI using Analyse images (.img'), and > the segmentation is performed using: > cfg.coordinates = 'spm'; > cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates\T1.mnc'; > segmentedmri = ft_volumesegment (cfg, mri); > segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior > volumerealign. > > Then, I do a volumerealign by selecting manually the fiducial points (Nas, > Lpa, Rpa), as I actually don't have fiducials on the MRI scans. > cfg.method = 'realignfiducial'; > cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) > cfg.fiducial.lpa = Lpa; > cfg.fiducial.rpa = Rpa; > segmented_r = ft_volumerealign (cfg, segmentedmri); > > > Finally I create a volume through the ft_prepare_singleshell (cfg, > segmented_r) function and plot it. > I have the fiducials or head position coils and the scalp registered by > means of a Polhemus digitizer.. > Though the segment via ft_sourceplot (doing the: segment.avg.pow = > segment.gray+...) looks right, the headmodelplot shows that the volume and > the headshape don't fit. > > Is there any possibility to realign the segmented mri according either to > the headshape points either to the MEG fiducials? I'm afraid the answer is > no in both cases (as the MRI and MEG coordinates are different). I tried to > realign the segment interactively by selecting the positions where the coils > in the MRI should be... but as the picture shows, it doesn't fit. > am I doing something wrong or skipping some important step? > Is it possible to transform MRI coordinate system to MEG-head coordinate > system? Would it help? > > > > > I attach a picture of what i've managed to do till now! > > > > Thanks for all!!! > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > > ---------------------------------- > > The aim of this list 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/ > > > Dr. J.M. (Jan-Mathijs) Schoffelen > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > J.Schoffelen at donders.ru.nl > Telephone: 0031-24-3668063 > > ---------------------------------- > > The aim of this list 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/ > -- Marc Recasens Tel.: +34 639 24 15 98 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CTFvolume.jpg Type: image/jpeg Size: 28004 bytes Desc: not available URL: From nathanweisz at MAC.COM Fri May 7 17:24:25 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Fri, 7 May 2010 17:24:25 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Dear Marc, we use nutmeg to do co-registration. http://nutmeg.berkeley.edu/index.php?title=Main_Page in a first step we define fiducials manually, similar to volumerealign. in a second step -with the help of a magic button doing "complex things" (or was it stuff)- you can use the headshape to get even some better matching. then from the command line: global nuts st %mri is the MRI structure read into firldtrip with read_fcdc_mri mri.transform=inv(nuts.coreg.meg2mri_tfm)*st.vols{1}.mat; from there on you can continue with your forward modeling as before. good luck, nathan On 07.05.2010, at 16:59, Marc Recasens wrote: > Thanks Jan for the rapid response, > > I followed the steps using ctf coords and the segmented volume fits perfectly well in the skull using sourceplot. The volume seems to fit better into the headshape. However, as can be seen in the picture, there's still a big space from the posterior part of the brain to the posterior part of the head shape. I suppose this Can be due to a bad realignment (?). As I mentioned, I have no fiducial points in the MRI scans, so I have to select the nas, lpa and rpa with no physical reference. I guess there is no alternative in this case but using another volume or trying to align the volume manually until it fits in the headshape, isn't it? Can the volume segment be aligned in connection to the headshape automatically? > > thank you for the help! > > Bests, > > > > > > On Fri, May 7, 2010 at 9:01 AM, jan-mathijs schoffelen wrote: > Dear Marc, > > It seems to me that there is an issue with the coordinate system in which your original MRI is expressed. This could be related to the order of the steps you take, so I would permute the order and see whether this makes any difference at all (for me it usually works fine as follows:) > > First do a call to ft_volumerealign using your single subject's MRI. This step should give you the transformation matrix from voxel to headspace according to CTF's convention (which happens to be the same as 4d). > Then do a segmentation of the output of ft_volumerealign, but note that you should specify ctf.coordinates = 'ctf'. > Then you can proceed to create the single shell volume conductor model (after checking whether the segmentation worked fine with respect to the orientation etc of the resulting volumes; I believe there is some documentation about this on the website) and plot the results. > > Hopefully this helps, > > Best, > > Jan-Mathijs > > On May 6, 2010, at 8:38 PM, Marc Recasens wrote: > >> Hello, >> >> I'm new in Fieldtrip and I find myself needed of some help :) >> I'm currently analysing some MEG data (4D-Neuroimaging, Magnes 2500WH) and trying to create a Single-Shell headmodel using a segmented mri. >> . I've read all the documentation on FT website but I'm still stuck. The volume never fits in the correct position inside the sensor helmet. >> >> First of all, I create a segmented MRI using Analyse images (.img'), and the segmentation is performed using: >> cfg.coordinates = 'spm'; >> cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates\T1.mnc'; >> segmentedmri = ft_volumesegment (cfg, mri); >> segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior volumerealign. >> >> Then, I do a volumerealign by selecting manually the fiducial points (Nas, Lpa, Rpa), as I actually don't have fiducials on the MRI scans. >> cfg.method = 'realignfiducial'; >> cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) >> cfg.fiducial.lpa = Lpa; >> cfg.fiducial.rpa = Rpa; >> segmented_r = ft_volumerealign (cfg, segmentedmri); >> >> >> Finally I create a volume through the ft_prepare_singleshell (cfg, segmented_r) function and plot it. >> I have the fiducials or head position coils and the scalp registered by means of a Polhemus digitizer.. >> Though the segment via ft_sourceplot (doing the: segment.avg.pow = segment.gray+...) looks right, the headmodelplot shows that the volume and the headshape don't fit. >> >> Is there any possibility to realign the segmented mri according either to the headshape points either to the MEG fiducials? I'm afraid the answer is no in both cases (as the MRI and MEG coordinates are different). I tried to realign the segment interactively by selecting the positions where the coils in the MRI should be... but as the picture shows, it doesn't fit. >> am I doing something wrong or skipping some important step? >> Is it possible to transform MRI coordinate system to MEG-head coordinate system? Would it help? >> >> >> >> >> I attach a picture of what i've managed to do till now! >> >> >> >> Thanks for all!!! >> >> >> >> -- >> Marc Recasens >> Tel.: +34 639 24 15 98 >> >> ---------------------------------- >> >> The aim of this list 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/ >> > > Dr. J.M. (Jan-Mathijs) Schoffelen > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > J.Schoffelen at donders.ru.nl > Telephone: 0031-24-3668063 > > ---------------------------------- > > The aim of this list 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/ > > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.doron at GMAIL.COM Sat May 8 19:04:05 2010 From: karl.doron at GMAIL.COM (Karl Doron) Date: Sat, 8 May 2010 19:04:05 +0200 Subject: redefinetrial on freq output Message-ID: Hello, Is it possible to use redefine trial on data from freqanalysis? I need to do the frequency analysis on long segments of data to recover low frequencies, but am interested in comparing one cycle of alpha at two non-overlapping time segments within each trial. Thanks, karl doron ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From nathanweisz at MAC.COM Sat May 8 21:55:23 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Sat, 8 May 2010 21:55:23 +0200 Subject: redefinetrial on freq output In-Reply-To: Message-ID: hi, the documentation of ft_redefinetrial says that it wants the output of preprocessing.m. however, using nearest.m it should be very easy to make your home-made "redefinefreq" function. good luck, nathan On 08.05.2010, at 19:04, Karl Doron wrote: > Hello, > > Is it possible to use redefine trial on data from freqanalysis? I need to do the frequency > analysis on long segments of data to recover low frequencies, but am interested in > comparing one cycle of alpha at two non-overlapping time segments within each trial. > > Thanks, > karl doron > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Mon May 10 09:27:21 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Mon, 10 May 2010 09:27:21 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <58253.147.122.60.164.1273243398.squirrel@webmail.sissa.it> Message-ID: Hi Natalia, Thanks for all the extra information, that really helps in getting to the bottom of the bug. I still can't see any reason though why you should get the errors you're getting. Could you perhaps append a small bit of the data (e.g. 2 or 3 trials, a few MB's max) so I can track the data as it goes through the code using the settings you already provided? Best, Roemer On 5/7/2010 4:43 PM, Natalia Grion wrote: > I'm being running fieldtrip-20090629, but i also test this problem for a > newest version (fieldtrip-20100418) that gave me the same error. I also > tried to go into the error to see which is the cause: when inspecting > checkdata result on the line > israw = datatype(data, 'raw'); > gives me israw= 0 > which is not the case on my data as it has all the fields and types > necessary to be classified as "israw" > israw = isfield(data, 'label')&& isfield(data, 'time')&& > isa(data.time, 'cell')&& isfield(data, 'trial')&& isa(data.trial, > 'cell'); > I explained before that when running checkdata independently of > freqanalysis it works. > hope this info also helps, > natalia > > > >> Adding to Roemer's questions: >> >> What is the fieldtrip version you are using? >> Next to this, it is also insightful/helpful to look into what causes >> the error yourself: if you type dbstop if error on the command line, >> when the function crashes you end up within the local workspace of the >> crashing function, allowing you to investigate the cause of your error. >> >> Best, >> >> Jan-Mathijs >> >> On May 7, 2010, at 4:12 PM, Roemer van der Meij wrote: >> >> >>> Hi Natalia, >>> >>> Could you post the cfg-settings you use when calling ft_freqanalysis >>> and the full matlab error output? This will help us track down the >>> cause of the error. Also, did you use ft_appenddata for appending >>> your recordings or did you do it by hand? >>> >>> Best, >>> Roemer >>> >>> >>> >>> >>> On 5/7/2010 4:06 PM, Natalia Grion wrote: >>> >>>> Dear all, >>>> I have this error when running freqanalysis: >>>> ??? Error using ==> checkdata at 381 >>>> This function requires raw data as input. >>>> My data comes from a preprocessing procedure where i just append >>>> daily >>>> sessions with 8 channel lfp recordings and several trials from the >>>> same >>>> subject) and it has this shape: >>>> >>>> hdr: [1x1 struct] >>>> label: {8x1 cell} >>>> trial: {1x349 cell} >>>> time: {1x349 cell} >>>> fsample: 2003 >>>> cfg: [1x1 struct] >>>> >>>> when i run checkdata alone I obtain the message i expect: >>>> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >>>> 'hasoffset','yes'); >>>> the input is raw data with 8 channels and 349 trials >>>> This error message sounds odd to me as I never had this problem in >>>> the past. >>>> I changed to Matlab 2009a in a 64bit win system (Could this info >>>> help to >>>> solve the problem?) >>>> Any idea? >>>> Thanks in advance. >>>> Natalia >>>> >>>> >>>> >>>> >>>> ---------------------------------------------------------------- >>>> SISSA Webmail https://webmail.sissa.it/ >>>> Powered by SquirrelMail http://www.squirrelmail.org/ >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between users >>>> of the FieldTrip toolbox, to share experiences and to discuss new >>>> ideas for MEG and EEG analysis. See also >>>> http://listserv.surfnet.nl/archives/fieldtrip.html >>>> and http://www.ru.nl/neuroimaging/fieldtrip. >>>> >>>> >>> -- >>> Roemer van der Meij MSc >>> Scientific Programmer& Data-Analyst >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognition >>> P.O. Box 9104 >>> 6500 HE Nijmegen >>> The Netherlands >>> Tel: +31(0)24 3612631 >>> E-mail: r.vandermeij at donders.ru.nl >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> Dr. J.M. (Jan-Mathijs) Schoffelen >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> J.Schoffelen at donders.ru.nl >> Telephone: 0031-24-3668063 >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > > ---------------------------------------------------------------- > SISSA Webmail https://webmail.sissa.it/ > Powered by SquirrelMail http://www.squirrelmail.org/ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From tadel at USC.EDU Mon May 10 22:55:42 2010 From: tadel at USC.EDU (=?ISO-8859-1?Q?Fran=E7ois_Tadel?=) Date: Mon, 10 May 2010 13:55:42 -0700 Subject: Engineer position at USC, Los Angeles, January 2011 Message-ID: Dear all, Below is the description of a position opening at USC, Los Angeles, in January 2011. Thanks for spreading the word. Francois Tadel ------------------------------------------------------------------------ Research Programmer, University of Southern California, Los Angeles, USA The Department of Electrical Engineering at the University of Southern California is seeking a research programmer to participate in the development, distribution and support of software for functional brain mapping. The programmer will be responsible for implementing software for all phases of the analysis of magnetoencephalograpy (MEG) and electroencephalography (EEG) data and its integration of other functional and structural imaging modalities. The resulting software, which will be developed under grant support from the National Institutes of Health, will be distributed to researchers throughout the US and the rest of the world, for analysis of data collected in cognitive neuroscience and clinical research studies. This project will be conducted under the supervision of Professor Richard Leahy in the Department of Electrical Engineering and will involve close collaboration with researchers at USC and other institutions. Responsibilities * Play a leading role in developing common workflow, data structures, and file formats for use in analysis of MEG and EEG data. * Develop and document code to implement algorithms for analysis and display of M/EEG data. * Development of procedures for automated testing of software and software updates. * Develop and support procedures for distribution and documentation of new software. * Participate in training of users * Participate in research meetings and interact with PhD students, postdocs and research faculty in Dr. Leahy's lab in the development of new approaches to the analysis of MEG and EEG data. * Work with collaborators who are also developing software to facilitate interoperability between software packages with the ultimate goal of producing a single software package for EEG and MEG data analysis. * More information about Brainstorm, the existing software package: http://neuroimage.usc.edu/brainstorm Minimum qualifications * Masters Degree in Computer Science or Electrical Engineering * 2 years post graduate experience * Knowledge of the basic principles underlying EEG and MEG signal processing * Programming experience with Matlab and Java Conditions of employment * Starting from January 2011 * Duration: position available for a minimum of two years * Salary: depends on experience and qualifications * USC has excellent benefits, including health benefits and retirement plans with employer contributions after six months. * The University of Southern California values diversity and is committed to equal opportunity in employment. Application * To apply, please send an email to Francois Tadel, main developer of the Brainstorm software: tadel at usc.edu. * Your application should include: your CV, a description of your programming skills, a detailed description of your previous software development projects. * Application deadline: Open until filled. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aardesta at UCLA.EDU Thu May 13 00:44:42 2010 From: aardesta at UCLA.EDU (Allen Ardestani) Date: Wed, 12 May 2010 15:44:42 -0700 Subject: Error in timelockstatistics Message-ID: Hi everyone, I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: method: 'montecarlo' statistic: 'indepsamplesT' correctm: 'cluster' clusteralpha: 0.0500 clusterstatistic: 'maxsum' tail: 0 clustertail: 0 alpha: 0.0250 numrandomization: 100 design: [1x267 double] channel: 'F1' minnbchan: 0 layout: 'layout.mat' ivar: 1 I get the following error message: ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. Error in ==> findcluster at 89 [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); Error in ==> clusterstat at 194 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> statistics_montecarlo at 321 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 285 [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); Error in ==> ft_timelockstatistics at 96 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I'm assuming that part of the problem is that I don't have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I'm a new user, so any advice is much appreciated. Thanks in advance! ____________________________________________________________________________ ______ Allen Ardestani Email: aardesta at ucla.edu Phone: (310) 825-5528 Medical Scientist Training Program David Geffen School of Medicine at UCLA Semel Institute for Neuroscience and Human Behavior 760 Westwood Plaza Los Angeles, CA 90095-1759 USA ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at MAC.COM Thu May 13 10:21:45 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Thu, 13 May 2010 10:21:45 +0200 Subject: Error in timelockstatistics In-Reply-To: <000c01caf224$b705de40$25119ac0$@edu> Message-ID: Dear Allen, you need bwlabeln anyhow, no matter how you want to cluster (the function can cluster in n-dimensions). so getting the Image Processing Toolbox may be a good investment if you decide to use fieldtrip statistics in future. an -untested- alternative may be to use the octave version of bwlabeln. usually the code is very compatible to matlab, i.e. if it does not run out-of-the-box it usually just needs a little tweaking. however it may be a lot slower. http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/image/bwlabel.m http://www.gnu.org/software/octave/index.html good luck, nathan On 13.05.2010, at 00:44, Allen Ardestani wrote: > Hi everyone, > I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: > > method: 'montecarlo' > statistic: 'indepsamplesT' > correctm: 'cluster' > clusteralpha: 0.0500 > clusterstatistic: 'maxsum' > tail: 0 > clustertail: 0 > alpha: 0.0250 > numrandomization: 100 > design: [1x267 double] > channel: 'F1' > minnbchan: 0 > layout: 'layout.mat' > ivar: 1 > > > I get the following error message: > > ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. > > Error in ==> findcluster at 89 > [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); > > Error in ==> clusterstat at 194 > posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); > > Error in ==> statistics_montecarlo at 321 > [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); > > Error in ==> statistics_wrapper at 285 > [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); > > Error in ==> ft_timelockstatistics at 96 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > I’m assuming that part of the problem is that I don’t have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I’m a new user, so any advice is much appreciated. > > Thanks in advance! > __________________________________________________________________________________ > Allen Ardestani Email: aardesta at ucla.edu > Phone: (310) 825-5528 > Medical Scientist Training Program > David Geffen School of Medicine at UCLA > Semel Institute for Neuroscience and Human Behavior > 760 Westwood Plaza > Los Angeles, CA 90095-1759 > USA > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From teristam at GMAIL.COM Wed May 19 05:59:16 2010 From: teristam at GMAIL.COM (teris tam) Date: Wed, 19 May 2010 11:59:16 +0800 Subject: Some suggestion for improving performance in reading buffer event in ft_read_event Message-ID: Dear all, When I am profiling the performance of reading buffer event in ft_read_event, in around line 710, I see the following code causing a performance neck: for i=1:length(evt) % convert the field "type" into the Matlab representation this_type = type{evt(i).type_type+1}; this_size = wordsize{evt(i).type_type+1} * evt(i).type_numel; sel = 1:this_size; if strcmp(this_type, 'char') event(i).type = char(evt(i).buf(sel)); else event(i).type = typecast(evt(i).buf(sel), this_type); end . . . end If I understand correctly, what the code is currently doing is to read a maximum of 100 events (the number 100 was obtained from my observation when the code was running) from the buffer and then typcast all of them. Filtering of the event is then done by ft_filter_event. However, event(i) is growing inside a loop and has significant negative impact on performance. The impact is even larger in real-time processing because very often we need to keep polling the event information from the buffer. In most of the case, reading such a large number of event to search for the required event type is not necessary because there is only a handful of states in the experimental paradigm. So I suggest we add a "maxsearch" option to let the user set how many total events they want to read from the buffer to search for the required event: *In ft_read_event, after:* flt_mintimestamp = keyval('mintimestamp', varargin); flt_maxtimestamp = keyval('maxtimestamp', varargin); flt_minnumber = keyval('minnumber', varargin); flt_maxnumber = keyval('maxnumber', varargin); *add:* flt_maxsearch = keyval('maxsearch',varargin); *then around line 710, before:* for i=1:length(evt) % convert the field "type" into the Matlab representation this_type = type{evt(i).type_type+1}; this_size = wordsize{evt(i).type_type+1} * evt(i).type_numel; sel = 1:this_size; if strcmp(this_type, 'char') event(i).type = char(evt(i).buf(sel)); else event(i).type = typecast(evt(i).buf(sel), this_type); end . . . end *add:* if(~isempty(flt_maxsearch)) evt=evt((end-flt_maxsearch+1):end); end I have done some profiling and it does improve the performance. Hope that helps. Best regards, Teris ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fraschini at UNICA.IT Wed May 19 15:51:51 2010 From: fraschini at UNICA.IT (Matteo Fraschini) Date: Wed, 19 May 2010 15:51:51 +0200 Subject: Clusterplot problem Message-ID: Dear all, I am currently working on a study involving Activation vs Baseline paradigm on MEG data. By using FT preprocessing, analysis and plotting functions I really can see what I expected to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation tests on time-frequency data following the web tutorial. The analysis shows significative cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with ft_clusterplot) is significative cluster but in region/channels with no frequency differences from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference is more evident. Looks like channels are not correctly placed in the plot. Any suggestions? Thank you very much, Matteo ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jan.schoffelen at DONDERS.RU.NL Wed May 19 16:37:06 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Wed, 19 May 2010 16:37:06 +0200 Subject: use of spm within fieldtrip Message-ID: Dear all, I just made some changes to the fieldtrip code relating to the spm- version used for spatial normalisation, segmentation and smoothing. These changes affect the functions ft_volumesegment, ft_volumenormalise and ft_volumedownsample. Up until now, fieldtrip relied on spm2 to do the morphological operations on anatomical MRIs (and actually crashed when trying to use spm8). I changed the default spm-version to be used into spm8. This means that in order for this to work you need spm8 on your matlab path. People who would prefer to keep using spm2 for spatial normalisation and segmentation should specify cfg.spmversion = 'spm2' before calling ft_volumenormalise or ft_volumesegment. Cheers, Jan-Mathijs Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Thu May 20 10:24:07 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Thu, 20 May 2010 10:24:07 +0200 Subject: Clusterplot problem In-Reply-To: Message-ID: Hi Matteo, What FieldTrip version are you using? There have been some changes in the past few months in the functions you use. Could you post all the cfg-settings you used (from statistical analysis onwards)? Best, Roemer On 5/19/2010 3:51 PM, wrote: > Dear all, > I am currently working on a study involving Activation vs Baseline paradigm on MEG data. > By using FT preprocessing, analysis and plotting functions I really can see what I expected > to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation > tests on time-frequency data following the web tutorial. The analysis shows significative > cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with > ft_clusterplot) is significative cluster but in region/channels with no frequency differences > from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference > is more evident. Looks like channels are not correctly placed in the plot. > Any suggestions? > Thank you very much, > Matteo > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From karl.doron at GMAIL.COM Thu May 20 20:41:09 2010 From: karl.doron at GMAIL.COM (Karl Doron) Date: Thu, 20 May 2010 20:41:09 +0200 Subject: averaging Hilbert amplitudes Message-ID: Hello, I wonder if anyone can help me understand (or point me to a reference) the practical consequences of getting the analytic amplitudes of individual trials and then averaging those vs. averaging band pass filtered data, and then getting the analytic amplitude. Many thanks, karl doron ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From adrian.m.bartlett at GMAIL.COM Thu May 20 20:53:35 2010 From: adrian.m.bartlett at GMAIL.COM (Adrian Bartlett) Date: Thu, 20 May 2010 14:53:35 -0400 Subject: averaging Hilbert amplitudes In-Reply-To: Message-ID: Hi Karl, In short, the former method gives you a mixture of time-locked power changes and and the inter-trial phase coherence, since departures from perfect phase locking will attenuate the amplitude of the average of your trials in the time domain. Taking the hilbert amplitude envelope of single trials and then averaging will yield the closest we can get the 'induced' response, or time-locked power changes. To reiterate, averaging in the time domain confounds power changes and phase differences between trials. A good paper that touches on these topics is Makeig et al. (2004) "Mining event-related brain dynamics". I'm sure my comments on single-trial power as the 'induced' response will cause a stir here, and if you look in the archives there are extensive past discussions on the topic of isolating the 'induced' response from the 'evoked' (phase-locked) Hope that helps some, - Adrian M. Bartlett Department of Psychology (MA Candidate) Neuroscience Graduate Diploma Program Perception & Plasticity Laboratory Centre for Vision Research York University http://www.yorku.ca/~khoffman/ On Thu, May 20, 2010 at 2:41 PM, Karl Doron wrote: > Hello, > > I wonder if anyone can help me understand (or point me to a reference) the > practical > consequences of getting the analytic amplitudes of individual trials and > then averaging those > vs. averaging band pass filtered data, and then getting the analytic > amplitude. > > Many thanks, > karl doron > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fraschini at UNICA.IT Fri May 21 13:09:21 2010 From: fraschini at UNICA.IT (Matteo Fraschini) Date: Fri, 21 May 2010 13:09:21 +0200 Subject: Clusterplot problem In-Reply-To: <4BF4F1A7.30203@donders.ru.nl> Message-ID: Hi Roemer, I tried using the last FT version with same results. This is the code for statistic: function [stat]=withinSubjs(GA_act,GA_bl) cfg = []; cfg.channel = {'MEG','-MLT22','-MLT27','-MLO42','-MLO43','-MRT22','-MRT27','-MRO42','-MRO43'}; cfg.frequency = [4 7]; cfg.avgovertime = 'yes'; cfg.avgoverfreq = 'yes'; cfg.method = 'montecarlo'; cfg.statistic = 'actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg.numrandomization = 500; n_subjs=size(GA_act.powspctrm); n_subjs=n_subjs(1); design = zeros(2,2*n_subjs); for i = 1:n_subjs design(1,i) = i; end for i = 1:n_subjs design(1,n_subjs+i) = i; end design(2,1:n_subjs) = 1; design(2,n_subjs+1:2*n_subjs) = 2; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; stat = ft_freqstatistics(cfg,GA_act,GA_bl) You can see the ft_topoplot (with absolute baseline correction) and ft_clusterplot (same time) figures here: http://192.167.154.14/ft/topo.jpg http://192.167.154.14/ft/cluster.jpg I also tried using 'ctf_old' specification when preprocessing my data but an error occurs in ft_megplanar: ??? Index exceeds matrix dimensions. Error in ==> channelposition at 53 sens.pnt = sens.pnt(used,:); Error in ==> megplanar_sincos at 26 [pnt, ori, lab] = channelposition(grad); Any suggestion? Thank you very much, Matteo Il giorno 20/mag/2010, alle ore 10.24, Roemer van der Meij ha scritto: > Hi Matteo, > > What FieldTrip version are you using? There have been some changes in the past few months in the functions you use. > Could you post all the cfg-settings you used (from statistical analysis onwards)? > > Best, > Roemer > > > On 5/19/2010 3:51 PM, wrote: >> Dear all, >> I am currently working on a study involving Activation vs Baseline paradigm on MEG data. >> By using FT preprocessing, analysis and plotting functions I really can see what I expected >> to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation >> tests on time-frequency data following the web tutorial. The analysis shows significative >> cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with >> ft_clusterplot) is significative cluster but in region/channels with no frequency differences >> from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference >> is more evident. Looks like channels are not correctly placed in the plot. >> Any suggestions? >> Thank you very much, >> Matteo >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Fri May 21 13:21:00 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Fri, 21 May 2010 13:21:00 +0200 Subject: Problem with brainvision files Message-ID: Hi fildtrippers! After I've updated fieldtrip I got some problems reading brainvision files I didn't got before. Here are the errors (the only differences in this script are ft_definetrial and ft_preprocessing that before were only definetrial and preprocessing): cfg=[]; cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; cfg.trialdef.eventtype='Stimulus'; cfg.trialdef.eventvalue='S 55'; cfg.trialdef.prestim=2; cfg.trialdef.poststim=1.999; cfg=ft_definetrial(cfg); data=ft_preprocessing(cfg); Warning: no trialfun was specified, using trialfun_general > In ft_definetrial at 95 evaluating trialfunction 'trialfun_general' reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' found 256 events created 41 trials processing channel { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } reading and preprocessing reading and preprocessing trial 1 from 41 Warning: could not open L001_Artifact_Rejection_FeedPos_Bl_1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 390 In ft_read_data at 205 In ft_preprocessing at 466 Warning: could not open L001_Artifact_Rejection_FeedPos_Bl_1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 395 In ft_read_data at 205 In ft_preprocessing at 466 ??? Error using ==> fseek Invalid file identifier. Use fopen to generate a valid file identifier. Error in ==> read_brainvision_eeg at 52 fseek(fid, hdr.NumberOfChannels*4*(begsample-1), 'cof'); Error in ==> ft_read_data at 442 dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample); Error in ==> ft_preprocessing at 466 dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) If I'm trying to use another file that is an average (so no trial to select) and I treat as a continous file I got these other problems: cfg=[]; cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; data=ft_preprocessing(cfg); Warning: cannot determine number of samples for this sub-fileformat > In fileio\private\read_brainvision_vhdr at 95 In ft_read_header at 367 In ft_preprocessing at 294 processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } reading and preprocessing reading and preprocessing trial 1 from 1 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 390 In ft_read_data at 205 In ft_preprocessing at 466 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 395 In ft_read_data at 205 In ft_preprocessing at 466 ??? Error using ==> zeros NaN and Inf not allowed. Error in ==> read_brainvision_eeg at 76 dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); Error in ==> ft_read_data at 442 dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample); Error in ==> ft_preprocessing at 466 dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) do I miss something? regards Marco ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri May 21 14:55:21 2010 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 21 May 2010 13:55:21 +0100 Subject: Problem with brainvision files In-Reply-To: Message-ID: Hi Marco, I've done some changes recently trying to improve the recognition of Brainvision files. These might or might not be related to your problem. Could you perhaps do: dbstop if error and try to get some idea about why the error in filetype_check_header happens. There is some problem with opening the .eeg file but it's not clear what it is. I tried to use code similar to yours on a different brainvision dataset and there is no problem so it may be something that happens on your system for some reason. If you can't figure it out, send me an example dataset via yousendit.com and I'll try to look at it. Best, Vladimir On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: > Hi fildtrippers! > After I've updated fieldtrip I got some problems reading brainvision files I didn't > got before. > > Here are the errors (the only differences in this script are ft_definetrial and > ft_preprocessing that before were only definetrial and preprocessing): > > cfg=[]; > cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; > cfg.trialdef.eventtype='Stimulus'; > cfg.trialdef.eventvalue='S 55'; > cfg.trialdef.prestim=2; > cfg.trialdef.poststim=1.999; > cfg=ft_definetrial(cfg); > data=ft_preprocessing(cfg); > > Warning: no trialfun was specified, using > trialfun_general >> In ft_definetrial at 95 > evaluating trialfunction 'trialfun_general' > reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' > found 256 events > created 41 trials > processing channel > { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' > TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } > reading and preprocessing > reading and preprocessing trial 1 from 41 > Warning: could not open > L001_Artifact_Rejection_FeedPos_Bl_1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 390 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > Warning: could not open > L001_Artifact_Rejection_FeedPos_Bl_1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 395 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > ??? Error using ==> fseek > Invalid file identifier.  Use fopen to generate a valid > file identifier. > > Error in ==> read_brainvision_eeg at 52 >  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >  'cof'); > > Error in ==> ft_read_data at 442 >    dat = read_brainvision_eeg(filename, hdr.orig, >    begsample, endsample); > > Error in ==> ft_preprocessing at 466 >      dat = ft_read_data(cfg.datafile, 'header', hdr, >      'begsample', begsample, 'endsample', endsample, >      'chanindx', rawindx, 'checkboundary', >      strcmp(cfg.continuous, 'no'), 'dataformat', >      cfg.dataformat) > > > If I'm trying to use another file that is an average (so no trial to select) and I > treat as a continous file I got these other problems: > > cfg=[]; > cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; > data=ft_preprocessing(cfg); > Warning: cannot determine number of samples for this > sub-fileformat >> In fileio\private\read_brainvision_vhdr at 95 >  In ft_read_header at 367 >  In ft_preprocessing at 294 > processing channel > { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 > ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } > reading and preprocessing > reading and preprocessing trial 1 from 1 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 390 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 395 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > ??? Error using ==> zeros > NaN and Inf not allowed. > > Error in ==> read_brainvision_eeg at 76 >  dat = zeros(endsample-begsample+1, >  hdr.NumberOfChannels); > > Error in ==> ft_read_data at 442 >    dat = read_brainvision_eeg(filename, hdr.orig, >    begsample, endsample); > > Error in ==> ft_preprocessing at 466 >      dat = ft_read_data(cfg.datafile, 'header', hdr, >      'begsample', begsample, 'endsample', endsample, >      'chanindx', rawindx, 'checkboundary', >      strcmp(cfg.continuous, 'no'), 'dataformat', >      cfg.dataformat) > > do I miss something? > > regards > > Marco > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From gauthierb.ens at GMAIL.COM Fri May 21 16:14:39 2010 From: gauthierb.ens at GMAIL.COM (Baptiste Gauthier) Date: Fri, 21 May 2010 16:14:39 +0200 Subject: Recent update for volume handling Message-ID: Dear Fieldtrip users, I recently try to use the tutorial for creating normalized grid in a purpose of source reconstruction for Neuromag data. It used to work fine, but recently, the segmentation step seems to produce odd results. I have to precise that I changed parameters relative to recent update of volume handling fonction that are now using SPM8. So I wonder If this tutorial stay compatible to this recent update. Has someone experimented the same problems? Best regards, Baptiste Gauthier ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grayseg_SPM8.png Type: image/png Size: 250884 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: whiteseg_SPM8.png Type: image/png Size: 256368 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: csfseg_SPM8.png Type: image/png Size: 198483 bytes Desc: not available URL: From gordon at CCS.FAU.EDU Fri May 21 20:50:46 2010 From: gordon at CCS.FAU.EDU (Reyna L. Gordon) Date: Fri, 21 May 2010 13:50:46 -0500 Subject: issue with cfg.interplimits Message-ID: Dear Fieldtrippers, I am having an issue with creating topoplots of time-frequency data acquired on an EGI system and processed in Fieldtrip, and I was wondering if anyone could help. Everything works great (this toolbox has been wonderful to use in general!) except that the colors that represent power are not interpolating to electrodes that are lower than the origin. Unfortunately, using the default option for cfg.projection = 'orthographic' for ft_prepare_layout, seems to greatly distort the layout for these data, probably because I have too few electrodes. A better option for me seems to be cfg.projection = 'polar', and I am fine with those few electrodes appearing outside of the head. However, the data corresponding to those electrodes is not there - I suspect that there is a problem at the level of cfg.interplimits. This is the code I'm using: cfg = []; cfg.rotate = 0; cfg.projection = 'polar'; newlay=ft_prepare_layout(cfg, bin1); cfg = []; cfg.layout = newlay; cfg.yparam = 'freq'; cfg.xlim= [0.150 0.150]; cfg.ylim= [13 30]; cfg.zlim = [-0.10 0.10]; cfg.highlight = 'on'; cfg.baseline = 'no'; cfg.commentpos = 'title'; cfg.shading = 'interp'; cfg.interplimits = 'electrodes'; %Should work here? cfg.style = 'straight'; cfg.zparam = 'powspctrm'; cfg.fontsize = 12; cfg.gridscale = 100; ft_topoplotTFR(cfg, bin1); According to the documentation, specifying cfg.interplimits = 'electrodes' should achieve what I want here, but it still does not interpolate the plot outside of the head. Attached are some images generated with different cfg.interplimits and cfg.projection options. I have tried upgrading to the most recent release of FT, but it doesn't change the outcome. Any and all insight would be greatly appreciated. Best, Reyna ----------------------- Reyna L. Gordon PhD Candidate Center for Complex Systems & Brain Sciences Florida Atlantic University gordon at ccs.fau.edu ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: polar_head.jpg Type: image/jpeg Size: 23385 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sopro_new_montage_noCz.sfp Type: application/octet-stream Size: 1532 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: orthographic.jpg Type: image/jpeg Size: 21647 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: polar_electrodes.jpg Type: image/jpeg Size: 22977 bytes Desc: not available URL: -------------- next part -------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Sat May 22 12:48:46 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Sat, 22 May 2010 12:48:46 +0200 Subject: Problem with brainvision files In-Reply-To: Message-ID: I've tried to set a brackpoint but stoped at line 76 of read_brainvision_eeg Maybe I exported them in a wrog way? Marco 2010/5/21 Vladimir Litvak : >  Hi Marco, > > I've done some changes recently trying to improve the recognition of > Brainvision files. These might or might not be related to your > problem. Could you perhaps do: > > dbstop if error > > and try to get some idea about why the error in filetype_check_header > happens. There is some problem with opening the .eeg file but it's not > clear what it is. I tried to use code similar to yours on a different > brainvision dataset and there is no problem so it may be something > that happens on your system for some reason. If you can't figure it > out, send me an example dataset via yousendit.com and I'll try to look > at it. > > Best, > > Vladimir > > On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >> Hi fildtrippers! >> After I've updated fieldtrip I got some problems reading brainvision files I didn't >> got before. >> >> Here are the errors (the only differences in this script are ft_definetrial and >> ft_preprocessing that before were only definetrial and preprocessing): >> >> cfg=[]; >> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >> cfg.trialdef.eventtype='Stimulus'; >> cfg.trialdef.eventvalue='S 55'; >> cfg.trialdef.prestim=2; >> cfg.trialdef.poststim=1.999; >> cfg=ft_definetrial(cfg); >> data=ft_preprocessing(cfg); >> >> Warning: no trialfun was specified, using >> trialfun_general >>> In ft_definetrial at 95 >> evaluating trialfunction 'trialfun_general' >> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >> found 256 events >> created 41 trials >> processing channel >> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 41 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> fseek >> Invalid file identifier.  Use fopen to generate a valid >> file identifier. >> >> Error in ==> read_brainvision_eeg at 52 >>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>  'cof'); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> >> If I'm trying to use another file that is an average (so no trial to select) and I >> treat as a continous file I got these other problems: >> >> cfg=[]; >> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >> data=ft_preprocessing(cfg); >> Warning: cannot determine number of samples for this >> sub-fileformat >>> In fileio\private\read_brainvision_vhdr at 95 >>  In ft_read_header at 367 >>  In ft_preprocessing at 294 >> processing channel >> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 1 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> zeros >> NaN and Inf not allowed. >> >> Error in ==> read_brainvision_eeg at 76 >>  dat = zeros(endsample-begsample+1, >>  hdr.NumberOfChannels); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> do I miss something? >> >> regards >> >> Marco >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Sat May 22 12:52:04 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Sat, 22 May 2010 12:52:04 +0200 Subject: Problem with brainvision files In-Reply-To: Message-ID: Sorry... I maybe you could have a better idea with the errors ;-) >> dbstop if error >> cfg=[]; cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; data=ft_preprocessing(cfg); Warning: cannot determine number of samples for this sub-fileformat > In fileio\private\read_brainvision_vhdr at 95 In ft_read_header at 367 In ft_preprocessing at 294 processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } reading and preprocessing reading and preprocessing trial 1 from 1 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 390 In ft_read_data at 205 In ft_preprocessing at 466 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 395 In ft_read_data at 205 In ft_preprocessing at 466 ??? Error using ==> zeros NaN and Inf not allowed. Error in ==> read_brainvision_eeg at 76 dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); Error in ==> ft_read_data at 442 dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample); Error in ==> ft_preprocessing at 466 dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) 76 dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); K>> read_brainvision_eeg ??? Input argument "hdr" is undefined. Error in ==> read_brainvision_eeg at 32 if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') 32 if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') K>> Maybe the problem is about the multiplexed so the way I exported the data? 2010/5/21 Vladimir Litvak : >  Hi Marco, > > I've done some changes recently trying to improve the recognition of > Brainvision files. These might or might not be related to your > problem. Could you perhaps do: > > dbstop if error > > and try to get some idea about why the error in filetype_check_header > happens. There is some problem with opening the .eeg file but it's not > clear what it is. I tried to use code similar to yours on a different > brainvision dataset and there is no problem so it may be something > that happens on your system for some reason. If you can't figure it > out, send me an example dataset via yousendit.com and I'll try to look > at it. > > Best, > > Vladimir > > On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >> Hi fildtrippers! >> After I've updated fieldtrip I got some problems reading brainvision files I didn't >> got before. >> >> Here are the errors (the only differences in this script are ft_definetrial and >> ft_preprocessing that before were only definetrial and preprocessing): >> >> cfg=[]; >> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >> cfg.trialdef.eventtype='Stimulus'; >> cfg.trialdef.eventvalue='S 55'; >> cfg.trialdef.prestim=2; >> cfg.trialdef.poststim=1.999; >> cfg=ft_definetrial(cfg); >> data=ft_preprocessing(cfg); >> >> Warning: no trialfun was specified, using >> trialfun_general >>> In ft_definetrial at 95 >> evaluating trialfunction 'trialfun_general' >> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >> found 256 events >> created 41 trials >> processing channel >> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 41 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> fseek >> Invalid file identifier.  Use fopen to generate a valid >> file identifier. >> >> Error in ==> read_brainvision_eeg at 52 >>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>  'cof'); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> >> If I'm trying to use another file that is an average (so no trial to select) and I >> treat as a continous file I got these other problems: >> >> cfg=[]; >> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >> data=ft_preprocessing(cfg); >> Warning: cannot determine number of samples for this >> sub-fileformat >>> In fileio\private\read_brainvision_vhdr at 95 >>  In ft_read_header at 367 >>  In ft_preprocessing at 294 >> processing channel >> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 1 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> zeros >> NaN and Inf not allowed. >> >> Error in ==> read_brainvision_eeg at 76 >>  dat = zeros(endsample-begsample+1, >>  hdr.NumberOfChannels); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> do I miss something? >> >> regards >> >> Marco >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From sklein at BERKELEY.EDU Sat May 22 13:17:11 2010 From: sklein at BERKELEY.EDU (Stanley Klein) Date: Sat, 22 May 2010 04:17:11 -0700 Subject: Filters local in time while rejecting low frequencies Message-ID: Dear Fieldtrip, We would like to do time-frequency plots using filters that are quite local in time (less than about 2 cycles) and yet have relatively low sensitivity to low temporal frequencies. For example, filters defined on log frequency might do the job in being insensitive to low frequencies, but are they sufficiently local in time? thanks, Stan Klein ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.litvak at ION.UCL.AC.UK Sat May 22 22:49:49 2010 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Sat, 22 May 2010 21:49:49 +0100 Subject: Problem with brainvision files In-Reply-To: Message-ID: Hi Marco, There are two separate problems. One has to do with my mistake and one doesn't. The problem with the example you sent me is indeed that the data is ASCII multiplexed. I suggest that you export the data as binary. The second problem was introduced by my fix and I hope that it'll be fixed if you put the attached file in fileio. I also checked it in. Let me know if you still have problems. Best, Vladimir On Sat, May 22, 2010 at 11:52 AM, Marco Rotonda wrote: > Sorry... > I maybe you could have a better idea with the errors ;-) > >>> dbstop if error >>> cfg=[]; > cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; > data=ft_preprocessing(cfg); > Warning: cannot determine number of samples for this > sub-fileformat >> In fileio\private\read_brainvision_vhdr at 95 >  In ft_read_header at 367 >  In ft_preprocessing at 294 > processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' > 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' > 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } > reading and preprocessing > reading and preprocessing trial 1 from 1 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 390 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 395 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > ??? Error using ==> zeros > NaN and Inf not allowed. > > Error in ==> read_brainvision_eeg at 76 >  dat = zeros(endsample-begsample+1, >  hdr.NumberOfChannels); > > Error in ==> ft_read_data at 442 >    dat = read_brainvision_eeg(filename, hdr.orig, >    begsample, endsample); > > Error in ==> ft_preprocessing at 466 >      dat = ft_read_data(cfg.datafile, 'header', hdr, >      'begsample', begsample, 'endsample', endsample, >      'chanindx', rawindx, 'checkboundary', >      strcmp(cfg.continuous, 'no'), 'dataformat', >      cfg.dataformat) > 76    dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); > K>> read_brainvision_eeg > ??? Input argument "hdr" is undefined. > > Error in ==> read_brainvision_eeg at 32 > if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, > 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') > > 32  if strcmpi(hdr.DataFormat, 'binary') && > strcmpi(hdr.DataOrientation, 'multiplexed') && > strcmpi(hdr.BinaryFormat, 'int_16') > K>> > > > Maybe the problem is about the multiplexed so the way I exported the data? > > > > 2010/5/21 Vladimir Litvak : >>  Hi Marco, >> >> I've done some changes recently trying to improve the recognition of >> Brainvision files. These might or might not be related to your >> problem. Could you perhaps do: >> >> dbstop if error >> >> and try to get some idea about why the error in filetype_check_header >> happens. There is some problem with opening the .eeg file but it's not >> clear what it is. I tried to use code similar to yours on a different >> brainvision dataset and there is no problem so it may be something >> that happens on your system for some reason. If you can't figure it >> out, send me an example dataset via yousendit.com and I'll try to look >> at it. >> >> Best, >> >> Vladimir >> >> On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >>> Hi fildtrippers! >>> After I've updated fieldtrip I got some problems reading brainvision files I didn't >>> got before. >>> >>> Here are the errors (the only differences in this script are ft_definetrial and >>> ft_preprocessing that before were only definetrial and preprocessing): >>> >>> cfg=[]; >>> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >>> cfg.trialdef.eventtype='Stimulus'; >>> cfg.trialdef.eventvalue='S 55'; >>> cfg.trialdef.prestim=2; >>> cfg.trialdef.poststim=1.999; >>> cfg=ft_definetrial(cfg); >>> data=ft_preprocessing(cfg); >>> >>> Warning: no trialfun was specified, using >>> trialfun_general >>>> In ft_definetrial at 95 >>> evaluating trialfunction 'trialfun_general' >>> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >>> found 256 events >>> created 41 trials >>> processing channel >>> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >>> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>> reading and preprocessing >>> reading and preprocessing trial 1 from 41 >>> Warning: could not open >>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 390 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> Warning: could not open >>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 395 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> ??? Error using ==> fseek >>> Invalid file identifier.  Use fopen to generate a valid >>> file identifier. >>> >>> Error in ==> read_brainvision_eeg at 52 >>>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>>  'cof'); >>> >>> Error in ==> ft_read_data at 442 >>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>    begsample, endsample); >>> >>> Error in ==> ft_preprocessing at 466 >>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>      'begsample', begsample, 'endsample', endsample, >>>      'chanindx', rawindx, 'checkboundary', >>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>      cfg.dataformat) >>> >>> >>> If I'm trying to use another file that is an average (so no trial to select) and I >>> treat as a continous file I got these other problems: >>> >>> cfg=[]; >>> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >>> data=ft_preprocessing(cfg); >>> Warning: cannot determine number of samples for this >>> sub-fileformat >>>> In fileio\private\read_brainvision_vhdr at 95 >>>  In ft_read_header at 367 >>>  In ft_preprocessing at 294 >>> processing channel >>> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >>> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>> reading and preprocessing >>> reading and preprocessing trial 1 from 1 >>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 390 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 395 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> ??? Error using ==> zeros >>> NaN and Inf not allowed. >>> >>> Error in ==> read_brainvision_eeg at 76 >>>  dat = zeros(endsample-begsample+1, >>>  hdr.NumberOfChannels); >>> >>> Error in ==> ft_read_data at 442 >>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>    begsample, endsample); >>> >>> Error in ==> ft_preprocessing at 466 >>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>      'begsample', begsample, 'endsample', endsample, >>>      'chanindx', rawindx, 'checkboundary', >>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>      cfg.dataformat) >>> >>> do I miss something? >>> >>> regards >>> >>> Marco >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>> >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_filetype.m Type: application/octet-stream Size: 41199 bytes Desc: not available URL: From marco.rotonda at GMAIL.COM Mon May 24 11:15:10 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Mon, 24 May 2010 11:15:10 +0200 Subject: Problem with brainvision files In-Reply-To: Message-ID: Hi Vladimir! Everything went fine! Thank you! Marco 2010/5/22 Vladimir Litvak : > Hi Marco, > > There are two separate problems. One has to do with my mistake and one > doesn't. The problem with the example you sent me is indeed that the > data is ASCII multiplexed. I suggest that you export the data as > binary. > > The second problem was introduced by my fix and I hope that it'll be > fixed if you put the attached file in fileio. I also checked it in. > > Let me know if you still have problems. > > Best, > > Vladimir > > On Sat, May 22, 2010 at 11:52 AM, Marco Rotonda wrote: >> Sorry... >> I maybe you could have a better idea with the errors ;-) >> >>>> dbstop if error >>>> cfg=[]; >> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >> data=ft_preprocessing(cfg); >> Warning: cannot determine number of samples for this >> sub-fileformat >>> In fileio\private\read_brainvision_vhdr at 95 >>  In ft_read_header at 367 >>  In ft_preprocessing at 294 >> processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' >> 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' >> 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 1 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> zeros >> NaN and Inf not allowed. >> >> Error in ==> read_brainvision_eeg at 76 >>  dat = zeros(endsample-begsample+1, >>  hdr.NumberOfChannels); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> 76    dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); >> K>> read_brainvision_eeg >> ??? Input argument "hdr" is undefined. >> >> Error in ==> read_brainvision_eeg at 32 >> if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, >> 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') >> >> 32  if strcmpi(hdr.DataFormat, 'binary') && >> strcmpi(hdr.DataOrientation, 'multiplexed') && >> strcmpi(hdr.BinaryFormat, 'int_16') >> K>> >> >> >> Maybe the problem is about the multiplexed so the way I exported the data? >> >> >> >> 2010/5/21 Vladimir Litvak : >>>  Hi Marco, >>> >>> I've done some changes recently trying to improve the recognition of >>> Brainvision files. These might or might not be related to your >>> problem. Could you perhaps do: >>> >>> dbstop if error >>> >>> and try to get some idea about why the error in filetype_check_header >>> happens. There is some problem with opening the .eeg file but it's not >>> clear what it is. I tried to use code similar to yours on a different >>> brainvision dataset and there is no problem so it may be something >>> that happens on your system for some reason. If you can't figure it >>> out, send me an example dataset via yousendit.com and I'll try to look >>> at it. >>> >>> Best, >>> >>> Vladimir >>> >>> On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >>>> Hi fildtrippers! >>>> After I've updated fieldtrip I got some problems reading brainvision files I didn't >>>> got before. >>>> >>>> Here are the errors (the only differences in this script are ft_definetrial and >>>> ft_preprocessing that before were only definetrial and preprocessing): >>>> >>>> cfg=[]; >>>> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >>>> cfg.trialdef.eventtype='Stimulus'; >>>> cfg.trialdef.eventvalue='S 55'; >>>> cfg.trialdef.prestim=2; >>>> cfg.trialdef.poststim=1.999; >>>> cfg=ft_definetrial(cfg); >>>> data=ft_preprocessing(cfg); >>>> >>>> Warning: no trialfun was specified, using >>>> trialfun_general >>>>> In ft_definetrial at 95 >>>> evaluating trialfunction 'trialfun_general' >>>> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >>>> found 256 events >>>> created 41 trials >>>> processing channel >>>> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >>>> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>>> reading and preprocessing >>>> reading and preprocessing trial 1 from 41 >>>> Warning: could not open >>>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 390 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> Warning: could not open >>>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 395 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> ??? Error using ==> fseek >>>> Invalid file identifier.  Use fopen to generate a valid >>>> file identifier. >>>> >>>> Error in ==> read_brainvision_eeg at 52 >>>>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>>>  'cof'); >>>> >>>> Error in ==> ft_read_data at 442 >>>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>>    begsample, endsample); >>>> >>>> Error in ==> ft_preprocessing at 466 >>>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>>      'begsample', begsample, 'endsample', endsample, >>>>      'chanindx', rawindx, 'checkboundary', >>>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>>      cfg.dataformat) >>>> >>>> >>>> If I'm trying to use another file that is an average (so no trial to select) and I >>>> treat as a continous file I got these other problems: >>>> >>>> cfg=[]; >>>> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >>>> data=ft_preprocessing(cfg); >>>> Warning: cannot determine number of samples for this >>>> sub-fileformat >>>>> In fileio\private\read_brainvision_vhdr at 95 >>>>  In ft_read_header at 367 >>>>  In ft_preprocessing at 294 >>>> processing channel >>>> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >>>> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>>> reading and preprocessing >>>> reading and preprocessing trial 1 from 1 >>>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 390 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 395 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> ??? Error using ==> zeros >>>> NaN and Inf not allowed. >>>> >>>> Error in ==> read_brainvision_eeg at 76 >>>>  dat = zeros(endsample-begsample+1, >>>>  hdr.NumberOfChannels); >>>> >>>> Error in ==> ft_read_data at 442 >>>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>>    begsample, endsample); >>>> >>>> Error in ==> ft_preprocessing at 466 >>>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>>      'begsample', begsample, 'endsample', endsample, >>>>      'chanindx', rawindx, 'checkboundary', >>>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>>      cfg.dataformat) >>>> >>>> do I miss something? >>>> >>>> regards >>>> >>>> Marco >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>>> >>>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Tue May 25 11:52:12 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Tue, 25 May 2010 11:52:12 +0200 Subject: Clusterplot problem In-Reply-To: Message-ID: Hi Matteo, How do your ft_topoplot's look if you average over frequency and average over time (averaging before baseline correcting)? That could be one of the causes for your different outputs. I do not expect something to be wrong with the stat.mask field as you mentioned, as it does fit really well to the plotted t-value spectrum. Could you also post your ft_topoplot and ft_clusterplot settings, just to be sure? Best, Roemer On 5/21/2010 1:09 PM, Matteo Fraschini wrote: > Hi Roemer, > I tried using the last FT version with same results. > > This is the code for statistic: > > function [stat]=withinSubjs(GA_act,GA_bl) > cfg = []; > cfg.channel = {'MEG','-MLT22','-MLT27','-MLO42','-MLO43','-MRT22','-MRT27','-MRO42','-MRO43'}; > cfg.frequency = [4 7]; > cfg.avgovertime = 'yes'; > cfg.avgoverfreq = 'yes'; > cfg.method = 'montecarlo'; > cfg.statistic = 'actvsblT'; > cfg.correctm = 'cluster'; > cfg.clusteralpha = 0.05; > cfg.clusterstatistic = 'maxsum'; > cfg.minnbchan = 2; > cfg.tail = 0; > cfg.clustertail = 0; > cfg.alpha = 0.05; > cfg.numrandomization = 500; > n_subjs=size(GA_act.powspctrm); > n_subjs=n_subjs(1); > design = zeros(2,2*n_subjs); > for i = 1:n_subjs > design(1,i) = i; > end > for i = 1:n_subjs > design(1,n_subjs+i) = i; > end > design(2,1:n_subjs) = 1; > design(2,n_subjs+1:2*n_subjs) = 2; > cfg.design = design; > cfg.uvar = 1; > cfg.ivar = 2; > stat = ft_freqstatistics(cfg,GA_act,GA_bl) > > You can see the ft_topoplot (with absolute baseline correction) and ft_clusterplot (same time) figures here: > http://192.167.154.14/ft/topo.jpg > http://192.167.154.14/ft/cluster.jpg > > I also tried using 'ctf_old' specification when preprocessing my data but an error occurs in ft_megplanar: > > ??? Index exceeds matrix dimensions. > Error in ==> channelposition at 53 > sens.pnt = sens.pnt(used,:); > Error in ==> megplanar_sincos at 26 > [pnt, ori, lab] = channelposition(grad); > > Any suggestion? > Thank you very much, > Matteo > > > Il giorno 20/mag/2010, alle ore 10.24, Roemer van der Meij ha scritto: > > >> Hi Matteo, >> >> What FieldTrip version are you using? There have been some changes in the past few months in the functions you use. >> Could you post all the cfg-settings you used (from statistical analysis onwards)? >> >> Best, >> Roemer >> >> >> On 5/19/2010 3:51 PM, wrote: >> >>> Dear all, >>> I am currently working on a study involving Activation vs Baseline paradigm on MEG data. >>> By using FT preprocessing, analysis and plotting functions I really can see what I expected >>> to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation >>> tests on time-frequency data following the web tutorial. The analysis shows significative >>> cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with >>> ft_clusterplot) is significative cluster but in region/channels with no frequency differences >>> from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference >>> is more evident. Looks like channels are not correctly placed in the plot. >>> Any suggestions? >>> Thank you very much, >>> Matteo >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>> >>> >>> >> -- >> Roemer van der Meij MSc >> Scientific Programmer& Data-Analyst >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3612631 >> E-mail: r.vandermeij at donders.ru.nl >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From michael.wibral at WEB.DE Tue May 25 17:54:56 2010 From: michael.wibral at WEB.DE (Michael Wibral) Date: Tue, 25 May 2010 17:54:56 +0200 Subject: Error in the description of funcolorlim ?? Message-ID: Dear Listusers, I am trying to plot just the negative values of my sourcestatistics, and it seems difficult to achieve this so that the parts in the data.outside region and the part outside of the head are transparent. Does anybody know how to do this? The other thing that I am wondering about is if the documentation of funcolorlim in ft_sourceplot is entirely correct. In the help it says: cfg.funcolorlim = color range of the functional data (default = 'auto') [min max] 'maxabs', from -max(abs(funparameter)) to +max(abs(funparameter)) 'zeromax', from 0 to max(abs(funparameter)) 'minzero', from min(abs(funparameter)) to 0 'auto', if funparameter values are all positive: 'zeromax', all negative: 'minzero', both possitive and negative: 'maxabs' What I am wondering about is that when values are all negative (say from -6 to -0.1) it chooses 'minzero'. This would, according to the above description result in values from min(abs(funparameter))=+0.1 to 0 being plotted, i.e. if this were corrcet it would try to plot small positive values... . I guess this is an error in the documentation, with the 'abs' being wrong. Any comments on this would be appreciated. Michael ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 628 bytes Desc: not available URL: From balazs at COGPSYPHY.HU Wed May 26 00:47:01 2010 From: balazs at COGPSYPHY.HU (=?ISO-8859-1?Q?Bal=E1zs_L=E1szl=F3?=) Date: Wed, 26 May 2010 00:47:01 +0200 Subject: IOP conference - extended deadline for submissions Message-ID: Dear listmembers, Deadline for submissions to the 15th World Congress of Pschophysiology (IOP 2010) is extended until the end of May. Please read the information in attachment. Looking forward to see you in Budapest. Kind regards, Laszlo -- Laszlo Balazs, Ph.D. / dr. Balázs László Institute for Psychology HAS / MTA Pszichológiai Kutatóintézet P O B 398, Budapest, Hungary, H-1394 Tel:+36(1)354-2410 | Fax:+36(1)354-2416 http://www.cogpsyphy.hu/balazs __________ Information from ESET NOD32 Antivirus, version of virus signature database 5133 (20100520) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: IOP_?rtes?t?_email.pdf Type: application/octet-stream Size: 51077 bytes Desc: not available URL: From zaifengg at GMAIL.COM Wed May 26 10:53:09 2010 From: zaifengg at GMAIL.COM (gao zai) Date: Wed, 26 May 2010 11:53:09 +0300 Subject: Questions on Dipole fitting Message-ID: Dear all, Currently I am trying to do the Dipole fitting on the MEG data. I have 1 problem that puzzled me, in particular, When I did dipole on individual subject,I used the scripts according to to one posted in the Fieldtrip website, it runs ok but I get only null result (naked MRI picture without any dipole inside.) I was told that "Local minimum possible. fminunc stopped because the size of the current step is less than the default value of the step size tolerance." However, the same data I used SPM8, I get can get dipole. So I wonder is there anything wrong with my scripts? I hope I can get your kind help. Thanks very much in advance. -- load s2TL42 figure plot(1000*s2TL42.time, s2TL42.avg) % convert time to ms xlabel('time (ms)') ylabel('field amplitude (T)') axis tight grid on cfg = []; cfg.xlim = 0.1:0.025:0.2; cfg.colorbar = 'no'; cfg.comment = ''; cfg.showxlim = 'no'; cfg.showzlim = 'no'; cfg.layout = '4D248.lay'; cfg.zlim = [-1.5 1.5] * 1e-13; figure ft_topoplotER(cfg, s2TL42); cfg = []; cfg.latency = [0.15 0.18]; % specify latency window around M165 peak cfg.numdipoles = 1; cfg.vol = vol; cfg.feedback = 'textbar'; cfg.resolution = 2; dip = ft_dipolefitting(cfg, s2TL42); sMRI = read_mri(fullfile(spm('dir'), 'canonical', 'single_subj_T1.nii')); % the source is expressed in cm cfg = []; cfg.location = dip.dip.pos*10; % convert from cm to mm cfg.interactive='yes'; figure; ft_sourceplot(cfg, sMRI); --------------- Best, Feng ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ab_saad at LIVE.COM Wed May 26 12:09:44 2010 From: ab_saad at LIVE.COM (W. Saad) Date: Wed, 26 May 2010 06:09:44 -0400 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... Message-ID: Hi, I am new to matlab and FieldTrip - so bare with me and thanks for your feedback in advance :) I have a csv file containing readings for 25 electrode EEG trial. There are 129,908 readings in the file (sampling rate is 256 - approx. 507 seconds) The file is 25 columns by 129,908 rows. I would like to calculate power for each of the 5 wave types for each channel. Also, I would like to find the coherence for all intra-hemispheric and inter-hemispheric pairwise combination of the 25 channels (300 in total). I am trying the following code but getting a memory error and other errors (code is mostly based on the samples I have found in FieldTrip website). %-------------------------------------------------------------- fieldtripdefs; filename='recall.dat'; filelength=129908; rdata=csvread(filename); rdata=rdata'; % cell-array containing strings, Nchan X 1 data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' 'E12' 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' 'E23' 'E24' 'E25' 'E26'}; % sampling frequency in Hz, single number data.fsample = 256; % cell-array containing a data matrix for each trial (1 X Ntrial), each data matrix is Nchan X Nsamples data.trial = {rdata}; % cell-array containing a time axis for each trial (1 X Ntrial), each time axis is a 1 X Nsamples vector timevector = [1:filelength]; data.time = { timevector }; cfg = []; cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [0.5 50]; cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'all' }; cfg.channelcmb = {'all' 'all'}; freq = ft_freqanalysis(cfg, data); cfg = []; cfg.method = 'coh'; cfg.channelcmb = {'all' 'all'}; fd = ft_connectivityanalysis(cfg, freq); % Let us not draw for now.. %cfg = []; %cfg.xparam = 'freq'; %cfg.zparam = 'cohspctrm'; %cfg.xlim = [5 80]; %cfg.cohrefchannel = 'EMGlft'; %cfg.layout = 'CTF151.lay'; %cfg.showlabels = 'yes'; %figure; ft_multiplotER(cfg, fd) ----------------------------------------------------------------- The messages/error I get is: the input is raw data with 25 channels and 1 trials ??? Maximum variable size allowed by the program is exceeded. Error in ==> dpss>dpsscalc at 127 E = zeros(N,k(2)-k(1)+1); Error in ==> dpss at 54 [E,V] = dpsscalc(N,NW,k); Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 tap = dpss(double(a), double(b), varargin{:}); Error in ==> ft_freqanalysis_mtmfft at 249 tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; Error in ==> ft_freqanalysis at 75 [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg, data); Error in ==> saad_fieldtrip at 29 freq = ft_freqanalysis(cfg, data); ----------------------------------------------------------------- I have been looking around in the discussion board trying to find how to read a csv file with no success (though it looks to me it was read successfully since Fieldtrip detected it has 25 channels). Also, I am worried about the message ??? Maximum variable size allowed by the program is exceeded. Because most of my trials are huge in size, in fact the biggest file size I have is 25 columns x 250,000 rows (~60MB). Your input is highly appreciated. Thanks. _________________________________________________________________ 30 days of prizes to be won with Hotmail. Enter Here. http://go.microsoft.com/?linkid=9729709 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at DONDERS.RU.NL Wed May 26 14:31:55 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Wed, 26 May 2010 14:31:55 +0200 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... In-Reply-To: Message-ID: Dear W.Saad, Could it be that there is a typo in how you define data.time? You define it in sample numbers but it should be in seconds: data.time{1} = [1:filelength]./daga.fsample; I guess this may help. Best, Jan-Mathijs On May 26, 2010, at 12:09 PM, W. Saad wrote: > Hi, > > I am new to matlab and FieldTrip - so bare with me and thanks for > your feedback in advance :) > > I have a csv file containing readings for 25 electrode EEG trial. > There are 129,908 readings in > the file (sampling rate is 256 - approx. 507 seconds) The file is 25 > columns by 129,908 rows. > > I would like to calculate power for each of the 5 wave types for > each channel. Also, I would > like to find the coherence for all intra-hemispheric and inter- > hemispheric pairwise > combination of the 25 channels (300 in total). > > I am trying the following code but getting a memory error and other > errors (code is mostly based > on the samples I have found in FieldTrip website). > > > %-------------------------------------------------------------- > > fieldtripdefs; > > filename='recall.dat'; > filelength=129908; > rdata=csvread(filename); > rdata=rdata'; > > % cell-array containing strings, Nchan X 1 > data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' > 'E12' 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' > 'E23' 'E24' 'E25' 'E26'}; > > % sampling frequency in Hz, single number > data.fsample = 256; > > % cell-array containing a data matrix for each trial (1 X Ntrial), > each data matrix is Nchan X Nsamples > data.trial = {rdata}; > > % cell-array containing a time axis for each trial (1 X Ntrial), > each time axis is a 1 X Nsamples vector > timevector = [1:filelength]; > data.time = { timevector }; > > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmfft'; > cfg.foilim = [0.5 50]; > cfg.tapsmofrq = 5; > cfg.keeptrials = 'yes'; > cfg.channel = {'all' }; > cfg.channelcmb = {'all' 'all'}; > freq = ft_freqanalysis(cfg, data); > > cfg = []; > cfg.method = 'coh'; > cfg.channelcmb = {'all' 'all'}; > fd = ft_connectivityanalysis(cfg, freq); > > % Let us not draw for now.. > %cfg = []; > %cfg.xparam = 'freq'; > %cfg.zparam = 'cohspctrm'; > %cfg.xlim = [5 80]; > %cfg.cohrefchannel = 'EMGlft'; > %cfg.layout = 'CTF151.lay'; > %cfg.showlabels = 'yes'; > %figure; ft_multiplotER(cfg, fd) > > ----------------------------------------------------------------- > > The messages/error I get is: > > the input is raw data with 25 channels and 1 trials > ??? Maximum variable size allowed by the program is exceeded. > > Error in ==> dpss>dpsscalc at 127 > E = zeros(N,k(2)-k(1)+1); > > Error in ==> dpss at 54 > [E,V] = dpsscalc(N,NW,k); > > Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 > tap = dpss(double(a), double(b), varargin{:}); > > Error in ==> ft_freqanalysis_mtmfft at 249 > tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./ > data.fsample))'; > > Error in ==> ft_freqanalysis at 75 > [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), > cfg, data); > > Error in ==> saad_fieldtrip at 29 > freq = ft_freqanalysis(cfg, data); > > ----------------------------------------------------------------- > > I have been looking around in the discussion board trying to find > how to read a csv file with no success (though it looks to me it > was read successfully since Fieldtrip detected it has 25 channels). > > Also, I am worried about the message > ??? Maximum variable size allowed by the program is exceeded. > Because most of my trials are huge in size, in fact the biggest file > size I have is 25 columns x 250,000 rows (~60MB). > > Your input is highly appreciated. > > Thanks. > 30 days of prizes: Hotmail makes your day easier! Enter now > ---------------------------------- > The aim of this list 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/ Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ab_saad at LIVE.COM Wed May 26 21:51:19 2010 From: ab_saad at LIVE.COM (Saad AB) Date: Wed, 26 May 2010 21:51:19 +0200 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... Message-ID: Hi, Thanks for your response. That definitely helped! However, I am still getting an error that does not make a lot of sense to me. I don't think it has to do with my files size being big since the tutorial in the following link works with files 4 times bigger than mine (208MB): http://fieldtrip.fcdonders.nl/tutorial/coherence Here is the code again for anyone willing to help: %----------------------------------------------- fieldtripdefs; filename='recall.dat'; filelength=129908; rdata=csvread(filename); rdata=rdata'; % cell-array containing strings, Nchan X 1 data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' 'E12' 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' 'E23' 'E24' 'E25' 'E26'}; % sampling frequency in Hz, single number data.fsample = 256; % cell-array containing a data matrix for each trial (1 X Ntrial), each data matrix is Nchan X Nsamples data.trial = {rdata}; % cell-array containing a time axis for each trial (1 X Ntrial), each time axis is a 1 X Nsamples vector data.time{1} = [1:filelength]./data.fsample; cfg = []; cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [0.5 50]; cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'all' }; cfg.channelcmb = {'all' 'all'}; freq = ft_freqanalysis(cfg, data); cfg = []; cfg.method = 'coh'; cfg.channelcmb = {'all' 'all'}; fd = ft_connectivityanalysis(cfg, freq); %----------------------------------------------- and the error: the input is raw data with 25 channels and 1 trials ??? Maximum variable size allowed by the program is exceeded. Error in ==> dpss>dpsscalc at 127 E = zeros(N,k(2)-k(1)+1); Error in ==> dpss at 54 [E,V] = dpsscalc(N,NW,k); Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 tap = dpss(double(a), double(b), varargin{:}); Error in ==> ft_freqanalysis_mtmfft at 249 tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; Error in ==> ft_freqanalysis at 75 [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg, data); Error in ==> saad_fieldtrip at 30 freq = ft_freqanalysis(cfg, data); %------------------------------------------- Thanks in advance for your input. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jan.schoffelen at DONDERS.RU.NL Thu May 27 09:05:01 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Thu, 27 May 2010 09:05:01 +0200 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... In-Reply-To: Message-ID: Dear W. Saad, It seems you call ft_freqanalysis with only one quite long data trial in the input. This leads to a frequency tranform which has a very high spectral resolution. The number of tapers used in multitapering (for a given requested half- bandwidth cfg.tapsmofrq) is a function of the spectral resolution. In other words, the higher the spectral resolution, the more tapers are needed. In your case you have approx. 500 seconds of data, yielding a spectral resolution of 1/500 Hz. To achieve a spectral smoothing of 5 Hz you need approximately 1000 tapers. Besides the fact that this is rather meaningless, it will totally exceed your memory limits when the tapers are constructed. The remedy here is to cut your data into shorter segments. The length of these segments will be determined by your experimental question. Best, Jan-Mathijs On May 26, 2010, at 9:51 PM, Saad AB wrote: > Hi, > > Thanks for your response. That definitely helped! > > However, I am still getting an error that does not make a lot of > sense to me. > > I don't think it has to do with my files size being big since the > tutorial > in the following link works with files 4 times bigger than mine > (208MB): > http://fieldtrip.fcdonders.nl/tutorial/coherence > > Here is the code again for anyone willing to help: > %----------------------------------------------- > fieldtripdefs; > filename='recall.dat'; > filelength=129908; > rdata=csvread(filename); > rdata=rdata'; > > % cell-array containing strings, Nchan X 1 > data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' > 'E12' > 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' 'E23' > 'E24' > 'E25' 'E26'}; > > % sampling frequency in Hz, single number > data.fsample = 256; > > % cell-array containing a data matrix for each trial (1 X Ntrial), > each data > matrix is Nchan X Nsamples > data.trial = {rdata}; > > % cell-array containing a time axis for each trial (1 X Ntrial), > each time > axis is a 1 X Nsamples vector > data.time{1} = [1:filelength]./data.fsample; > > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmfft'; > cfg.foilim = [0.5 50]; > cfg.tapsmofrq = 5; > cfg.keeptrials = 'yes'; > cfg.channel = {'all' }; > cfg.channelcmb = {'all' 'all'}; > freq = ft_freqanalysis(cfg, data); > > cfg = []; > cfg.method = 'coh'; > cfg.channelcmb = {'all' 'all'}; > fd = ft_connectivityanalysis(cfg, freq); > > > %----------------------------------------------- > > and the error: > > the input is raw data with 25 channels and 1 trials > ??? Maximum variable size allowed by the program is exceeded. > > Error in ==> dpss>dpsscalc at 127 > E = zeros(N,k(2)-k(1)+1); > > Error in ==> dpss at 54 > [E,V] = dpsscalc(N,NW,k); > > Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 > tap = dpss(double(a), double(b), varargin{:}); > > Error in ==> ft_freqanalysis_mtmfft at 249 > tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./ > data.fsample))'; > > Error in ==> ft_freqanalysis at 75 > [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), > cfg, data); > > Error in ==> saad_fieldtrip at 30 > freq = ft_freqanalysis(cfg, data); > > %------------------------------------------- > > Thanks in advance for your input. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From aardesta at UCLA.EDU Fri May 28 21:07:17 2010 From: aardesta at UCLA.EDU (Allen Ardestani) Date: Fri, 28 May 2010 12:07:17 -0700 Subject: Error in timelockstatistics In-Reply-To: <69C15B57-9A50-41D0-B276-561116F5AB0D@mac.com> Message-ID: Thank you very much for the input - I got the Image Processing Toolbox and am now able to make use of the clustering function. I do have remaining questions about the cluster analysis. I tried looking at the code but still can't figure out what type of clustering approach (e.g., k-means, fuzzy logic, etc) is being used and how to adjust its clustering sensitivity, independent of the cluster thresholding alpha. Any help would be much appreciated! From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Thursday, May 13, 2010 1:22 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Error in timelockstatistics Dear Allen, you need bwlabeln anyhow, no matter how you want to cluster (the function can cluster in n-dimensions). so getting the Image Processing Toolbox may be a good investment if you decide to use fieldtrip statistics in future. an -untested- alternative may be to use the octave version of bwlabeln. usually the code is very compatible to matlab, i.e. if it does not run out-of-the-box it usually just needs a little tweaking. however it may be a lot slower. http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/image/bwlabel.m http://www.gnu.org/software/octave/index.html good luck, nathan On 13.05.2010, at 00:44, Allen Ardestani wrote: Hi everyone, I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: method: 'montecarlo' statistic: 'indepsamplesT' correctm: 'cluster' clusteralpha: 0.0500 clusterstatistic: 'maxsum' tail: 0 clustertail: 0 alpha: 0.0250 numrandomization: 100 design: [1x267 double] channel: 'F1' minnbchan: 0 layout: 'layout.mat' ivar: 1 I get the following error message: ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. Error in ==> findcluster at 89 [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); Error in ==> clusterstat at 194 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> statistics_montecarlo at 321 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 285 [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); Error in ==> ft_timelockstatistics at 96 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I'm assuming that part of the problem is that I don't have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I'm a new user, so any advice is much appreciated. Thanks in advance! ____________________________________________________________________________ ______ Allen Ardestani Email: aardesta at ucla.edu Phone: (310) 825-5528 Medical Scientist Training Program David Geffen School of Medicine at UCLA Semel Institute for Neuroscience and Human Behavior 760 Westwood Plaza Los Angeles, CA 90095-1759 USA ---------------------------------- The aim of this list 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. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at DONDERS.RU.NL Fri May 28 23:29:27 2010 From: e.maris at DONDERS.RU.NL (Eric Maris) Date: Fri, 28 May 2010 23:29:27 +0200 Subject: Error in timelockstatistics In-Reply-To: <015501cafe98$fd6f14c0$f84d3e40$@edu> Message-ID: Hi Allen, Thank you very much for the input - I got the Image Processing Toolbox and am now able to make use of the clustering function. I do have remaining questions about the cluster analysis. I tried looking at the code but still can't figure out what type of clustering approach (e.g., k-means, fuzzy logic, etc) is being used and how to adjust its clustering sensitivity, independent of the cluster thresholding alpha. Any help would be much appreciated! I know it's a bit pretentious to refer to one's own papers, but this is a case where the question forces me: Maris & Oostenveld (2007). Journal of Neuroscience Methods. Good luck, Eric dr. Eric Maris Donders Institute for Brain, Cognition and Behavior Center for Cognition and F.C. Donders Center for Cognitive Neuroimaging Radboud University P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 Mobile: 06 39584581 F:+31 24 3616066 E: e. maris at donders.ru.nl From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Thursday, May 13, 2010 1:22 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Error in timelockstatistics Dear Allen, you need bwlabeln anyhow, no matter how you want to cluster (the function can cluster in n-dimensions). so getting the Image Processing Toolbox may be a good investment if you decide to use fieldtrip statistics in future. an -untested- alternative may be to use the octave version of bwlabeln. usually the code is very compatible to matlab, i.e. if it does not run out-of-the-box it usually just needs a little tweaking. however it may be a lot slower. http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/image/bwlabel.m http://www.gnu.org/software/octave/index.html good luck, nathan On 13.05.2010, at 00:44, Allen Ardestani wrote: Hi everyone, I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: method: 'montecarlo' statistic: 'indepsamplesT' correctm: 'cluster' clusteralpha: 0.0500 clusterstatistic: 'maxsum' tail: 0 clustertail: 0 alpha: 0.0250 numrandomization: 100 design: [1x267 double] channel: 'F1' minnbchan: 0 layout: 'layout.mat' ivar: 1 I get the following error message: ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. Error in ==> findcluster at 89 [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); Error in ==> clusterstat at 194 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> statistics_montecarlo at 321 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 285 [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); Error in ==> ft_timelockstatistics at 96 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I'm assuming that part of the problem is that I don't have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I'm a new user, so any advice is much appreciated. Thanks in advance! ____________________________________________________________________________ ______ Allen Ardestani Email: aardesta at ucla.edu Phone: (310) 825-5528 Medical Scientist Training Program David Geffen School of Medicine at UCLA Semel Institute for Neuroscience and Human Behavior 760 Westwood Plaza Los Angeles, CA 90095-1759 USA ---------------------------------- The aim of this list 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. 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. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.rotonda at GMAIL.COM Sat May 29 18:53:08 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Sat, 29 May 2010 18:53:08 +0200 Subject: cohrefchannel Message-ID: Hi there! I'm trying to plot some coherence analysis I did but I have to specify the reference channel. The point is that I've taken it away in previous analysis done in brainvision and to have it back I have to discard a lot of work. There is a way to bypass this cfg parameter? why is needed? I need only to visualize the coherence indexes I've found... regards Marco ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Mon May 31 10:43:54 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Mon, 31 May 2010 10:43:54 +0200 Subject: issue with cfg.interplimits In-Reply-To: <1D084D6F-BC7F-4DFA-81EB-2684F409E0CA@ccs.fau.edu> Message-ID: Hi Reyna, Sorry for my late reply. I added your bug to our new bug-database, you can track it here if you wish: http://bugzilla.fcdonders.nl/show_bug.cgi?id=86 I'll try to work out a fix in the following days. It probably doesn't have anything to do with your specific ft_prepare_layout options. There has been a reorganization of the plotting-functions several months back, which may have caused this problem. Are you by the way using the most recent fieldtrip version? Best, Roemer On 5/21/2010 8:50 PM, Reyna L. Gordon wrote: > Dear Fieldtrippers, > > I am having an issue with creating topoplots of time-frequency data > acquired on an EGI system and processed in Fieldtrip, and I was > wondering if anyone could help. > > Everything works great (this toolbox has been wonderful to use in > general!) except that the colors that represent power are not > interpolating to electrodes that are lower than the origin. > Unfortunately, using the default option for cfg.projection = > 'orthographic' for ft_prepare_layout, seems to greatly distort the > layout for these data, probably because I have too few electrodes. A > better option for me seems to be cfg.projection = 'polar', and I am > fine with those few electrodes appearing outside of the head. > > However, the data corresponding to those electrodes is not there - I > suspect that there is a problem at the level of cfg.interplimits. > This is the code I'm using: > > cfg = []; > cfg.rotate = 0; > cfg.projection = 'polar'; > newlay=ft_prepare_layout(cfg, bin1); > cfg = []; > > cfg.layout = newlay; > cfg.yparam = 'freq'; > cfg.xlim= [0.150 0.150]; > cfg.ylim= [13 30]; > cfg.zlim = [-0.10 0.10]; > cfg.highlight = 'on'; > cfg.baseline = 'no'; > cfg.commentpos = 'title'; > cfg.shading = 'interp'; > cfg.interplimits = 'electrodes'; %Should work here? > cfg.style = 'straight'; > cfg.zparam = 'powspctrm'; > cfg.fontsize = 12; > cfg.gridscale = 100; > ft_topoplotTFR(cfg, bin1); > > According to the documentation, specifying cfg.interplimits = > 'electrodes' should achieve what I want here, but it still does not > interpolate the plot outside of the head. > Attached are some images generated with different cfg.interplimits and > cfg.projection options. I have tried upgrading to the most recent > release of FT, but it doesn't change the outcome. > > Any and all insight would be greatly appreciated. > Best, > Reyna > > ----------------------- > Reyna L. Gordon > PhD Candidate > Center for Complex Systems & Brain Sciences > Florida Atlantic University > gordon at ccs.fau.edu > > > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > > > > > > > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From sklein at BERKELEY.EDU Mon May 31 21:43:49 2010 From: sklein at BERKELEY.EDU (Stanley Klein) Date: Mon, 31 May 2010 12:43:49 -0700 Subject: issue with cfg.interplimits In-Reply-To: <4C0376CA.1010205@donders.ru.nl> Message-ID: On Reyna Gordon's comment about interpolation between electrodes. A number of years ago we modified a topo plot so that rather than showing a smooth interpolation it plotted each electrode as a tiny disk with the voltage shown as the color of the disk The disks were made large enough so that with a dense electrode array they would overlap maybe 40%. Three close electrodes could have triple overlap as I recall. The cute thing about the algorithm is that in the overlap regions we would plot the mean of the overlapping electrodes. It produced a very nice plot with cute smoothing and yet one could identify the location of each electrode. I'm sorry I haven't been able to locate that old topoplot code. But here is a crude matlab simulation similar to what we did for the interpolation. elec=[0 1 1 1 1 0 0 0 0 0 ; 0 0 1 1 1 1 0 0 0 0; 0 0 0 0 1 1 1 1 0 0]; V = [1 3 5] [Nelec,Npix]=size(elec) topo=zeros(1,Npix); for i=1:Npix for j=1:Nelec; topo(i)=topo(i)+V(j)*elec(j,i); N=sum(elec(:,i)~=0); end if N>0, topo(i)=topo(i)/N;end end topo where elec is the topographic image where '1' indicates the electrode locations and V is the voltages on the electrodes. The "interpolated" topoplot is topo. As I recall the algorithm we had only worried about 2 electrode overlaps in which case there was a really simple way to do the algorithm without any FOR loops, using a set intersect command from Matlab. I think it would be nifty if this type of option could be included in Fieldtrip so that one sees the electrode locations as well as getting good enough interpolation/smoothing. Stan On Mon, May 31, 2010 at 1:43 AM, Roemer van der Meij wrote: > > Hi Reyna, > > Sorry for my late reply. I added your bug to our new bug-database, you can track it here if you wish: > http://bugzilla.fcdonders.nl/show_bug.cgi?id=86 > > I'll try to work out a fix in the following days. It probably doesn't have anything to do with your specific ft_prepare_layout options. There has been a reorganization of the plotting-functions several months back, which may have caused this problem. > Are you by the way using the most recent fieldtrip version? > > Best, > Roemer > > > > On 5/21/2010 8:50 PM, Reyna L. Gordon wrote: >> >> Dear Fieldtrippers, >> >> I am having an issue with creating topoplots of time-frequency data acquired on an EGI system and processed in Fieldtrip, and I was wondering if anyone could help. >> >> Everything works great (this toolbox has been wonderful to use in general!) except that the colors that represent power are not interpolating to electrodes that are lower than the origin. Unfortunately, using the default option for cfg.projection = 'orthographic' for ft_prepare_layout, seems to greatly distort the layout for these data, probably because I have too few electrodes. A better option for me seems to be cfg.projection = 'polar', and I am fine with those few electrodes appearing outside of the head. >> >> However, the data corresponding to those electrodes is not there - I suspect that there is a problem at the level of cfg.interplimits. >> This is the code I'm using: >> >> cfg = []; >> cfg.rotate = 0; >> cfg.projection = 'polar'; >> newlay=ft_prepare_layout(cfg, bin1); >> cfg = []; >> >> cfg.layout  = newlay; >> cfg.yparam = 'freq'; >> cfg.xlim= [0.150 0.150]; >> cfg.ylim= [13 30]; >> cfg.zlim = [-0.10 0.10]; >> cfg.highlight          = 'on'; >> cfg.baseline = 'no'; >> cfg.commentpos = 'title'; >> cfg.shading    = 'interp'; >> cfg.interplimits = 'electrodes'; %Should work here? >> cfg.style = 'straight'; >> cfg.zparam   = 'powspctrm'; >> cfg.fontsize = 12; >> cfg.gridscale = 100; >> ft_topoplotTFR(cfg, bin1); >> >> According to the documentation,  specifying cfg.interplimits = 'electrodes' should achieve what I want here, but it still does not interpolate the plot outside of the head. >> Attached are some images generated with different cfg.interplimits and cfg.projection options. I have tried upgrading to the most recent release of FT, but it doesn't change the outcome. >> >> Any and all insight would be greatly appreciated. >> Best, >> Reyna >> >> ----------------------- >> Reyna L. Gordon >> PhD Candidate >> Center for Complex Systems & Brain Sciences >> Florida Atlantic University >> gordon at ccs.fau.edu >> >> >> >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> >> >> >> >> >> >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > -- > Roemer van der Meij MSc > Scientific Programmer&  Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From karl.doron at GMAIL.COM Sat May 1 00:22:41 2010 From: karl.doron at GMAIL.COM (Karl Doron) Date: Sat, 1 May 2010 00:22:41 +0200 Subject: Error in ft_megrealign Message-ID: I got this to compile if anyone needs it. -karl doron ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: meg_leadfield1.mexmaci64 Type: application/octet-stream Size: 8856 bytes Desc: not available URL: From ronitibon at GMAIL.COM Mon May 3 17:08:39 2010 From: ronitibon at GMAIL.COM (Roni Tibon) Date: Mon, 3 May 2010 17:08:39 +0200 Subject: Wavelet vs. Multitaper Message-ID: Dear all, I've been trying to analyze the same data using both methods, but I'm getting very different results, depending on the method I'm using. Enclosed is a picture of the results of the analysis in 3 channels, using both methods. In the left column I performed a multitaper analysis for each channel, using the following script: cfg = []; cfg.output = 'pow'; cfg.channel = 'A195'; cfg.method = 'mtmconvol'; cfg.foi = 1:1:50; cfg.t_ftimwin = 2./cfg.foi; cfg.tapsmofrq = 0.4 *cfg.foi; cfg.toi = -0.2:0.05:1; cfg.pad = 'maxperlen'; f12a_a195 = ft_freqanalysis(cfg, data); In the right one, I performed wavelet analysis using: cfg = []; cfg.channel = 'A195'; cfg.method = 'wltconvol'; cfg.output = 'pow'; cfg.foi = 1:1:50; cfg.width = 1; cfg.toi = -0.2:0.05:1; cfg.keeptrials = 'yes'; f12b_a195=freqanalysis(cfg, data); As you can see, channel A106 looks about the same using both methods. However, for channels A176 and A195, the multitaper analysis revealed activation in frequencies ranging from ~15-25, which was not seen in the wavelet analysis. I used a different program (msi) to divide the trial in two (0-500ms and 500-1000ms) and compare activation in this frequency range between the 2 halves, and indeed- there was more activation in the second half, as would be suggested by the multitaper. Can it be that when using wavelet analysis data is lost like this? Am I doing something wrong with the wavelet? Thanks, Roni ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: wavelet.jpg Type: image/jpeg Size: 93156 bytes Desc: not available URL: From r.vandermeij at DONDERS.RU.NL Mon May 3 17:36:45 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Mon, 3 May 2010 17:36:45 +0200 Subject: Wavelet vs. Multitaper In-Reply-To: Message-ID: Hi Roni, I haven't looked in detail at all the other settings you use, but you apparently use a different number of cycles for the wavelets in both methods. For the multitapers, you use 2 cycles per wavelet (which are then convolved with the set of dpss tapers), whereas you use 1 cycle for your Morlet wavelets (which are then convolved with a hanning taper (or something similar)). This will make the time-window for spectral estimation twice as long for the multitapers than for your Morlet wavelets. You could try setting cfg.width = 2 for 'wltconvol'. Hope it helps a bit, Roemer On 5/3/2010 5:08 PM, Roni Tibon wrote: > Dear all, > > I've been trying to analyze the same data using both methods, but I'm > getting very different results, depending on the method I'm using. > > Enclosed is a picture of the results of the analysis in 3 channels, using > both methods. In the left column I performed a multitaper analysis for each > channel, using the following script: > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'A195'; > cfg.method = 'mtmconvol'; > cfg.foi = 1:1:50; > cfg.t_ftimwin = 2./cfg.foi; > cfg.tapsmofrq = 0.4 *cfg.foi; > cfg.toi = -0.2:0.05:1; > cfg.pad = 'maxperlen'; > f12a_a195 = ft_freqanalysis(cfg, data); > > In the right one, I performed wavelet analysis using: > > cfg = []; > cfg.channel = 'A195'; > cfg.method = 'wltconvol'; > cfg.output = 'pow'; > cfg.foi = 1:1:50; > cfg.width = 1; > cfg.toi = -0.2:0.05:1; > cfg.keeptrials = 'yes'; > f12b_a195=freqanalysis(cfg, data); > > As you can see, channel A106 looks about the same using both methods. > However, for channels A176 and A195, the multitaper analysis revealed > activation in frequencies ranging from ~15-25, which was not seen in the > wavelet analysis. > > I used a different program (msi) to divide the trial in two (0-500ms and > 500-1000ms) and compare activation in this frequency range between the 2 > halves, and indeed- there was more activation in the second half, as would > be suggested by the multitaper. > > Can it be that when using wavelet analysis data is lost like this? > Am I doing something wrong with the wavelet? > > Thanks, > Roni > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From ronitibon at GMAIL.COM Mon May 3 20:05:19 2010 From: ronitibon at GMAIL.COM (Roni Tibon) Date: Mon, 3 May 2010 21:05:19 +0300 Subject: Wavelet vs. Multitaper In-Reply-To: <4BDEED8D.6000306@donders.ru.nl> Message-ID: Hi, Thanks for the quick response. I tried using the settings you suggested, which, of course, reduced the frequency range, and revealed some activity in ~15-25hz, although it looked minor compared to that seen in the multitaper. I guess my questions now are these: 1. How come when I use multitaper with 1 cycle I see a range starting at 5 hz, but when I use morelet wavelet with 1 cycle, the range starts at 10hz? 2. Can I conclude that when the trial is rather short multitaper will be more accurate, or more sensitive to changes? 3. How come the freq range in the multitaper changes depending on the baseline settings? It started at 5hz when cfg.baseline = [-0.2 -0.05], but started at 10hz when cfg.baseline = [-0.2 -0.1]; Thanks a lot! Roni On 3 May 2010 18:36, Roemer van der Meij wrote: > Hi Roni, > > I haven't looked in detail at all the other settings you use, but you > apparently use a different number of cycles for the wavelets in both > methods. For the multitapers, you use 2 cycles per wavelet (which are then > convolved with the set of dpss tapers), whereas you use 1 cycle for your > Morlet wavelets (which are then convolved with a hanning taper (or something > similar)). This will make the time-window for spectral estimation twice as > long for the multitapers than for your Morlet wavelets. You could try > setting cfg.width = 2 for 'wltconvol'. > > Hope it helps a bit, > > Roemer > > > > > On 5/3/2010 5:08 PM, Roni Tibon wrote: > >> Dear all, >> >> I've been trying to analyze the same data using both methods, but I'm >> getting very different results, depending on the method I'm using. >> >> Enclosed is a picture of the results of the analysis in 3 channels, using >> both methods. In the left column I performed a multitaper analysis for >> each >> channel, using the following script: >> >> cfg = []; >> cfg.output = 'pow'; >> cfg.channel = 'A195'; >> cfg.method = 'mtmconvol'; >> cfg.foi = 1:1:50; >> cfg.t_ftimwin = 2./cfg.foi; >> cfg.tapsmofrq = 0.4 *cfg.foi; >> cfg.toi = -0.2:0.05:1; >> cfg.pad = 'maxperlen'; >> f12a_a195 = ft_freqanalysis(cfg, data); >> >> In the right one, I performed wavelet analysis using: >> >> cfg = []; >> cfg.channel = 'A195'; >> cfg.method = 'wltconvol'; >> cfg.output = 'pow'; >> cfg.foi = 1:1:50; >> cfg.width = 1; >> cfg.toi = -0.2:0.05:1; >> cfg.keeptrials = 'yes'; >> f12b_a195=freqanalysis(cfg, data); >> >> As you can see, channel A106 looks about the same using both methods. >> However, for channels A176 and A195, the multitaper analysis revealed >> activation in frequencies ranging from ~15-25, which was not seen in the >> wavelet analysis. >> >> I used a different program (msi) to divide the trial in two (0-500ms and >> 500-1000ms) and compare activation in this frequency range between the 2 >> halves, and indeed- there was more activation in the second half, as would >> be suggested by the multitaper. >> >> Can it be that when using wavelet analysis data is lost like this? >> Am I doing something wrong with the wavelet? >> >> Thanks, >> Roni >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at MAC.COM Mon May 3 21:06:24 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Mon, 3 May 2010 21:06:24 +0200 Subject: Wavelet vs. Multitaper In-Reply-To: Message-ID: hi roni, > 1. How come when I use multitaper with 1 cycle I see a range starting at 5 hz, but when I use morelet wavelet with 1 cycle, the range starts at 10hz? i'm not sure. what do you mean with "range": the lowest frequency where you get a spectral estimation? just looking at your plots the difference doesn't seem dramatic: the multitaper seems to start somewhere at 6-7, the wavelet at 5. you resolution is set to 1 Hz. > 2. Can I conclude that when the trial is rather short multitaper will be more accurate, or more sensitive to changes? without being an expert: with the multitaper you have more possibilities to do "fine-tuning" (i.e. spectral and temporal resolution can be specified separately). for the have a spectral smoothing of +/- foi*.4. for your wavelet it's +/- foi/1 (your width which for wavelets fixes the temporal AND spectral resolution). this means your frequency resolution in case of the wavelet is *terrible*!! you should take a look here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis in general it seems that for doing "good" time-frequency analysis, your trial lengths are far too short, particularly if you are interested in lower frequency activity. you should be more generous when chopping your data into trials (i usually do +/- 2s or so, do TF-analysis and then home-in into interpretable periods). you can see that in your case you hardly have values in the baseline (particularly <20 Hz). when you do that (i.e. longer epochs) and use sensible m-factors (~5-7; or just use the fieldtrip default), then you will definitely get a completely different picture. i'm not religious about wavelets and multitapers. with proper use both give good and usually very similar results. as said multitapers offer more possibilities for fine-tuning, but more freedom in choice is sometimes a heavy burden :-) > 3. How come the freq range in the multitaper changes depending on the baseline settings? It started at 5hz when cfg.baseline = [-0.2 -0.05], but started at 10hz when cfg.baseline = [-0.2 -0.1]; again: take a look at the pictures. you basically have NaN's everywhere between -.2 and -.1. longer epochs are your friend. good luck, nathan > > Thanks a lot! > Roni > > > > On 3 May 2010 18:36, Roemer van der Meij wrote: > Hi Roni, > > I haven't looked in detail at all the other settings you use, but you apparently use a different number of cycles for the wavelets in both methods. For the multitapers, you use 2 cycles per wavelet (which are then convolved with the set of dpss tapers), whereas you use 1 cycle for your Morlet wavelets (which are then convolved with a hanning taper (or something similar)). This will make the time-window for spectral estimation twice as long for the multitapers than for your Morlet wavelets. You could try setting cfg.width = 2 for 'wltconvol'. > > Hope it helps a bit, > > Roemer > > > > > On 5/3/2010 5:08 PM, Roni Tibon wrote: > Dear all, > > I've been trying to analyze the same data using both methods, but I'm > getting very different results, depending on the method I'm using. > > Enclosed is a picture of the results of the analysis in 3 channels, using > both methods. In the left column I performed a multitaper analysis for each > channel, using the following script: > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'A195'; > cfg.method = 'mtmconvol'; > cfg.foi = 1:1:50; > cfg.t_ftimwin = 2./cfg.foi; > cfg.tapsmofrq = 0.4 *cfg.foi; > cfg.toi = -0.2:0.05:1; > cfg.pad = 'maxperlen'; > f12a_a195 = ft_freqanalysis(cfg, data); > > In the right one, I performed wavelet analysis using: > > cfg = []; > cfg.channel = 'A195'; > cfg.method = 'wltconvol'; > cfg.output = 'pow'; > cfg.foi = 1:1:50; > cfg.width = 1; > cfg.toi = -0.2:0.05:1; > cfg.keeptrials = 'yes'; > f12b_a195=freqanalysis(cfg, data); > > As you can see, channel A106 looks about the same using both methods. > However, for channels A176 and A195, the multitaper analysis revealed > activation in frequencies ranging from ~15-25, which was not seen in the > wavelet analysis. > > I used a different program (msi) to divide the trial in two (0-500ms and > 500-1000ms) and compare activation in this frequency range between the 2 > halves, and indeed- there was more activation in the second half, as would > be suggested by the multitaper. > > Can it be that when using wavelet analysis data is lost like this? > Am I doing something wrong with the wavelet? > > Thanks, > Roni > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- > > The aim of this list 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/ > -------------------------------------------- Dr. Nathan Weisz OBOB-Lab University of Konstanz Department of Psychology P.O. Box D23 78457 Konstanz Germany Tel: ++49 - (0)7531 - 88 45 84 Email: nathan.weisz at uni-konstanz.de Homepage: http://www.uni-konstanz.de/obob "Nothing shocks me. I'm a scientist." (Indiana Jones) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zachary.d.cohen at VANDERBILT.EDU Tue May 4 00:01:00 2010 From: zachary.d.cohen at VANDERBILT.EDU (Zachary Daniel Cohen) Date: Mon, 3 May 2010 17:01:00 -0500 Subject: timelockgrandaverage config Message-ID: Hello FieldTrip Community, Let me start off by saying thanks for an amazing analysis package; I've been using it since november with our scalp EEG data analyses and am a huge fan. I recently began looking at grandaverage cluster analyses, and wanted to check in to make sure I'm configuring everything correctly because a few things don't look right. My goal is to compare the pattern of voltage activity across the scalp for taskA vs. taskB I preprocess my scalp eeg voltage data using my own functions, I believe the important details are as follows: 60 subjects, each subject has approx 800 events where they performed taskA and 800 events where they performed taskB, although it varies with each subject. Each event is timelocked from 0ms to 1200ms. I run each subject's taskA data through timelock analysis, and then run timelockgrandaverage on the set of all subjects' taskA averages. I then do the same for taskB. I then run timelockstatistics on the two grandaverages. My cfg is set as follows: layout: 'HCGSN128_nof.sfp' neighbourdist: 0.1300 correctm: 'cluster' clusteralpha: 0.0500 alphathresh: 0.0500 method: 'montecarlo' clusterstatistic: 'maxsum' dimord: 'chan_time' numrandomization: 1000 minnbchan: 1 tail: 0 clustertail: 0 alpha: 0.0500 statistic: 'depsamplesT' uvar: 1 ivar: 2 keepindividual: 'yes' computecritval: 'no' clustercritval: 0.0500 clusterthreshold: 'parametric' cfg.design is a 2X120 double, where the top row contains the subject numbers [1:60 1:60] and the bottom row identifies what condition the data is from (1 for taskA and 2 for taskB). When the script runs, the following gets output: there are on average 9.8 neighbours per channel using "statistics_montecarlo" for the statistical testing using "statfun_depsamplesT" for the single-sample statistics constructing randomized design total number of measurements = 120 total number of variables = 2 number of independent variables = 1 number of unit variables = 1 number of within-cell variables = 0 number of control variables = 0 using a permutation resampling approach repeated measurement in variable 1 over 60 levels number of repeated measurements in each level is 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 using the specified parametric threshold for clustering computing statistic The questions I have are the following: 1. Should the total number of independent variables be 2, and the total number of unit variables be 60? 2. What should the total number of repeated measures in each level be? 3. I'm not sure whether to leave the data in 10ms bins, or to bin it as I would for publication, in say 150ms or 300ms bins, before running it through the cluster analysis. 4. How should I make intelligent decisions about neighbourdist and minnbchan? Right now I have chosen .13 because that leaves a reasonable amount of electrodes defined as neighbours, but I would prefer to base my decision on something more sound, perhaps a methods paper? 5. Finally, would using the computercritval option be a better choice than simply setting the level at .05? Thanks so much for your advice in advance! Reading these forums has helped a great deal in the past. My apologies if I omitted any important information, please let me know if I did. Best, - Zach ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From thomas.hartmann at UNI-KONSTANZ.DE Thu May 6 14:19:00 2010 From: thomas.hartmann at UNI-KONSTANZ.DE (Thomas Hartmann) Date: Thu, 6 May 2010 14:19:00 +0200 Subject: using lcvm-beamformer filter to project time-domain eeg data Message-ID: hi, i would like to use the filters generated by the lcmv-beamformer algorithm to project my plain time-domain eeg data to the sources in the brain. what puzzles me is that my eeg data in microvolts gets scaled by 10^6-10^7 after projection. what kind of unit is this? (if the data still has one...). is this scaling reliable and constant over subjects? thanks in advance for your help, thomas -- Dipl. Psych. Thomas Hartmann OBOB-Lab University of Konstanz Department of Psychology P.O. Box D25 78457 Konstanz Germany Tel.: +49 (0)7531 88 4612 Fax: +49 (0)7531-88 4601 Email: thomas.hartmann at uni-konstanz.de Homepage: http://www.uni-konstanz.de/obob "I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan Doyle) ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From recasensmarc at GMAIL.COM Thu May 6 20:38:40 2010 From: recasensmarc at GMAIL.COM (Marc Recasens) Date: Thu, 6 May 2010 20:38:40 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Hello, I'm new in Fieldtrip and I find myself needed of some help :) I'm currently analysing some MEG data (4D-Neuroimaging, Magnes 2500WH) and trying to create a Single-Shell headmodel using a segmented mri. . I've read all the documentation on FT website but I'm still stuck. The volume never fits in the correct position inside the sensor helmet. First of all, I create a segmented MRI using Analyse images (.img'), and the segmentation is performed using: cfg.coordinates = 'spm'; cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates\T1.mnc'; segmentedmri = ft_volumesegment (cfg, mri); segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior volumerealign. Then, I do a volumerealign by selecting manually the fiducial points (Nas, Lpa, Rpa), as I actually don't have fiducials on the MRI scans. cfg.method = 'realignfiducial'; cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) cfg.fiducial.lpa = Lpa; cfg.fiducial.rpa = Rpa; segmented_r = ft_volumerealign (cfg, segmentedmri); Finally I create a volume through the ft_prepare_singleshell (cfg, segmented_r) function and plot it. I have the fiducials or head position coils and the scalp registered by means of a Polhemus digitizer.. Though the segment via ft_sourceplot (doing the: segment.avg.pow = segment.gray+...) looks right, the headmodelplot shows that the volume and the headshape don't fit. Is there any possibility to realign the segmented mri according either to the headshape points either to the MEG fiducials? I'm afraid the answer is no in both cases (as the MRI and MEG coordinates are different). I tried to realign the segment interactively by selecting the positions where the coils in the MRI should be... but as the picture shows, it doesn't fit. am I doing something wrong or skipping some important step? Is it possible to transform MRI coordinate system to MEG-head coordinate system? Would it help? [image: singleshell.jpg][image: singleshell2.jpg] I attach a picture of what i've managed to do till now! Thanks for all!!! -- Marc Recasens Tel.: +34 639 24 15 98 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: singleshell2.jpg Type: image/jpeg Size: 31112 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: singleshell.jpg Type: image/jpeg Size: 31681 bytes Desc: not available URL: From jan.schoffelen at DONDERS.RU.NL Fri May 7 09:01:05 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Fri, 7 May 2010 09:01:05 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Dear Marc, It seems to me that there is an issue with the coordinate system in which your original MRI is expressed. This could be related to the order of the steps you take, so I would permute the order and see whether this makes any difference at all (for me it usually works fine as follows:) First do a call to ft_volumerealign using your single subject's MRI. This step should give you the transformation matrix from voxel to headspace according to CTF's convention (which happens to be the same as 4d). Then do a segmentation of the output of ft_volumerealign, but note that you should specify ctf.coordinates = 'ctf'. Then you can proceed to create the single shell volume conductor model (after checking whether the segmentation worked fine with respect to the orientation etc of the resulting volumes; I believe there is some documentation about this on the website) and plot the results. Hopefully this helps, Best, Jan-Mathijs On May 6, 2010, at 8:38 PM, Marc Recasens wrote: > Hello, > > I'm new in Fieldtrip and I find myself needed of some help :) > I'm currently analysing some MEG data (4D-Neuroimaging, Magnes > 2500WH) and trying to create a Single-Shell headmodel using a > segmented mri. > . I've read all the documentation on FT website but I'm still stuck. > The volume never fits in the correct position inside the sensor > helmet. > > First of all, I create a segmented MRI using Analyse images > (.img'), and the segmentation is performed using: > cfg.coordinates = 'spm'; > cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates > \T1.mnc'; > segmentedmri = ft_volumesegment (cfg, mri); > segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior > volumerealign. > > Then, I do a volumerealign by selecting manually the fiducial points > (Nas, Lpa, Rpa), as I actually don't have fiducials on the MRI scans. > cfg.method = 'realignfiducial'; > cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) > cfg.fiducial.lpa = Lpa; > cfg.fiducial.rpa = Rpa; > segmented_r = ft_volumerealign (cfg, segmentedmri); > > > Finally I create a volume through the ft_prepare_singleshell (cfg, > segmented_r) function and plot it. > I have the fiducials or head position coils and the scalp registered > by means of a Polhemus digitizer.. > Though the segment via ft_sourceplot (doing the: segment.avg.pow = > segment.gray+...) looks right, the headmodelplot shows that the > volume and the headshape don't fit. > > Is there any possibility to realign the segmented mri according > either to the headshape points either to the MEG fiducials? I'm > afraid the answer is no in both cases (as the MRI and MEG > coordinates are different). I tried to realign the segment > interactively by selecting the positions where the coils in the MRI > should be... but as the picture shows, it doesn't fit. > am I doing something wrong or skipping some important step? > Is it possible to transform MRI coordinate system to MEG-head > coordinate system? Would it help? > > > > I attach a picture of what i've managed to do till now! > > > > Thanks for all!!! > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > > ---------------------------------- > > The aim of this list 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/ > Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mlindegaard at MSN.COM Fri May 7 14:43:57 2010 From: mlindegaard at MSN.COM (Mette Lindegaard) Date: Fri, 7 May 2010 14:43:57 +0200 Subject: File format and source reconstruction Message-ID: Dear FiledTrip experts, We are two engineering students from the Technical University of Denmark right now writing a bachlor project about EEG source reconstruction. We have EEG-data from 16 patients in the file format .rec. The data is already preprocessed and divided into artefact free segments of approximately 1-3 seconds. We have already converted the data to .mat format, where there is a .mat file for each of the 19 electrodes and segment. Our first challenge is to import the data into something fieldtrip recognizes, whereafter our main goal is to calculate a 3D source reconstruction with the LORETA algorithm. We hope that this isn't a too big question for you to answer. Best regards Sofie Therese Hansen and Mette Lindegaard. _________________________________________________________________ Surfa tryggt med Internet Explorer 8 http://www.microsoft.com/sverige/windows/internet-explorer/default.aspx ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From grion at SISSA.IT Fri May 7 16:06:27 2010 From: grion at SISSA.IT (Natalia Grion) Date: Fri, 7 May 2010 16:06:27 +0200 Subject: Error: checkdata at 381 This function requires raw data as input Message-ID: Dear all, I have this error when running freqanalysis: ??? Error using ==> checkdata at 381 This function requires raw data as input. My data comes from a preprocessing procedure where i just append daily sessions with 8 channel lfp recordings and several trials from the same subject) and it has this shape: hdr: [1x1 struct] label: {8x1 cell} trial: {1x349 cell} time: {1x349 cell} fsample: 2003 cfg: [1x1 struct] when i run checkdata alone I obtain the message i expect: B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset','yes'); the input is raw data with 8 channels and 349 trials This error message sounds odd to me as I never had this problem in the past. I changed to Matlab 2009a in a 64bit win system (Could this info help to solve the problem?) Any idea? Thanks in advance. Natalia ---------------------------------------------------------------- SISSA Webmail https://webmail.sissa.it/ Powered by SquirrelMail http://www.squirrelmail.org/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Fri May 7 16:12:43 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Fri, 7 May 2010 16:12:43 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <58071.147.122.60.164.1273241187.squirrel@webmail.sissa.it> Message-ID: Hi Natalia, Could you post the cfg-settings you use when calling ft_freqanalysis and the full matlab error output? This will help us track down the cause of the error. Also, did you use ft_appenddata for appending your recordings or did you do it by hand? Best, Roemer On 5/7/2010 4:06 PM, Natalia Grion wrote: > Dear all, > I have this error when running freqanalysis: > ??? Error using ==> checkdata at 381 > This function requires raw data as input. > My data comes from a preprocessing procedure where i just append daily > sessions with 8 channel lfp recordings and several trials from the same > subject) and it has this shape: > > hdr: [1x1 struct] > label: {8x1 cell} > trial: {1x349 cell} > time: {1x349 cell} > fsample: 2003 > cfg: [1x1 struct] > > when i run checkdata alone I obtain the message i expect: > B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', > 'hasoffset','yes'); > the input is raw data with 8 channels and 349 trials > This error message sounds odd to me as I never had this problem in the past. > I changed to Matlab 2009a in a 64bit win system (Could this info help to > solve the problem?) > Any idea? > Thanks in advance. > Natalia > > > > > ---------------------------------------------------------------- > SISSA Webmail https://webmail.sissa.it/ > Powered by SquirrelMail http://www.squirrelmail.org/ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jan.schoffelen at DONDERS.RU.NL Fri May 7 16:18:27 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Fri, 7 May 2010 16:18:27 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <4BE41FDB.7060508@donders.ru.nl> Message-ID: Adding to Roemer's questions: What is the fieldtrip version you are using? Next to this, it is also insightful/helpful to look into what causes the error yourself: if you type dbstop if error on the command line, when the function crashes you end up within the local workspace of the crashing function, allowing you to investigate the cause of your error. Best, Jan-Mathijs On May 7, 2010, at 4:12 PM, Roemer van der Meij wrote: > Hi Natalia, > > Could you post the cfg-settings you use when calling ft_freqanalysis > and the full matlab error output? This will help us track down the > cause of the error. Also, did you use ft_appenddata for appending > your recordings or did you do it by hand? > > Best, > Roemer > > > > > On 5/7/2010 4:06 PM, Natalia Grion wrote: >> Dear all, >> I have this error when running freqanalysis: >> ??? Error using ==> checkdata at 381 >> This function requires raw data as input. >> My data comes from a preprocessing procedure where i just append >> daily >> sessions with 8 channel lfp recordings and several trials from the >> same >> subject) and it has this shape: >> >> hdr: [1x1 struct] >> label: {8x1 cell} >> trial: {1x349 cell} >> time: {1x349 cell} >> fsample: 2003 >> cfg: [1x1 struct] >> >> when i run checkdata alone I obtain the message i expect: >> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >> 'hasoffset','yes'); >> the input is raw data with 8 channels and 349 trials >> This error message sounds odd to me as I never had this problem in >> the past. >> I changed to Matlab 2009a in a 64bit win system (Could this info >> help to >> solve the problem?) >> Any idea? >> Thanks in advance. >> Natalia >> >> >> >> >> ---------------------------------------------------------------- >> SISSA Webmail https://webmail.sissa.it/ >> Powered by SquirrelMail http://www.squirrelmail.org/ >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From grion at SISSA.IT Fri May 7 16:28:12 2010 From: grion at SISSA.IT (Natalia Grion) Date: Fri, 7 May 2010 16:28:12 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <4BE41FDB.7060508@donders.ru.nl> Message-ID: Sure. here are the settings, cfgfreqan=[]; cfgfreqan.method= 'wltconvol'; cfgfreqan.output = 'pow'; cfgfreqan.channel = {'H_LFP_1'}; cfgfreqan.keeptrials = 'no'; cfgfreqan.foi = [4:0.1:12]; cfgfreqan.toi = [-2:0.010:2]; cfgfreqan.width = 5; freqout=freqanalysis(cfgfreqan,data); And the full matlab error message: ??? Error using ==> checkdata at 381 This function requires raw data as input. Error in ==> freqanalysis at 165 data = checkdata(data, 'datatype', 'raw', 'feedback', 'yes', 'hasoffset', 'yes'); Error in ==> Spctrgrm_ThetaWlt_AllRats at 25 freqout=freqanalysis(cfgfreqan,data); About appending data: I'm using appenddata function, which generate the structure I wrote in the past mail. Hope this info helps, Natalia > Hi Natalia, > > Could you post the cfg-settings you use when calling ft_freqanalysis and > the full matlab error output? This will help us track down the cause of > the error. Also, did you use ft_appenddata for appending your recordings > or did you do it by hand? > > Best, > Roemer > > > > > On 5/7/2010 4:06 PM, Natalia Grion wrote: >> Dear all, >> I have this error when running freqanalysis: >> ??? Error using ==> checkdata at 381 >> This function requires raw data as input. >> My data comes from a preprocessing procedure where i just append daily >> sessions with 8 channel lfp recordings and several trials from the same >> subject) and it has this shape: >> >> hdr: [1x1 struct] >> label: {8x1 cell} >> trial: {1x349 cell} >> time: {1x349 cell} >> fsample: 2003 >> cfg: [1x1 struct] >> >> when i run checkdata alone I obtain the message i expect: >> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >> 'hasoffset','yes'); >> the input is raw data with 8 channels and 349 trials >> This error message sounds odd to me as I never had this problem in the >> past. >> I changed to Matlab 2009a in a 64bit win system (Could this info help to >> solve the problem?) >> Any idea? >> Thanks in advance. >> Natalia >> >> >> >> >> ---------------------------------------------------------------- >> SISSA Webmail https://webmail.sissa.it/ >> Powered by SquirrelMail http://www.squirrelmail.org/ >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------------------------------------- SISSA Webmail https://webmail.sissa.it/ Powered by SquirrelMail http://www.squirrelmail.org/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From grion at SISSA.IT Fri May 7 16:43:18 2010 From: grion at SISSA.IT (Natalia Grion) Date: Fri, 7 May 2010 16:43:18 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: Message-ID: I'm being running fieldtrip-20090629, but i also test this problem for a newest version (fieldtrip-20100418) that gave me the same error. I also tried to go into the error to see which is the cause: when inspecting checkdata result on the line israw = datatype(data, 'raw'); gives me israw= 0 which is not the case on my data as it has all the fields and types necessary to be classified as "israw" israw = isfield(data, 'label') && isfield(data, 'time') && isa(data.time, 'cell') && isfield(data, 'trial') && isa(data.trial, 'cell'); I explained before that when running checkdata independently of freqanalysis it works. hope this info also helps, natalia > Adding to Roemer's questions: > > What is the fieldtrip version you are using? > Next to this, it is also insightful/helpful to look into what causes > the error yourself: if you type dbstop if error on the command line, > when the function crashes you end up within the local workspace of the > crashing function, allowing you to investigate the cause of your error. > > Best, > > Jan-Mathijs > > On May 7, 2010, at 4:12 PM, Roemer van der Meij wrote: > >> Hi Natalia, >> >> Could you post the cfg-settings you use when calling ft_freqanalysis >> and the full matlab error output? This will help us track down the >> cause of the error. Also, did you use ft_appenddata for appending >> your recordings or did you do it by hand? >> >> Best, >> Roemer >> >> >> >> >> On 5/7/2010 4:06 PM, Natalia Grion wrote: >>> Dear all, >>> I have this error when running freqanalysis: >>> ??? Error using ==> checkdata at 381 >>> This function requires raw data as input. >>> My data comes from a preprocessing procedure where i just append >>> daily >>> sessions with 8 channel lfp recordings and several trials from the >>> same >>> subject) and it has this shape: >>> >>> hdr: [1x1 struct] >>> label: {8x1 cell} >>> trial: {1x349 cell} >>> time: {1x349 cell} >>> fsample: 2003 >>> cfg: [1x1 struct] >>> >>> when i run checkdata alone I obtain the message i expect: >>> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >>> 'hasoffset','yes'); >>> the input is raw data with 8 channels and 349 trials >>> This error message sounds odd to me as I never had this problem in >>> the past. >>> I changed to Matlab 2009a in a 64bit win system (Could this info >>> help to >>> solve the problem?) >>> Any idea? >>> Thanks in advance. >>> Natalia >>> >>> >>> >>> >>> ---------------------------------------------------------------- >>> SISSA Webmail https://webmail.sissa.it/ >>> Powered by SquirrelMail http://www.squirrelmail.org/ >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> -- >> Roemer van der Meij MSc >> Scientific Programmer& Data-Analyst >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3612631 >> E-mail: r.vandermeij at donders.ru.nl >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html >> and http://www.ru.nl/neuroimaging/fieldtrip. > > Dr. J.M. (Jan-Mathijs) Schoffelen > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > J.Schoffelen at donders.ru.nl > Telephone: 0031-24-3668063 > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------------------------------------- SISSA Webmail https://webmail.sissa.it/ Powered by SquirrelMail http://www.squirrelmail.org/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From recasensmarc at GMAIL.COM Fri May 7 16:59:03 2010 From: recasensmarc at GMAIL.COM (Marc Recasens) Date: Fri, 7 May 2010 16:59:03 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Thanks Jan for the rapid response, I followed the steps using ctf coords and the segmented volume fits perfectly well in the skull using sourceplot. The volume seems to fit better into the headshape. However, as can be seen in the picture, there's still a big space from the posterior part of the brain to the posterior part of the head shape. I suppose this Can be due to a bad realignment (?). As I mentioned, I have no fiducial points in the MRI scans, so I have to select the nas, lpa and rpa with no physical reference. I guess there is no alternative in this case but using another volume or trying to align the volume manually until it fits in the headshape, isn't it? Can the volume segment be aligned in connection to the headshape automatically? thank you for the help! Bests, [image: CTFvolume.jpg] On Fri, May 7, 2010 at 9:01 AM, jan-mathijs schoffelen < jan.schoffelen at donders.ru.nl> wrote: > Dear Marc, > > It seems to me that there is an issue with the coordinate system in which > your original MRI is expressed. This could be related to the order of the > steps you take, so I would permute the order and see whether this makes any > difference at all (for me it usually works fine as follows:) > > First do a call to ft_volumerealign using your single subject's MRI. This > step should give you the transformation matrix from voxel to headspace > according to CTF's convention (which happens to be the same as 4d). > Then do a segmentation of the output of ft_volumerealign, but note that you > should specify ctf.coordinates = 'ctf'. > Then you can proceed to create the single shell volume conductor model > (after checking whether the segmentation worked fine with respect to the > orientation etc of the resulting volumes; I believe there is some > documentation about this on the website) and plot the results. > > Hopefully this helps, > > Best, > > Jan-Mathijs > > On May 6, 2010, at 8:38 PM, Marc Recasens wrote: > > Hello, > > I'm new in Fieldtrip and I find myself needed of some help :) > I'm currently analysing some MEG data (4D-Neuroimaging, Magnes 2500WH) and > trying to create a Single-Shell headmodel using a segmented mri. > . I've read all the documentation on FT website but I'm still stuck. The > volume never fits in the correct position inside the sensor helmet. > > First of all, I create a segmented MRI using Analyse images (.img'), and > the segmentation is performed using: > cfg.coordinates = 'spm'; > cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates\T1.mnc'; > segmentedmri = ft_volumesegment (cfg, mri); > segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior > volumerealign. > > Then, I do a volumerealign by selecting manually the fiducial points (Nas, > Lpa, Rpa), as I actually don't have fiducials on the MRI scans. > cfg.method = 'realignfiducial'; > cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) > cfg.fiducial.lpa = Lpa; > cfg.fiducial.rpa = Rpa; > segmented_r = ft_volumerealign (cfg, segmentedmri); > > > Finally I create a volume through the ft_prepare_singleshell (cfg, > segmented_r) function and plot it. > I have the fiducials or head position coils and the scalp registered by > means of a Polhemus digitizer.. > Though the segment via ft_sourceplot (doing the: segment.avg.pow = > segment.gray+...) looks right, the headmodelplot shows that the volume and > the headshape don't fit. > > Is there any possibility to realign the segmented mri according either to > the headshape points either to the MEG fiducials? I'm afraid the answer is > no in both cases (as the MRI and MEG coordinates are different). I tried to > realign the segment interactively by selecting the positions where the coils > in the MRI should be... but as the picture shows, it doesn't fit. > am I doing something wrong or skipping some important step? > Is it possible to transform MRI coordinate system to MEG-head coordinate > system? Would it help? > > > > > I attach a picture of what i've managed to do till now! > > > > Thanks for all!!! > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > > ---------------------------------- > > The aim of this list 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/ > > > Dr. J.M. (Jan-Mathijs) Schoffelen > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > J.Schoffelen at donders.ru.nl > Telephone: 0031-24-3668063 > > ---------------------------------- > > The aim of this list 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/ > -- Marc Recasens Tel.: +34 639 24 15 98 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: CTFvolume.jpg Type: image/jpeg Size: 28004 bytes Desc: not available URL: From nathanweisz at MAC.COM Fri May 7 17:24:25 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Fri, 7 May 2010 17:24:25 +0200 Subject: fit volume segment and sensors? In-Reply-To: Message-ID: Dear Marc, we use nutmeg to do co-registration. http://nutmeg.berkeley.edu/index.php?title=Main_Page in a first step we define fiducials manually, similar to volumerealign. in a second step -with the help of a magic button doing "complex things" (or was it stuff)- you can use the headshape to get even some better matching. then from the command line: global nuts st %mri is the MRI structure read into firldtrip with read_fcdc_mri mri.transform=inv(nuts.coreg.meg2mri_tfm)*st.vols{1}.mat; from there on you can continue with your forward modeling as before. good luck, nathan On 07.05.2010, at 16:59, Marc Recasens wrote: > Thanks Jan for the rapid response, > > I followed the steps using ctf coords and the segmented volume fits perfectly well in the skull using sourceplot. The volume seems to fit better into the headshape. However, as can be seen in the picture, there's still a big space from the posterior part of the brain to the posterior part of the head shape. I suppose this Can be due to a bad realignment (?). As I mentioned, I have no fiducial points in the MRI scans, so I have to select the nas, lpa and rpa with no physical reference. I guess there is no alternative in this case but using another volume or trying to align the volume manually until it fits in the headshape, isn't it? Can the volume segment be aligned in connection to the headshape automatically? > > thank you for the help! > > Bests, > > > > > > On Fri, May 7, 2010 at 9:01 AM, jan-mathijs schoffelen wrote: > Dear Marc, > > It seems to me that there is an issue with the coordinate system in which your original MRI is expressed. This could be related to the order of the steps you take, so I would permute the order and see whether this makes any difference at all (for me it usually works fine as follows:) > > First do a call to ft_volumerealign using your single subject's MRI. This step should give you the transformation matrix from voxel to headspace according to CTF's convention (which happens to be the same as 4d). > Then do a segmentation of the output of ft_volumerealign, but note that you should specify ctf.coordinates = 'ctf'. > Then you can proceed to create the single shell volume conductor model (after checking whether the segmentation worked fine with respect to the orientation etc of the resulting volumes; I believe there is some documentation about this on the website) and plot the results. > > Hopefully this helps, > > Best, > > Jan-Mathijs > > On May 6, 2010, at 8:38 PM, Marc Recasens wrote: > >> Hello, >> >> I'm new in Fieldtrip and I find myself needed of some help :) >> I'm currently analysing some MEG data (4D-Neuroimaging, Magnes 2500WH) and trying to create a Single-Shell headmodel using a segmented mri. >> . I've read all the documentation on FT website but I'm still stuck. The volume never fits in the correct position inside the sensor helmet. >> >> First of all, I create a segmented MRI using Analyse images (.img'), and the segmentation is performed using: >> cfg.coordinates = 'spm'; >> cfg.template = 'C:\...\MATLAB\R2007a\toolbox\spm2\templates\T1.mnc'; >> segmentedmri = ft_volumesegment (cfg, mri); >> segmentedmri.anatomy = mri.anatomy; <--- I use that for posterior volumerealign. >> >> Then, I do a volumerealign by selecting manually the fiducial points (Nas, Lpa, Rpa), as I actually don't have fiducials on the MRI scans. >> cfg.method = 'realignfiducial'; >> cfg.fiducial.nas = Nas; <--- (I get this from headshape.fid) >> cfg.fiducial.lpa = Lpa; >> cfg.fiducial.rpa = Rpa; >> segmented_r = ft_volumerealign (cfg, segmentedmri); >> >> >> Finally I create a volume through the ft_prepare_singleshell (cfg, segmented_r) function and plot it. >> I have the fiducials or head position coils and the scalp registered by means of a Polhemus digitizer.. >> Though the segment via ft_sourceplot (doing the: segment.avg.pow = segment.gray+...) looks right, the headmodelplot shows that the volume and the headshape don't fit. >> >> Is there any possibility to realign the segmented mri according either to the headshape points either to the MEG fiducials? I'm afraid the answer is no in both cases (as the MRI and MEG coordinates are different). I tried to realign the segment interactively by selecting the positions where the coils in the MRI should be... but as the picture shows, it doesn't fit. >> am I doing something wrong or skipping some important step? >> Is it possible to transform MRI coordinate system to MEG-head coordinate system? Would it help? >> >> >> >> >> I attach a picture of what i've managed to do till now! >> >> >> >> Thanks for all!!! >> >> >> >> -- >> Marc Recasens >> Tel.: +34 639 24 15 98 >> >> ---------------------------------- >> >> The aim of this list 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/ >> > > Dr. J.M. (Jan-Mathijs) Schoffelen > Donders Institute for Brain, Cognition and Behaviour, > Centre for Cognitive Neuroimaging, > Radboud University Nijmegen, The Netherlands > J.Schoffelen at donders.ru.nl > Telephone: 0031-24-3668063 > > ---------------------------------- > > The aim of this list 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/ > > > > > -- > Marc Recasens > Tel.: +34 639 24 15 98 > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.doron at GMAIL.COM Sat May 8 19:04:05 2010 From: karl.doron at GMAIL.COM (Karl Doron) Date: Sat, 8 May 2010 19:04:05 +0200 Subject: redefinetrial on freq output Message-ID: Hello, Is it possible to use redefine trial on data from freqanalysis? I need to do the frequency analysis on long segments of data to recover low frequencies, but am interested in comparing one cycle of alpha at two non-overlapping time segments within each trial. Thanks, karl doron ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From nathanweisz at MAC.COM Sat May 8 21:55:23 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Sat, 8 May 2010 21:55:23 +0200 Subject: redefinetrial on freq output In-Reply-To: Message-ID: hi, the documentation of ft_redefinetrial says that it wants the output of preprocessing.m. however, using nearest.m it should be very easy to make your home-made "redefinefreq" function. good luck, nathan On 08.05.2010, at 19:04, Karl Doron wrote: > Hello, > > Is it possible to use redefine trial on data from freqanalysis? I need to do the frequency > analysis on long segments of data to recover low frequencies, but am interested in > comparing one cycle of alpha at two non-overlapping time segments within each trial. > > Thanks, > karl doron > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Mon May 10 09:27:21 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Mon, 10 May 2010 09:27:21 +0200 Subject: Error: checkdata at 381 This function requires raw data as input In-Reply-To: <58253.147.122.60.164.1273243398.squirrel@webmail.sissa.it> Message-ID: Hi Natalia, Thanks for all the extra information, that really helps in getting to the bottom of the bug. I still can't see any reason though why you should get the errors you're getting. Could you perhaps append a small bit of the data (e.g. 2 or 3 trials, a few MB's max) so I can track the data as it goes through the code using the settings you already provided? Best, Roemer On 5/7/2010 4:43 PM, Natalia Grion wrote: > I'm being running fieldtrip-20090629, but i also test this problem for a > newest version (fieldtrip-20100418) that gave me the same error. I also > tried to go into the error to see which is the cause: when inspecting > checkdata result on the line > israw = datatype(data, 'raw'); > gives me israw= 0 > which is not the case on my data as it has all the fields and types > necessary to be classified as "israw" > israw = isfield(data, 'label')&& isfield(data, 'time')&& > isa(data.time, 'cell')&& isfield(data, 'trial')&& isa(data.trial, > 'cell'); > I explained before that when running checkdata independently of > freqanalysis it works. > hope this info also helps, > natalia > > > >> Adding to Roemer's questions: >> >> What is the fieldtrip version you are using? >> Next to this, it is also insightful/helpful to look into what causes >> the error yourself: if you type dbstop if error on the command line, >> when the function crashes you end up within the local workspace of the >> crashing function, allowing you to investigate the cause of your error. >> >> Best, >> >> Jan-Mathijs >> >> On May 7, 2010, at 4:12 PM, Roemer van der Meij wrote: >> >> >>> Hi Natalia, >>> >>> Could you post the cfg-settings you use when calling ft_freqanalysis >>> and the full matlab error output? This will help us track down the >>> cause of the error. Also, did you use ft_appenddata for appending >>> your recordings or did you do it by hand? >>> >>> Best, >>> Roemer >>> >>> >>> >>> >>> On 5/7/2010 4:06 PM, Natalia Grion wrote: >>> >>>> Dear all, >>>> I have this error when running freqanalysis: >>>> ??? Error using ==> checkdata at 381 >>>> This function requires raw data as input. >>>> My data comes from a preprocessing procedure where i just append >>>> daily >>>> sessions with 8 channel lfp recordings and several trials from the >>>> same >>>> subject) and it has this shape: >>>> >>>> hdr: [1x1 struct] >>>> label: {8x1 cell} >>>> trial: {1x349 cell} >>>> time: {1x349 cell} >>>> fsample: 2003 >>>> cfg: [1x1 struct] >>>> >>>> when i run checkdata alone I obtain the message i expect: >>>> B = checkdata( data, 'datatype', 'raw', 'feedback', 'yes', >>>> 'hasoffset','yes'); >>>> the input is raw data with 8 channels and 349 trials >>>> This error message sounds odd to me as I never had this problem in >>>> the past. >>>> I changed to Matlab 2009a in a 64bit win system (Could this info >>>> help to >>>> solve the problem?) >>>> Any idea? >>>> Thanks in advance. >>>> Natalia >>>> >>>> >>>> >>>> >>>> ---------------------------------------------------------------- >>>> SISSA Webmail https://webmail.sissa.it/ >>>> Powered by SquirrelMail http://www.squirrelmail.org/ >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between users >>>> of the FieldTrip toolbox, to share experiences and to discuss new >>>> ideas for MEG and EEG analysis. See also >>>> http://listserv.surfnet.nl/archives/fieldtrip.html >>>> and http://www.ru.nl/neuroimaging/fieldtrip. >>>> >>>> >>> -- >>> Roemer van der Meij MSc >>> Scientific Programmer& Data-Analyst >>> Donders Institute for Brain, Cognition and Behaviour >>> Centre for Cognition >>> P.O. Box 9104 >>> 6500 HE Nijmegen >>> The Netherlands >>> Tel: +31(0)24 3612631 >>> E-mail: r.vandermeij at donders.ru.nl >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users >>> of the FieldTrip toolbox, to share experiences and to discuss new >>> ideas for MEG and EEG analysis. See also >>> http://listserv.surfnet.nl/archives/fieldtrip.html >>> and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> Dr. J.M. (Jan-Mathijs) Schoffelen >> Donders Institute for Brain, Cognition and Behaviour, >> Centre for Cognitive Neuroimaging, >> Radboud University Nijmegen, The Netherlands >> J.Schoffelen at donders.ru.nl >> Telephone: 0031-24-3668063 >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the >> FieldTrip toolbox, to share experiences and to discuss new ideas for MEG >> and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > > ---------------------------------------------------------------- > SISSA Webmail https://webmail.sissa.it/ > Powered by SquirrelMail http://www.squirrelmail.org/ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From tadel at USC.EDU Mon May 10 22:55:42 2010 From: tadel at USC.EDU (=?ISO-8859-1?Q?Fran=E7ois_Tadel?=) Date: Mon, 10 May 2010 13:55:42 -0700 Subject: Engineer position at USC, Los Angeles, January 2011 Message-ID: Dear all, Below is the description of a position opening at USC, Los Angeles, in January 2011. Thanks for spreading the word. Francois Tadel ------------------------------------------------------------------------ Research Programmer, University of Southern California, Los Angeles, USA The Department of Electrical Engineering at the University of Southern California is seeking a research programmer to participate in the development, distribution and support of software for functional brain mapping. The programmer will be responsible for implementing software for all phases of the analysis of magnetoencephalograpy (MEG) and electroencephalography (EEG) data and its integration of other functional and structural imaging modalities. The resulting software, which will be developed under grant support from the National Institutes of Health, will be distributed to researchers throughout the US and the rest of the world, for analysis of data collected in cognitive neuroscience and clinical research studies. This project will be conducted under the supervision of Professor Richard Leahy in the Department of Electrical Engineering and will involve close collaboration with researchers at USC and other institutions. Responsibilities * Play a leading role in developing common workflow, data structures, and file formats for use in analysis of MEG and EEG data. * Develop and document code to implement algorithms for analysis and display of M/EEG data. * Development of procedures for automated testing of software and software updates. * Develop and support procedures for distribution and documentation of new software. * Participate in training of users * Participate in research meetings and interact with PhD students, postdocs and research faculty in Dr. Leahy's lab in the development of new approaches to the analysis of MEG and EEG data. * Work with collaborators who are also developing software to facilitate interoperability between software packages with the ultimate goal of producing a single software package for EEG and MEG data analysis. * More information about Brainstorm, the existing software package: http://neuroimage.usc.edu/brainstorm Minimum qualifications * Masters Degree in Computer Science or Electrical Engineering * 2 years post graduate experience * Knowledge of the basic principles underlying EEG and MEG signal processing * Programming experience with Matlab and Java Conditions of employment * Starting from January 2011 * Duration: position available for a minimum of two years * Salary: depends on experience and qualifications * USC has excellent benefits, including health benefits and retirement plans with employer contributions after six months. * The University of Southern California values diversity and is committed to equal opportunity in employment. Application * To apply, please send an email to Francois Tadel, main developer of the Brainstorm software: tadel at usc.edu. * Your application should include: your CV, a description of your programming skills, a detailed description of your previous software development projects. * Application deadline: Open until filled. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aardesta at UCLA.EDU Thu May 13 00:44:42 2010 From: aardesta at UCLA.EDU (Allen Ardestani) Date: Wed, 12 May 2010 15:44:42 -0700 Subject: Error in timelockstatistics Message-ID: Hi everyone, I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: method: 'montecarlo' statistic: 'indepsamplesT' correctm: 'cluster' clusteralpha: 0.0500 clusterstatistic: 'maxsum' tail: 0 clustertail: 0 alpha: 0.0250 numrandomization: 100 design: [1x267 double] channel: 'F1' minnbchan: 0 layout: 'layout.mat' ivar: 1 I get the following error message: ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. Error in ==> findcluster at 89 [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); Error in ==> clusterstat at 194 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> statistics_montecarlo at 321 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 285 [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); Error in ==> ft_timelockstatistics at 96 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I'm assuming that part of the problem is that I don't have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I'm a new user, so any advice is much appreciated. Thanks in advance! ____________________________________________________________________________ ______ Allen Ardestani Email: aardesta at ucla.edu Phone: (310) 825-5528 Medical Scientist Training Program David Geffen School of Medicine at UCLA Semel Institute for Neuroscience and Human Behavior 760 Westwood Plaza Los Angeles, CA 90095-1759 USA ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at MAC.COM Thu May 13 10:21:45 2010 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Thu, 13 May 2010 10:21:45 +0200 Subject: Error in timelockstatistics In-Reply-To: <000c01caf224$b705de40$25119ac0$@edu> Message-ID: Dear Allen, you need bwlabeln anyhow, no matter how you want to cluster (the function can cluster in n-dimensions). so getting the Image Processing Toolbox may be a good investment if you decide to use fieldtrip statistics in future. an -untested- alternative may be to use the octave version of bwlabeln. usually the code is very compatible to matlab, i.e. if it does not run out-of-the-box it usually just needs a little tweaking. however it may be a lot slower. http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/image/bwlabel.m http://www.gnu.org/software/octave/index.html good luck, nathan On 13.05.2010, at 00:44, Allen Ardestani wrote: > Hi everyone, > I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: > > method: 'montecarlo' > statistic: 'indepsamplesT' > correctm: 'cluster' > clusteralpha: 0.0500 > clusterstatistic: 'maxsum' > tail: 0 > clustertail: 0 > alpha: 0.0250 > numrandomization: 100 > design: [1x267 double] > channel: 'F1' > minnbchan: 0 > layout: 'layout.mat' > ivar: 1 > > > I get the following error message: > > ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. > > Error in ==> findcluster at 89 > [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); > > Error in ==> clusterstat at 194 > posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); > > Error in ==> statistics_montecarlo at 321 > [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); > > Error in ==> statistics_wrapper at 285 > [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); > > Error in ==> ft_timelockstatistics at 96 > [stat, cfg] = statistics_wrapper(cfg, varargin{:}); > > > I’m assuming that part of the problem is that I don’t have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I’m a new user, so any advice is much appreciated. > > Thanks in advance! > __________________________________________________________________________________ > Allen Ardestani Email: aardesta at ucla.edu > Phone: (310) 825-5528 > Medical Scientist Training Program > David Geffen School of Medicine at UCLA > Semel Institute for Neuroscience and Human Behavior > 760 Westwood Plaza > Los Angeles, CA 90095-1759 > USA > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From teristam at GMAIL.COM Wed May 19 05:59:16 2010 From: teristam at GMAIL.COM (teris tam) Date: Wed, 19 May 2010 11:59:16 +0800 Subject: Some suggestion for improving performance in reading buffer event in ft_read_event Message-ID: Dear all, When I am profiling the performance of reading buffer event in ft_read_event, in around line 710, I see the following code causing a performance neck: for i=1:length(evt) % convert the field "type" into the Matlab representation this_type = type{evt(i).type_type+1}; this_size = wordsize{evt(i).type_type+1} * evt(i).type_numel; sel = 1:this_size; if strcmp(this_type, 'char') event(i).type = char(evt(i).buf(sel)); else event(i).type = typecast(evt(i).buf(sel), this_type); end . . . end If I understand correctly, what the code is currently doing is to read a maximum of 100 events (the number 100 was obtained from my observation when the code was running) from the buffer and then typcast all of them. Filtering of the event is then done by ft_filter_event. However, event(i) is growing inside a loop and has significant negative impact on performance. The impact is even larger in real-time processing because very often we need to keep polling the event information from the buffer. In most of the case, reading such a large number of event to search for the required event type is not necessary because there is only a handful of states in the experimental paradigm. So I suggest we add a "maxsearch" option to let the user set how many total events they want to read from the buffer to search for the required event: *In ft_read_event, after:* flt_mintimestamp = keyval('mintimestamp', varargin); flt_maxtimestamp = keyval('maxtimestamp', varargin); flt_minnumber = keyval('minnumber', varargin); flt_maxnumber = keyval('maxnumber', varargin); *add:* flt_maxsearch = keyval('maxsearch',varargin); *then around line 710, before:* for i=1:length(evt) % convert the field "type" into the Matlab representation this_type = type{evt(i).type_type+1}; this_size = wordsize{evt(i).type_type+1} * evt(i).type_numel; sel = 1:this_size; if strcmp(this_type, 'char') event(i).type = char(evt(i).buf(sel)); else event(i).type = typecast(evt(i).buf(sel), this_type); end . . . end *add:* if(~isempty(flt_maxsearch)) evt=evt((end-flt_maxsearch+1):end); end I have done some profiling and it does improve the performance. Hope that helps. Best regards, Teris ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fraschini at UNICA.IT Wed May 19 15:51:51 2010 From: fraschini at UNICA.IT (Matteo Fraschini) Date: Wed, 19 May 2010 15:51:51 +0200 Subject: Clusterplot problem Message-ID: Dear all, I am currently working on a study involving Activation vs Baseline paradigm on MEG data. By using FT preprocessing, analysis and plotting functions I really can see what I expected to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation tests on time-frequency data following the web tutorial. The analysis shows significative cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with ft_clusterplot) is significative cluster but in region/channels with no frequency differences from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference is more evident. Looks like channels are not correctly placed in the plot. Any suggestions? Thank you very much, Matteo ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jan.schoffelen at DONDERS.RU.NL Wed May 19 16:37:06 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Wed, 19 May 2010 16:37:06 +0200 Subject: use of spm within fieldtrip Message-ID: Dear all, I just made some changes to the fieldtrip code relating to the spm- version used for spatial normalisation, segmentation and smoothing. These changes affect the functions ft_volumesegment, ft_volumenormalise and ft_volumedownsample. Up until now, fieldtrip relied on spm2 to do the morphological operations on anatomical MRIs (and actually crashed when trying to use spm8). I changed the default spm-version to be used into spm8. This means that in order for this to work you need spm8 on your matlab path. People who would prefer to keep using spm2 for spatial normalisation and segmentation should specify cfg.spmversion = 'spm2' before calling ft_volumenormalise or ft_volumesegment. Cheers, Jan-Mathijs Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Thu May 20 10:24:07 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Thu, 20 May 2010 10:24:07 +0200 Subject: Clusterplot problem In-Reply-To: Message-ID: Hi Matteo, What FieldTrip version are you using? There have been some changes in the past few months in the functions you use. Could you post all the cfg-settings you used (from statistical analysis onwards)? Best, Roemer On 5/19/2010 3:51 PM, wrote: > Dear all, > I am currently working on a study involving Activation vs Baseline paradigm on MEG data. > By using FT preprocessing, analysis and plotting functions I really can see what I expected > to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation > tests on time-frequency data following the web tutorial. The analysis shows significative > cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with > ft_clusterplot) is significative cluster but in region/channels with no frequency differences > from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference > is more evident. Looks like channels are not correctly placed in the plot. > Any suggestions? > Thank you very much, > Matteo > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From karl.doron at GMAIL.COM Thu May 20 20:41:09 2010 From: karl.doron at GMAIL.COM (Karl Doron) Date: Thu, 20 May 2010 20:41:09 +0200 Subject: averaging Hilbert amplitudes Message-ID: Hello, I wonder if anyone can help me understand (or point me to a reference) the practical consequences of getting the analytic amplitudes of individual trials and then averaging those vs. averaging band pass filtered data, and then getting the analytic amplitude. Many thanks, karl doron ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From adrian.m.bartlett at GMAIL.COM Thu May 20 20:53:35 2010 From: adrian.m.bartlett at GMAIL.COM (Adrian Bartlett) Date: Thu, 20 May 2010 14:53:35 -0400 Subject: averaging Hilbert amplitudes In-Reply-To: Message-ID: Hi Karl, In short, the former method gives you a mixture of time-locked power changes and and the inter-trial phase coherence, since departures from perfect phase locking will attenuate the amplitude of the average of your trials in the time domain. Taking the hilbert amplitude envelope of single trials and then averaging will yield the closest we can get the 'induced' response, or time-locked power changes. To reiterate, averaging in the time domain confounds power changes and phase differences between trials. A good paper that touches on these topics is Makeig et al. (2004) "Mining event-related brain dynamics". I'm sure my comments on single-trial power as the 'induced' response will cause a stir here, and if you look in the archives there are extensive past discussions on the topic of isolating the 'induced' response from the 'evoked' (phase-locked) Hope that helps some, - Adrian M. Bartlett Department of Psychology (MA Candidate) Neuroscience Graduate Diploma Program Perception & Plasticity Laboratory Centre for Vision Research York University http://www.yorku.ca/~khoffman/ On Thu, May 20, 2010 at 2:41 PM, Karl Doron wrote: > Hello, > > I wonder if anyone can help me understand (or point me to a reference) the > practical > consequences of getting the analytic amplitudes of individual trials and > then averaging those > vs. averaging band pass filtered data, and then getting the analytic > amplitude. > > Many thanks, > karl doron > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fraschini at UNICA.IT Fri May 21 13:09:21 2010 From: fraschini at UNICA.IT (Matteo Fraschini) Date: Fri, 21 May 2010 13:09:21 +0200 Subject: Clusterplot problem In-Reply-To: <4BF4F1A7.30203@donders.ru.nl> Message-ID: Hi Roemer, I tried using the last FT version with same results. This is the code for statistic: function [stat]=withinSubjs(GA_act,GA_bl) cfg = []; cfg.channel = {'MEG','-MLT22','-MLT27','-MLO42','-MLO43','-MRT22','-MRT27','-MRO42','-MRO43'}; cfg.frequency = [4 7]; cfg.avgovertime = 'yes'; cfg.avgoverfreq = 'yes'; cfg.method = 'montecarlo'; cfg.statistic = 'actvsblT'; cfg.correctm = 'cluster'; cfg.clusteralpha = 0.05; cfg.clusterstatistic = 'maxsum'; cfg.minnbchan = 2; cfg.tail = 0; cfg.clustertail = 0; cfg.alpha = 0.05; cfg.numrandomization = 500; n_subjs=size(GA_act.powspctrm); n_subjs=n_subjs(1); design = zeros(2,2*n_subjs); for i = 1:n_subjs design(1,i) = i; end for i = 1:n_subjs design(1,n_subjs+i) = i; end design(2,1:n_subjs) = 1; design(2,n_subjs+1:2*n_subjs) = 2; cfg.design = design; cfg.uvar = 1; cfg.ivar = 2; stat = ft_freqstatistics(cfg,GA_act,GA_bl) You can see the ft_topoplot (with absolute baseline correction) and ft_clusterplot (same time) figures here: http://192.167.154.14/ft/topo.jpg http://192.167.154.14/ft/cluster.jpg I also tried using 'ctf_old' specification when preprocessing my data but an error occurs in ft_megplanar: ??? Index exceeds matrix dimensions. Error in ==> channelposition at 53 sens.pnt = sens.pnt(used,:); Error in ==> megplanar_sincos at 26 [pnt, ori, lab] = channelposition(grad); Any suggestion? Thank you very much, Matteo Il giorno 20/mag/2010, alle ore 10.24, Roemer van der Meij ha scritto: > Hi Matteo, > > What FieldTrip version are you using? There have been some changes in the past few months in the functions you use. > Could you post all the cfg-settings you used (from statistical analysis onwards)? > > Best, > Roemer > > > On 5/19/2010 3:51 PM, wrote: >> Dear all, >> I am currently working on a study involving Activation vs Baseline paradigm on MEG data. >> By using FT preprocessing, analysis and plotting functions I really can see what I expected >> to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation >> tests on time-frequency data following the web tutorial. The analysis shows significative >> cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with >> ft_clusterplot) is significative cluster but in region/channels with no frequency differences >> from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference >> is more evident. Looks like channels are not correctly placed in the plot. >> Any suggestions? >> Thank you very much, >> Matteo >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > -- > Roemer van der Meij MSc > Scientific Programmer& Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Fri May 21 13:21:00 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Fri, 21 May 2010 13:21:00 +0200 Subject: Problem with brainvision files Message-ID: Hi fildtrippers! After I've updated fieldtrip I got some problems reading brainvision files I didn't got before. Here are the errors (the only differences in this script are ft_definetrial and ft_preprocessing that before were only definetrial and preprocessing): cfg=[]; cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; cfg.trialdef.eventtype='Stimulus'; cfg.trialdef.eventvalue='S 55'; cfg.trialdef.prestim=2; cfg.trialdef.poststim=1.999; cfg=ft_definetrial(cfg); data=ft_preprocessing(cfg); Warning: no trialfun was specified, using trialfun_general > In ft_definetrial at 95 evaluating trialfunction 'trialfun_general' reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' found 256 events created 41 trials processing channel { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } reading and preprocessing reading and preprocessing trial 1 from 41 Warning: could not open L001_Artifact_Rejection_FeedPos_Bl_1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 390 In ft_read_data at 205 In ft_preprocessing at 466 Warning: could not open L001_Artifact_Rejection_FeedPos_Bl_1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 395 In ft_read_data at 205 In ft_preprocessing at 466 ??? Error using ==> fseek Invalid file identifier. Use fopen to generate a valid file identifier. Error in ==> read_brainvision_eeg at 52 fseek(fid, hdr.NumberOfChannels*4*(begsample-1), 'cof'); Error in ==> ft_read_data at 442 dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample); Error in ==> ft_preprocessing at 466 dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) If I'm trying to use another file that is an average (so no trial to select) and I treat as a continous file I got these other problems: cfg=[]; cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; data=ft_preprocessing(cfg); Warning: cannot determine number of samples for this sub-fileformat > In fileio\private\read_brainvision_vhdr at 95 In ft_read_header at 367 In ft_preprocessing at 294 processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } reading and preprocessing reading and preprocessing trial 1 from 1 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 390 In ft_read_data at 205 In ft_preprocessing at 466 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 395 In ft_read_data at 205 In ft_preprocessing at 466 ??? Error using ==> zeros NaN and Inf not allowed. Error in ==> read_brainvision_eeg at 76 dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); Error in ==> ft_read_data at 442 dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample); Error in ==> ft_preprocessing at 466 dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) do I miss something? regards Marco ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri May 21 14:55:21 2010 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 21 May 2010 13:55:21 +0100 Subject: Problem with brainvision files In-Reply-To: Message-ID: Hi Marco, I've done some changes recently trying to improve the recognition of Brainvision files. These might or might not be related to your problem. Could you perhaps do: dbstop if error and try to get some idea about why the error in filetype_check_header happens. There is some problem with opening the .eeg file but it's not clear what it is. I tried to use code similar to yours on a different brainvision dataset and there is no problem so it may be something that happens on your system for some reason. If you can't figure it out, send me an example dataset via yousendit.com and I'll try to look at it. Best, Vladimir On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: > Hi fildtrippers! > After I've updated fieldtrip I got some problems reading brainvision files I didn't > got before. > > Here are the errors (the only differences in this script are ft_definetrial and > ft_preprocessing that before were only definetrial and preprocessing): > > cfg=[]; > cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; > cfg.trialdef.eventtype='Stimulus'; > cfg.trialdef.eventvalue='S 55'; > cfg.trialdef.prestim=2; > cfg.trialdef.poststim=1.999; > cfg=ft_definetrial(cfg); > data=ft_preprocessing(cfg); > > Warning: no trialfun was specified, using > trialfun_general >> In ft_definetrial at 95 > evaluating trialfunction 'trialfun_general' > reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' > found 256 events > created 41 trials > processing channel > { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' > TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } > reading and preprocessing > reading and preprocessing trial 1 from 41 > Warning: could not open > L001_Artifact_Rejection_FeedPos_Bl_1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 390 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > Warning: could not open > L001_Artifact_Rejection_FeedPos_Bl_1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 395 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > ??? Error using ==> fseek > Invalid file identifier.  Use fopen to generate a valid > file identifier. > > Error in ==> read_brainvision_eeg at 52 >  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >  'cof'); > > Error in ==> ft_read_data at 442 >    dat = read_brainvision_eeg(filename, hdr.orig, >    begsample, endsample); > > Error in ==> ft_preprocessing at 466 >      dat = ft_read_data(cfg.datafile, 'header', hdr, >      'begsample', begsample, 'endsample', endsample, >      'chanindx', rawindx, 'checkboundary', >      strcmp(cfg.continuous, 'no'), 'dataformat', >      cfg.dataformat) > > > If I'm trying to use another file that is an average (so no trial to select) and I > treat as a continous file I got these other problems: > > cfg=[]; > cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; > data=ft_preprocessing(cfg); > Warning: cannot determine number of samples for this > sub-fileformat >> In fileio\private\read_brainvision_vhdr at 95 >  In ft_read_header at 367 >  In ft_preprocessing at 294 > processing channel > { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 > ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } > reading and preprocessing > reading and preprocessing trial 1 from 1 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 390 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 395 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > ??? Error using ==> zeros > NaN and Inf not allowed. > > Error in ==> read_brainvision_eeg at 76 >  dat = zeros(endsample-begsample+1, >  hdr.NumberOfChannels); > > Error in ==> ft_read_data at 442 >    dat = read_brainvision_eeg(filename, hdr.orig, >    begsample, endsample); > > Error in ==> ft_preprocessing at 466 >      dat = ft_read_data(cfg.datafile, 'header', hdr, >      'begsample', begsample, 'endsample', endsample, >      'chanindx', rawindx, 'checkboundary', >      strcmp(cfg.continuous, 'no'), 'dataformat', >      cfg.dataformat) > > do I miss something? > > regards > > Marco > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From gauthierb.ens at GMAIL.COM Fri May 21 16:14:39 2010 From: gauthierb.ens at GMAIL.COM (Baptiste Gauthier) Date: Fri, 21 May 2010 16:14:39 +0200 Subject: Recent update for volume handling Message-ID: Dear Fieldtrip users, I recently try to use the tutorial for creating normalized grid in a purpose of source reconstruction for Neuromag data. It used to work fine, but recently, the segmentation step seems to produce odd results. I have to precise that I changed parameters relative to recent update of volume handling fonction that are now using SPM8. So I wonder If this tutorial stay compatible to this recent update. Has someone experimented the same problems? Best regards, Baptiste Gauthier ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: grayseg_SPM8.png Type: image/png Size: 250884 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: whiteseg_SPM8.png Type: image/png Size: 256368 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: csfseg_SPM8.png Type: image/png Size: 198483 bytes Desc: not available URL: From gordon at CCS.FAU.EDU Fri May 21 20:50:46 2010 From: gordon at CCS.FAU.EDU (Reyna L. Gordon) Date: Fri, 21 May 2010 13:50:46 -0500 Subject: issue with cfg.interplimits Message-ID: Dear Fieldtrippers, I am having an issue with creating topoplots of time-frequency data acquired on an EGI system and processed in Fieldtrip, and I was wondering if anyone could help. Everything works great (this toolbox has been wonderful to use in general!) except that the colors that represent power are not interpolating to electrodes that are lower than the origin. Unfortunately, using the default option for cfg.projection = 'orthographic' for ft_prepare_layout, seems to greatly distort the layout for these data, probably because I have too few electrodes. A better option for me seems to be cfg.projection = 'polar', and I am fine with those few electrodes appearing outside of the head. However, the data corresponding to those electrodes is not there - I suspect that there is a problem at the level of cfg.interplimits. This is the code I'm using: cfg = []; cfg.rotate = 0; cfg.projection = 'polar'; newlay=ft_prepare_layout(cfg, bin1); cfg = []; cfg.layout = newlay; cfg.yparam = 'freq'; cfg.xlim= [0.150 0.150]; cfg.ylim= [13 30]; cfg.zlim = [-0.10 0.10]; cfg.highlight = 'on'; cfg.baseline = 'no'; cfg.commentpos = 'title'; cfg.shading = 'interp'; cfg.interplimits = 'electrodes'; %Should work here? cfg.style = 'straight'; cfg.zparam = 'powspctrm'; cfg.fontsize = 12; cfg.gridscale = 100; ft_topoplotTFR(cfg, bin1); According to the documentation, specifying cfg.interplimits = 'electrodes' should achieve what I want here, but it still does not interpolate the plot outside of the head. Attached are some images generated with different cfg.interplimits and cfg.projection options. I have tried upgrading to the most recent release of FT, but it doesn't change the outcome. Any and all insight would be greatly appreciated. Best, Reyna ----------------------- Reyna L. Gordon PhD Candidate Center for Complex Systems & Brain Sciences Florida Atlantic University gordon at ccs.fau.edu ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: polar_head.jpg Type: image/jpeg Size: 23385 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sopro_new_montage_noCz.sfp Type: application/octet-stream Size: 1532 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: orthographic.jpg Type: image/jpeg Size: 21647 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: polar_electrodes.jpg Type: image/jpeg Size: 22977 bytes Desc: not available URL: -------------- next part -------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Sat May 22 12:48:46 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Sat, 22 May 2010 12:48:46 +0200 Subject: Problem with brainvision files In-Reply-To: Message-ID: I've tried to set a brackpoint but stoped at line 76 of read_brainvision_eeg Maybe I exported them in a wrog way? Marco 2010/5/21 Vladimir Litvak : >  Hi Marco, > > I've done some changes recently trying to improve the recognition of > Brainvision files. These might or might not be related to your > problem. Could you perhaps do: > > dbstop if error > > and try to get some idea about why the error in filetype_check_header > happens. There is some problem with opening the .eeg file but it's not > clear what it is. I tried to use code similar to yours on a different > brainvision dataset and there is no problem so it may be something > that happens on your system for some reason. If you can't figure it > out, send me an example dataset via yousendit.com and I'll try to look > at it. > > Best, > > Vladimir > > On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >> Hi fildtrippers! >> After I've updated fieldtrip I got some problems reading brainvision files I didn't >> got before. >> >> Here are the errors (the only differences in this script are ft_definetrial and >> ft_preprocessing that before were only definetrial and preprocessing): >> >> cfg=[]; >> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >> cfg.trialdef.eventtype='Stimulus'; >> cfg.trialdef.eventvalue='S 55'; >> cfg.trialdef.prestim=2; >> cfg.trialdef.poststim=1.999; >> cfg=ft_definetrial(cfg); >> data=ft_preprocessing(cfg); >> >> Warning: no trialfun was specified, using >> trialfun_general >>> In ft_definetrial at 95 >> evaluating trialfunction 'trialfun_general' >> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >> found 256 events >> created 41 trials >> processing channel >> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 41 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> fseek >> Invalid file identifier.  Use fopen to generate a valid >> file identifier. >> >> Error in ==> read_brainvision_eeg at 52 >>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>  'cof'); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> >> If I'm trying to use another file that is an average (so no trial to select) and I >> treat as a continous file I got these other problems: >> >> cfg=[]; >> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >> data=ft_preprocessing(cfg); >> Warning: cannot determine number of samples for this >> sub-fileformat >>> In fileio\private\read_brainvision_vhdr at 95 >>  In ft_read_header at 367 >>  In ft_preprocessing at 294 >> processing channel >> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 1 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> zeros >> NaN and Inf not allowed. >> >> Error in ==> read_brainvision_eeg at 76 >>  dat = zeros(endsample-begsample+1, >>  hdr.NumberOfChannels); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> do I miss something? >> >> regards >> >> Marco >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From marco.rotonda at GMAIL.COM Sat May 22 12:52:04 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Sat, 22 May 2010 12:52:04 +0200 Subject: Problem with brainvision files In-Reply-To: Message-ID: Sorry... I maybe you could have a better idea with the errors ;-) >> dbstop if error >> cfg=[]; cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; data=ft_preprocessing(cfg); Warning: cannot determine number of samples for this sub-fileformat > In fileio\private\read_brainvision_vhdr at 95 In ft_read_header at 367 In ft_preprocessing at 294 processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } reading and preprocessing reading and preprocessing trial 1 from 1 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 390 In ft_read_data at 205 In ft_preprocessing at 466 Warning: could not open L001_AVG_FeedNegBL1.eeg > In fileio\private\filetype_check_header at 44 In ft_filetype at 395 In ft_read_data at 205 In ft_preprocessing at 466 ??? Error using ==> zeros NaN and Inf not allowed. Error in ==> read_brainvision_eeg at 76 dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); Error in ==> ft_read_data at 442 dat = read_brainvision_eeg(filename, hdr.orig, begsample, endsample); Error in ==> ft_preprocessing at 466 dat = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', begsample, 'endsample', endsample, 'chanindx', rawindx, 'checkboundary', strcmp(cfg.continuous, 'no'), 'dataformat', cfg.dataformat) 76 dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); K>> read_brainvision_eeg ??? Input argument "hdr" is undefined. Error in ==> read_brainvision_eeg at 32 if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') 32 if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') K>> Maybe the problem is about the multiplexed so the way I exported the data? 2010/5/21 Vladimir Litvak : >  Hi Marco, > > I've done some changes recently trying to improve the recognition of > Brainvision files. These might or might not be related to your > problem. Could you perhaps do: > > dbstop if error > > and try to get some idea about why the error in filetype_check_header > happens. There is some problem with opening the .eeg file but it's not > clear what it is. I tried to use code similar to yours on a different > brainvision dataset and there is no problem so it may be something > that happens on your system for some reason. If you can't figure it > out, send me an example dataset via yousendit.com and I'll try to look > at it. > > Best, > > Vladimir > > On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >> Hi fildtrippers! >> After I've updated fieldtrip I got some problems reading brainvision files I didn't >> got before. >> >> Here are the errors (the only differences in this script are ft_definetrial and >> ft_preprocessing that before were only definetrial and preprocessing): >> >> cfg=[]; >> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >> cfg.trialdef.eventtype='Stimulus'; >> cfg.trialdef.eventvalue='S 55'; >> cfg.trialdef.prestim=2; >> cfg.trialdef.poststim=1.999; >> cfg=ft_definetrial(cfg); >> data=ft_preprocessing(cfg); >> >> Warning: no trialfun was specified, using >> trialfun_general >>> In ft_definetrial at 95 >> evaluating trialfunction 'trialfun_general' >> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >> found 256 events >> created 41 trials >> processing channel >> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 41 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open >> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> fseek >> Invalid file identifier.  Use fopen to generate a valid >> file identifier. >> >> Error in ==> read_brainvision_eeg at 52 >>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>  'cof'); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> >> If I'm trying to use another file that is an average (so no trial to select) and I >> treat as a continous file I got these other problems: >> >> cfg=[]; >> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >> data=ft_preprocessing(cfg); >> Warning: cannot determine number of samples for this >> sub-fileformat >>> In fileio\private\read_brainvision_vhdr at 95 >>  In ft_read_header at 367 >>  In ft_preprocessing at 294 >> processing channel >> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 1 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> zeros >> NaN and Inf not allowed. >> >> Error in ==> read_brainvision_eeg at 76 >>  dat = zeros(endsample-begsample+1, >>  hdr.NumberOfChannels); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> >> do I miss something? >> >> regards >> >> Marco >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From sklein at BERKELEY.EDU Sat May 22 13:17:11 2010 From: sklein at BERKELEY.EDU (Stanley Klein) Date: Sat, 22 May 2010 04:17:11 -0700 Subject: Filters local in time while rejecting low frequencies Message-ID: Dear Fieldtrip, We would like to do time-frequency plots using filters that are quite local in time (less than about 2 cycles) and yet have relatively low sensitivity to low temporal frequencies. For example, filters defined on log frequency might do the job in being insensitive to low frequencies, but are they sufficiently local in time? thanks, Stan Klein ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From v.litvak at ION.UCL.AC.UK Sat May 22 22:49:49 2010 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Sat, 22 May 2010 21:49:49 +0100 Subject: Problem with brainvision files In-Reply-To: Message-ID: Hi Marco, There are two separate problems. One has to do with my mistake and one doesn't. The problem with the example you sent me is indeed that the data is ASCII multiplexed. I suggest that you export the data as binary. The second problem was introduced by my fix and I hope that it'll be fixed if you put the attached file in fileio. I also checked it in. Let me know if you still have problems. Best, Vladimir On Sat, May 22, 2010 at 11:52 AM, Marco Rotonda wrote: > Sorry... > I maybe you could have a better idea with the errors ;-) > >>> dbstop if error >>> cfg=[]; > cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; > data=ft_preprocessing(cfg); > Warning: cannot determine number of samples for this > sub-fileformat >> In fileio\private\read_brainvision_vhdr at 95 >  In ft_read_header at 367 >  In ft_preprocessing at 294 > processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' > 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' > 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } > reading and preprocessing > reading and preprocessing trial 1 from 1 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 390 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > Warning: could not open L001_AVG_FeedNegBL1.eeg >> In fileio\private\filetype_check_header at 44 >  In ft_filetype at 395 >  In ft_read_data at 205 >  In ft_preprocessing at 466 > ??? Error using ==> zeros > NaN and Inf not allowed. > > Error in ==> read_brainvision_eeg at 76 >  dat = zeros(endsample-begsample+1, >  hdr.NumberOfChannels); > > Error in ==> ft_read_data at 442 >    dat = read_brainvision_eeg(filename, hdr.orig, >    begsample, endsample); > > Error in ==> ft_preprocessing at 466 >      dat = ft_read_data(cfg.datafile, 'header', hdr, >      'begsample', begsample, 'endsample', endsample, >      'chanindx', rawindx, 'checkboundary', >      strcmp(cfg.continuous, 'no'), 'dataformat', >      cfg.dataformat) > 76    dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); > K>> read_brainvision_eeg > ??? Input argument "hdr" is undefined. > > Error in ==> read_brainvision_eeg at 32 > if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, > 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') > > 32  if strcmpi(hdr.DataFormat, 'binary') && > strcmpi(hdr.DataOrientation, 'multiplexed') && > strcmpi(hdr.BinaryFormat, 'int_16') > K>> > > > Maybe the problem is about the multiplexed so the way I exported the data? > > > > 2010/5/21 Vladimir Litvak : >>  Hi Marco, >> >> I've done some changes recently trying to improve the recognition of >> Brainvision files. These might or might not be related to your >> problem. Could you perhaps do: >> >> dbstop if error >> >> and try to get some idea about why the error in filetype_check_header >> happens. There is some problem with opening the .eeg file but it's not >> clear what it is. I tried to use code similar to yours on a different >> brainvision dataset and there is no problem so it may be something >> that happens on your system for some reason. If you can't figure it >> out, send me an example dataset via yousendit.com and I'll try to look >> at it. >> >> Best, >> >> Vladimir >> >> On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >>> Hi fildtrippers! >>> After I've updated fieldtrip I got some problems reading brainvision files I didn't >>> got before. >>> >>> Here are the errors (the only differences in this script are ft_definetrial and >>> ft_preprocessing that before were only definetrial and preprocessing): >>> >>> cfg=[]; >>> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >>> cfg.trialdef.eventtype='Stimulus'; >>> cfg.trialdef.eventvalue='S 55'; >>> cfg.trialdef.prestim=2; >>> cfg.trialdef.poststim=1.999; >>> cfg=ft_definetrial(cfg); >>> data=ft_preprocessing(cfg); >>> >>> Warning: no trialfun was specified, using >>> trialfun_general >>>> In ft_definetrial at 95 >>> evaluating trialfunction 'trialfun_general' >>> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >>> found 256 events >>> created 41 trials >>> processing channel >>> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >>> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>> reading and preprocessing >>> reading and preprocessing trial 1 from 41 >>> Warning: could not open >>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 390 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> Warning: could not open >>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 395 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> ??? Error using ==> fseek >>> Invalid file identifier.  Use fopen to generate a valid >>> file identifier. >>> >>> Error in ==> read_brainvision_eeg at 52 >>>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>>  'cof'); >>> >>> Error in ==> ft_read_data at 442 >>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>    begsample, endsample); >>> >>> Error in ==> ft_preprocessing at 466 >>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>      'begsample', begsample, 'endsample', endsample, >>>      'chanindx', rawindx, 'checkboundary', >>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>      cfg.dataformat) >>> >>> >>> If I'm trying to use another file that is an average (so no trial to select) and I >>> treat as a continous file I got these other problems: >>> >>> cfg=[]; >>> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >>> data=ft_preprocessing(cfg); >>> Warning: cannot determine number of samples for this >>> sub-fileformat >>>> In fileio\private\read_brainvision_vhdr at 95 >>>  In ft_read_header at 367 >>>  In ft_preprocessing at 294 >>> processing channel >>> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >>> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>> reading and preprocessing >>> reading and preprocessing trial 1 from 1 >>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 390 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>> In fileio\private\filetype_check_header at 44 >>>  In ft_filetype at 395 >>>  In ft_read_data at 205 >>>  In ft_preprocessing at 466 >>> ??? Error using ==> zeros >>> NaN and Inf not allowed. >>> >>> Error in ==> read_brainvision_eeg at 76 >>>  dat = zeros(endsample-begsample+1, >>>  hdr.NumberOfChannels); >>> >>> Error in ==> ft_read_data at 442 >>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>    begsample, endsample); >>> >>> Error in ==> ft_preprocessing at 466 >>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>      'begsample', begsample, 'endsample', endsample, >>>      'chanindx', rawindx, 'checkboundary', >>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>      cfg.dataformat) >>> >>> do I miss something? >>> >>> regards >>> >>> Marco >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>> >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: ft_filetype.m Type: application/octet-stream Size: 41199 bytes Desc: not available URL: From marco.rotonda at GMAIL.COM Mon May 24 11:15:10 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Mon, 24 May 2010 11:15:10 +0200 Subject: Problem with brainvision files In-Reply-To: Message-ID: Hi Vladimir! Everything went fine! Thank you! Marco 2010/5/22 Vladimir Litvak : > Hi Marco, > > There are two separate problems. One has to do with my mistake and one > doesn't. The problem with the example you sent me is indeed that the > data is ASCII multiplexed. I suggest that you export the data as > binary. > > The second problem was introduced by my fix and I hope that it'll be > fixed if you put the attached file in fileio. I also checked it in. > > Let me know if you still have problems. > > Best, > > Vladimir > > On Sat, May 22, 2010 at 11:52 AM, Marco Rotonda wrote: >> Sorry... >> I maybe you could have a better idea with the errors ;-) >> >>>> dbstop if error >>>> cfg=[]; >> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >> data=ft_preprocessing(cfg); >> Warning: cannot determine number of samples for this >> sub-fileformat >>> In fileio\private\read_brainvision_vhdr at 95 >>  In ft_read_header at 367 >>  In ft_preprocessing at 294 >> processing channel { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' >> 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' >> 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >> reading and preprocessing >> reading and preprocessing trial 1 from 1 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 390 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> Warning: could not open L001_AVG_FeedNegBL1.eeg >>> In fileio\private\filetype_check_header at 44 >>  In ft_filetype at 395 >>  In ft_read_data at 205 >>  In ft_preprocessing at 466 >> ??? Error using ==> zeros >> NaN and Inf not allowed. >> >> Error in ==> read_brainvision_eeg at 76 >>  dat = zeros(endsample-begsample+1, >>  hdr.NumberOfChannels); >> >> Error in ==> ft_read_data at 442 >>    dat = read_brainvision_eeg(filename, hdr.orig, >>    begsample, endsample); >> >> Error in ==> ft_preprocessing at 466 >>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>      'begsample', begsample, 'endsample', endsample, >>      'chanindx', rawindx, 'checkboundary', >>      strcmp(cfg.continuous, 'no'), 'dataformat', >>      cfg.dataformat) >> 76    dat = zeros(endsample-begsample+1, hdr.NumberOfChannels); >> K>> read_brainvision_eeg >> ??? Input argument "hdr" is undefined. >> >> Error in ==> read_brainvision_eeg at 32 >> if strcmpi(hdr.DataFormat, 'binary') && strcmpi(hdr.DataOrientation, >> 'multiplexed') && strcmpi(hdr.BinaryFormat, 'int_16') >> >> 32  if strcmpi(hdr.DataFormat, 'binary') && >> strcmpi(hdr.DataOrientation, 'multiplexed') && >> strcmpi(hdr.BinaryFormat, 'int_16') >> K>> >> >> >> Maybe the problem is about the multiplexed so the way I exported the data? >> >> >> >> 2010/5/21 Vladimir Litvak : >>>  Hi Marco, >>> >>> I've done some changes recently trying to improve the recognition of >>> Brainvision files. These might or might not be related to your >>> problem. Could you perhaps do: >>> >>> dbstop if error >>> >>> and try to get some idea about why the error in filetype_check_header >>> happens. There is some problem with opening the .eeg file but it's not >>> clear what it is. I tried to use code similar to yours on a different >>> brainvision dataset and there is no problem so it may be something >>> that happens on your system for some reason. If you can't figure it >>> out, send me an example dataset via yousendit.com and I'll try to look >>> at it. >>> >>> Best, >>> >>> Vladimir >>> >>> On Fri, May 21, 2010 at 12:21 PM, Marco Rotonda wrote: >>>> Hi fildtrippers! >>>> After I've updated fieldtrip I got some problems reading brainvision files I didn't >>>> got before. >>>> >>>> Here are the errors (the only differences in this script are ft_definetrial and >>>> ft_preprocessing that before were only definetrial and preprocessing): >>>> >>>> cfg=[]; >>>> cfg.dataset='L001_Artifact_Rejection_FeedPos_Bl_1.vhdr'; >>>> cfg.trialdef.eventtype='Stimulus'; >>>> cfg.trialdef.eventvalue='S 55'; >>>> cfg.trialdef.prestim=2; >>>> cfg.trialdef.poststim=1.999; >>>> cfg=ft_definetrial(cfg); >>>> data=ft_preprocessing(cfg); >>>> >>>> Warning: no trialfun was specified, using >>>> trialfun_general >>>>> In ft_definetrial at 95 >>>> evaluating trialfunction 'trialfun_general' >>>> reading the events from 'L001_Artifact_Rejection_FeedPos_Bl_1.vhdr' >>>> found 256 events >>>> created 41 trials >>>> processing channel >>>> { 'X1' 'X2' 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' ' >>>> TP7' 'CP3' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>>> reading and preprocessing >>>> reading and preprocessing trial 1 from 41 >>>> Warning: could not open >>>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 390 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> Warning: could not open >>>> L001_Artifact_Rejection_FeedPos_Bl_1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 395 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> ??? Error using ==> fseek >>>> Invalid file identifier.  Use fopen to generate a valid >>>> file identifier. >>>> >>>> Error in ==> read_brainvision_eeg at 52 >>>>  fseek(fid, hdr.NumberOfChannels*4*(begsample-1), >>>>  'cof'); >>>> >>>> Error in ==> ft_read_data at 442 >>>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>>    begsample, endsample); >>>> >>>> Error in ==> ft_preprocessing at 466 >>>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>>      'begsample', begsample, 'endsample', endsample, >>>>      'chanindx', rawindx, 'checkboundary', >>>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>>      cfg.dataformat) >>>> >>>> >>>> If I'm trying to use another file that is an average (so no trial to select) and I >>>> treat as a continous file I got these other problems: >>>> >>>> cfg=[]; >>>> cfg.dataset='L001_AVG_FeedNegBL1.vhdr'; >>>> data=ft_preprocessing(cfg); >>>> Warning: cannot determine number of samples for this >>>> sub-fileformat >>>>> In fileio\private\read_brainvision_vhdr at 95 >>>>  In ft_read_header at 367 >>>>  In ft_preprocessing at 294 >>>> processing channel >>>> { 'F7' 'F3' 'Fz' 'F4' 'F8' 'FT7' 'FC3' 'FCz' 'FC4' 'FT8' 'T3' 'C3' 'Cz' 'C4' 'T4' 'TP7' 'CP3 >>>> ' 'CPz' 'CP4' 'TP8' 'T5' 'P3' 'Pz' 'P4' 'T6' 'O1' 'Oz' 'O2' } >>>> reading and preprocessing >>>> reading and preprocessing trial 1 from 1 >>>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 390 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> Warning: could not open L001_AVG_FeedNegBL1.eeg >>>>> In fileio\private\filetype_check_header at 44 >>>>  In ft_filetype at 395 >>>>  In ft_read_data at 205 >>>>  In ft_preprocessing at 466 >>>> ??? Error using ==> zeros >>>> NaN and Inf not allowed. >>>> >>>> Error in ==> read_brainvision_eeg at 76 >>>>  dat = zeros(endsample-begsample+1, >>>>  hdr.NumberOfChannels); >>>> >>>> Error in ==> ft_read_data at 442 >>>>    dat = read_brainvision_eeg(filename, hdr.orig, >>>>    begsample, endsample); >>>> >>>> Error in ==> ft_preprocessing at 466 >>>>      dat = ft_read_data(cfg.datafile, 'header', hdr, >>>>      'begsample', begsample, 'endsample', endsample, >>>>      'chanindx', rawindx, 'checkboundary', >>>>      strcmp(cfg.continuous, 'no'), 'dataformat', >>>>      cfg.dataformat) >>>> >>>> do I miss something? >>>> >>>> regards >>>> >>>> Marco >>>> >>>> ---------------------------------- >>>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>>> >>>> >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Tue May 25 11:52:12 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Tue, 25 May 2010 11:52:12 +0200 Subject: Clusterplot problem In-Reply-To: Message-ID: Hi Matteo, How do your ft_topoplot's look if you average over frequency and average over time (averaging before baseline correcting)? That could be one of the causes for your different outputs. I do not expect something to be wrong with the stat.mask field as you mentioned, as it does fit really well to the plotted t-value spectrum. Could you also post your ft_topoplot and ft_clusterplot settings, just to be sure? Best, Roemer On 5/21/2010 1:09 PM, Matteo Fraschini wrote: > Hi Roemer, > I tried using the last FT version with same results. > > This is the code for statistic: > > function [stat]=withinSubjs(GA_act,GA_bl) > cfg = []; > cfg.channel = {'MEG','-MLT22','-MLT27','-MLO42','-MLO43','-MRT22','-MRT27','-MRO42','-MRO43'}; > cfg.frequency = [4 7]; > cfg.avgovertime = 'yes'; > cfg.avgoverfreq = 'yes'; > cfg.method = 'montecarlo'; > cfg.statistic = 'actvsblT'; > cfg.correctm = 'cluster'; > cfg.clusteralpha = 0.05; > cfg.clusterstatistic = 'maxsum'; > cfg.minnbchan = 2; > cfg.tail = 0; > cfg.clustertail = 0; > cfg.alpha = 0.05; > cfg.numrandomization = 500; > n_subjs=size(GA_act.powspctrm); > n_subjs=n_subjs(1); > design = zeros(2,2*n_subjs); > for i = 1:n_subjs > design(1,i) = i; > end > for i = 1:n_subjs > design(1,n_subjs+i) = i; > end > design(2,1:n_subjs) = 1; > design(2,n_subjs+1:2*n_subjs) = 2; > cfg.design = design; > cfg.uvar = 1; > cfg.ivar = 2; > stat = ft_freqstatistics(cfg,GA_act,GA_bl) > > You can see the ft_topoplot (with absolute baseline correction) and ft_clusterplot (same time) figures here: > http://192.167.154.14/ft/topo.jpg > http://192.167.154.14/ft/cluster.jpg > > I also tried using 'ctf_old' specification when preprocessing my data but an error occurs in ft_megplanar: > > ??? Index exceeds matrix dimensions. > Error in ==> channelposition at 53 > sens.pnt = sens.pnt(used,:); > Error in ==> megplanar_sincos at 26 > [pnt, ori, lab] = channelposition(grad); > > Any suggestion? > Thank you very much, > Matteo > > > Il giorno 20/mag/2010, alle ore 10.24, Roemer van der Meij ha scritto: > > >> Hi Matteo, >> >> What FieldTrip version are you using? There have been some changes in the past few months in the functions you use. >> Could you post all the cfg-settings you used (from statistical analysis onwards)? >> >> Best, >> Roemer >> >> >> On 5/19/2010 3:51 PM, wrote: >> >>> Dear all, >>> I am currently working on a study involving Activation vs Baseline paradigm on MEG data. >>> By using FT preprocessing, analysis and plotting functions I really can see what I expected >>> to. But, I have a problem with statistical analysis. I tried to use cluster-based permutation >>> tests on time-frequency data following the web tutorial. The analysis shows significative >>> cluster but both ft_clusterplot and stat.mask seem corrupted/incorrect. What I see (with >>> ft_clusterplot) is significative cluster but in region/channels with no frequency differences >>> from baseline to activation. Viceversa, I can't see any cluster where the act vs bl difference >>> is more evident. Looks like channels are not correctly placed in the plot. >>> Any suggestions? >>> Thank you very much, >>> Matteo >>> >>> ---------------------------------- >>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >>> >>> >>> >> -- >> Roemer van der Meij MSc >> Scientific Programmer& Data-Analyst >> Donders Institute for Brain, Cognition and Behaviour >> Centre for Cognition >> P.O. Box 9104 >> 6500 HE Nijmegen >> The Netherlands >> Tel: +31(0)24 3612631 >> E-mail: r.vandermeij at donders.ru.nl >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From michael.wibral at WEB.DE Tue May 25 17:54:56 2010 From: michael.wibral at WEB.DE (Michael Wibral) Date: Tue, 25 May 2010 17:54:56 +0200 Subject: Error in the description of funcolorlim ?? Message-ID: Dear Listusers, I am trying to plot just the negative values of my sourcestatistics, and it seems difficult to achieve this so that the parts in the data.outside region and the part outside of the head are transparent. Does anybody know how to do this? The other thing that I am wondering about is if the documentation of funcolorlim in ft_sourceplot is entirely correct. In the help it says: cfg.funcolorlim = color range of the functional data (default = 'auto') [min max] 'maxabs', from -max(abs(funparameter)) to +max(abs(funparameter)) 'zeromax', from 0 to max(abs(funparameter)) 'minzero', from min(abs(funparameter)) to 0 'auto', if funparameter values are all positive: 'zeromax', all negative: 'minzero', both possitive and negative: 'maxabs' What I am wondering about is that when values are all negative (say from -6 to -0.1) it chooses 'minzero'. This would, according to the above description result in values from min(abs(funparameter))=+0.1 to 0 being plotted, i.e. if this were corrcet it would try to plot small positive values... . I guess this is an error in the documentation, with the 'abs' being wrong. Any comments on this would be appreciated. Michael ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 628 bytes Desc: not available URL: From balazs at COGPSYPHY.HU Wed May 26 00:47:01 2010 From: balazs at COGPSYPHY.HU (=?ISO-8859-1?Q?Bal=E1zs_L=E1szl=F3?=) Date: Wed, 26 May 2010 00:47:01 +0200 Subject: IOP conference - extended deadline for submissions Message-ID: Dear listmembers, Deadline for submissions to the 15th World Congress of Pschophysiology (IOP 2010) is extended until the end of May. Please read the information in attachment. Looking forward to see you in Budapest. Kind regards, Laszlo -- Laszlo Balazs, Ph.D. / dr. Balázs László Institute for Psychology HAS / MTA Pszichológiai Kutatóintézet P O B 398, Budapest, Hungary, H-1394 Tel:+36(1)354-2410 | Fax:+36(1)354-2416 http://www.cogpsyphy.hu/balazs __________ Information from ESET NOD32 Antivirus, version of virus signature database 5133 (20100520) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: IOP_?rtes?t?_email.pdf Type: application/octet-stream Size: 51077 bytes Desc: not available URL: From zaifengg at GMAIL.COM Wed May 26 10:53:09 2010 From: zaifengg at GMAIL.COM (gao zai) Date: Wed, 26 May 2010 11:53:09 +0300 Subject: Questions on Dipole fitting Message-ID: Dear all, Currently I am trying to do the Dipole fitting on the MEG data. I have 1 problem that puzzled me, in particular, When I did dipole on individual subject,I used the scripts according to to one posted in the Fieldtrip website, it runs ok but I get only null result (naked MRI picture without any dipole inside.) I was told that "Local minimum possible. fminunc stopped because the size of the current step is less than the default value of the step size tolerance." However, the same data I used SPM8, I get can get dipole. So I wonder is there anything wrong with my scripts? I hope I can get your kind help. Thanks very much in advance. -- load s2TL42 figure plot(1000*s2TL42.time, s2TL42.avg) % convert time to ms xlabel('time (ms)') ylabel('field amplitude (T)') axis tight grid on cfg = []; cfg.xlim = 0.1:0.025:0.2; cfg.colorbar = 'no'; cfg.comment = ''; cfg.showxlim = 'no'; cfg.showzlim = 'no'; cfg.layout = '4D248.lay'; cfg.zlim = [-1.5 1.5] * 1e-13; figure ft_topoplotER(cfg, s2TL42); cfg = []; cfg.latency = [0.15 0.18]; % specify latency window around M165 peak cfg.numdipoles = 1; cfg.vol = vol; cfg.feedback = 'textbar'; cfg.resolution = 2; dip = ft_dipolefitting(cfg, s2TL42); sMRI = read_mri(fullfile(spm('dir'), 'canonical', 'single_subj_T1.nii')); % the source is expressed in cm cfg = []; cfg.location = dip.dip.pos*10; % convert from cm to mm cfg.interactive='yes'; figure; ft_sourceplot(cfg, sMRI); --------------- Best, Feng ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ab_saad at LIVE.COM Wed May 26 12:09:44 2010 From: ab_saad at LIVE.COM (W. Saad) Date: Wed, 26 May 2010 06:09:44 -0400 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... Message-ID: Hi, I am new to matlab and FieldTrip - so bare with me and thanks for your feedback in advance :) I have a csv file containing readings for 25 electrode EEG trial. There are 129,908 readings in the file (sampling rate is 256 - approx. 507 seconds) The file is 25 columns by 129,908 rows. I would like to calculate power for each of the 5 wave types for each channel. Also, I would like to find the coherence for all intra-hemispheric and inter-hemispheric pairwise combination of the 25 channels (300 in total). I am trying the following code but getting a memory error and other errors (code is mostly based on the samples I have found in FieldTrip website). %-------------------------------------------------------------- fieldtripdefs; filename='recall.dat'; filelength=129908; rdata=csvread(filename); rdata=rdata'; % cell-array containing strings, Nchan X 1 data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' 'E12' 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' 'E23' 'E24' 'E25' 'E26'}; % sampling frequency in Hz, single number data.fsample = 256; % cell-array containing a data matrix for each trial (1 X Ntrial), each data matrix is Nchan X Nsamples data.trial = {rdata}; % cell-array containing a time axis for each trial (1 X Ntrial), each time axis is a 1 X Nsamples vector timevector = [1:filelength]; data.time = { timevector }; cfg = []; cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [0.5 50]; cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'all' }; cfg.channelcmb = {'all' 'all'}; freq = ft_freqanalysis(cfg, data); cfg = []; cfg.method = 'coh'; cfg.channelcmb = {'all' 'all'}; fd = ft_connectivityanalysis(cfg, freq); % Let us not draw for now.. %cfg = []; %cfg.xparam = 'freq'; %cfg.zparam = 'cohspctrm'; %cfg.xlim = [5 80]; %cfg.cohrefchannel = 'EMGlft'; %cfg.layout = 'CTF151.lay'; %cfg.showlabels = 'yes'; %figure; ft_multiplotER(cfg, fd) ----------------------------------------------------------------- The messages/error I get is: the input is raw data with 25 channels and 1 trials ??? Maximum variable size allowed by the program is exceeded. Error in ==> dpss>dpsscalc at 127 E = zeros(N,k(2)-k(1)+1); Error in ==> dpss at 54 [E,V] = dpsscalc(N,NW,k); Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 tap = dpss(double(a), double(b), varargin{:}); Error in ==> ft_freqanalysis_mtmfft at 249 tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; Error in ==> ft_freqanalysis at 75 [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg, data); Error in ==> saad_fieldtrip at 29 freq = ft_freqanalysis(cfg, data); ----------------------------------------------------------------- I have been looking around in the discussion board trying to find how to read a csv file with no success (though it looks to me it was read successfully since Fieldtrip detected it has 25 channels). Also, I am worried about the message ??? Maximum variable size allowed by the program is exceeded. Because most of my trials are huge in size, in fact the biggest file size I have is 25 columns x 250,000 rows (~60MB). Your input is highly appreciated. Thanks. _________________________________________________________________ 30 days of prizes to be won with Hotmail. Enter Here. http://go.microsoft.com/?linkid=9729709 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.schoffelen at DONDERS.RU.NL Wed May 26 14:31:55 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Wed, 26 May 2010 14:31:55 +0200 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... In-Reply-To: Message-ID: Dear W.Saad, Could it be that there is a typo in how you define data.time? You define it in sample numbers but it should be in seconds: data.time{1} = [1:filelength]./daga.fsample; I guess this may help. Best, Jan-Mathijs On May 26, 2010, at 12:09 PM, W. Saad wrote: > Hi, > > I am new to matlab and FieldTrip - so bare with me and thanks for > your feedback in advance :) > > I have a csv file containing readings for 25 electrode EEG trial. > There are 129,908 readings in > the file (sampling rate is 256 - approx. 507 seconds) The file is 25 > columns by 129,908 rows. > > I would like to calculate power for each of the 5 wave types for > each channel. Also, I would > like to find the coherence for all intra-hemispheric and inter- > hemispheric pairwise > combination of the 25 channels (300 in total). > > I am trying the following code but getting a memory error and other > errors (code is mostly based > on the samples I have found in FieldTrip website). > > > %-------------------------------------------------------------- > > fieldtripdefs; > > filename='recall.dat'; > filelength=129908; > rdata=csvread(filename); > rdata=rdata'; > > % cell-array containing strings, Nchan X 1 > data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' > 'E12' 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' > 'E23' 'E24' 'E25' 'E26'}; > > % sampling frequency in Hz, single number > data.fsample = 256; > > % cell-array containing a data matrix for each trial (1 X Ntrial), > each data matrix is Nchan X Nsamples > data.trial = {rdata}; > > % cell-array containing a time axis for each trial (1 X Ntrial), > each time axis is a 1 X Nsamples vector > timevector = [1:filelength]; > data.time = { timevector }; > > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmfft'; > cfg.foilim = [0.5 50]; > cfg.tapsmofrq = 5; > cfg.keeptrials = 'yes'; > cfg.channel = {'all' }; > cfg.channelcmb = {'all' 'all'}; > freq = ft_freqanalysis(cfg, data); > > cfg = []; > cfg.method = 'coh'; > cfg.channelcmb = {'all' 'all'}; > fd = ft_connectivityanalysis(cfg, freq); > > % Let us not draw for now.. > %cfg = []; > %cfg.xparam = 'freq'; > %cfg.zparam = 'cohspctrm'; > %cfg.xlim = [5 80]; > %cfg.cohrefchannel = 'EMGlft'; > %cfg.layout = 'CTF151.lay'; > %cfg.showlabels = 'yes'; > %figure; ft_multiplotER(cfg, fd) > > ----------------------------------------------------------------- > > The messages/error I get is: > > the input is raw data with 25 channels and 1 trials > ??? Maximum variable size allowed by the program is exceeded. > > Error in ==> dpss>dpsscalc at 127 > E = zeros(N,k(2)-k(1)+1); > > Error in ==> dpss at 54 > [E,V] = dpsscalc(N,NW,k); > > Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 > tap = dpss(double(a), double(b), varargin{:}); > > Error in ==> ft_freqanalysis_mtmfft at 249 > tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./ > data.fsample))'; > > Error in ==> ft_freqanalysis at 75 > [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), > cfg, data); > > Error in ==> saad_fieldtrip at 29 > freq = ft_freqanalysis(cfg, data); > > ----------------------------------------------------------------- > > I have been looking around in the discussion board trying to find > how to read a csv file with no success (though it looks to me it > was read successfully since Fieldtrip detected it has 25 channels). > > Also, I am worried about the message > ??? Maximum variable size allowed by the program is exceeded. > Because most of my trials are huge in size, in fact the biggest file > size I have is 25 columns x 250,000 rows (~60MB). > > Your input is highly appreciated. > > Thanks. > 30 days of prizes: Hotmail makes your day easier! Enter now > ---------------------------------- > The aim of this list 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/ Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ab_saad at LIVE.COM Wed May 26 21:51:19 2010 From: ab_saad at LIVE.COM (Saad AB) Date: Wed, 26 May 2010 21:51:19 +0200 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... Message-ID: Hi, Thanks for your response. That definitely helped! However, I am still getting an error that does not make a lot of sense to me. I don't think it has to do with my files size being big since the tutorial in the following link works with files 4 times bigger than mine (208MB): http://fieldtrip.fcdonders.nl/tutorial/coherence Here is the code again for anyone willing to help: %----------------------------------------------- fieldtripdefs; filename='recall.dat'; filelength=129908; rdata=csvread(filename); rdata=rdata'; % cell-array containing strings, Nchan X 1 data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' 'E12' 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' 'E23' 'E24' 'E25' 'E26'}; % sampling frequency in Hz, single number data.fsample = 256; % cell-array containing a data matrix for each trial (1 X Ntrial), each data matrix is Nchan X Nsamples data.trial = {rdata}; % cell-array containing a time axis for each trial (1 X Ntrial), each time axis is a 1 X Nsamples vector data.time{1} = [1:filelength]./data.fsample; cfg = []; cfg.output = 'powandcsd'; cfg.method = 'mtmfft'; cfg.foilim = [0.5 50]; cfg.tapsmofrq = 5; cfg.keeptrials = 'yes'; cfg.channel = {'all' }; cfg.channelcmb = {'all' 'all'}; freq = ft_freqanalysis(cfg, data); cfg = []; cfg.method = 'coh'; cfg.channelcmb = {'all' 'all'}; fd = ft_connectivityanalysis(cfg, freq); %----------------------------------------------- and the error: the input is raw data with 25 channels and 1 trials ??? Maximum variable size allowed by the program is exceeded. Error in ==> dpss>dpsscalc at 127 E = zeros(N,k(2)-k(1)+1); Error in ==> dpss at 54 [E,V] = dpsscalc(N,NW,k); Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 tap = dpss(double(a), double(b), varargin{:}); Error in ==> ft_freqanalysis_mtmfft at 249 tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./data.fsample))'; Error in ==> ft_freqanalysis at 75 [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), cfg, data); Error in ==> saad_fieldtrip at 30 freq = ft_freqanalysis(cfg, data); %------------------------------------------- Thanks in advance for your input. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From jan.schoffelen at DONDERS.RU.NL Thu May 27 09:05:01 2010 From: jan.schoffelen at DONDERS.RU.NL (jan-mathijs schoffelen) Date: Thu, 27 May 2010 09:05:01 +0200 Subject: Reading a csv file into FieldTrip, calculating power and coherence between channels... In-Reply-To: Message-ID: Dear W. Saad, It seems you call ft_freqanalysis with only one quite long data trial in the input. This leads to a frequency tranform which has a very high spectral resolution. The number of tapers used in multitapering (for a given requested half- bandwidth cfg.tapsmofrq) is a function of the spectral resolution. In other words, the higher the spectral resolution, the more tapers are needed. In your case you have approx. 500 seconds of data, yielding a spectral resolution of 1/500 Hz. To achieve a spectral smoothing of 5 Hz you need approximately 1000 tapers. Besides the fact that this is rather meaningless, it will totally exceed your memory limits when the tapers are constructed. The remedy here is to cut your data into shorter segments. The length of these segments will be determined by your experimental question. Best, Jan-Mathijs On May 26, 2010, at 9:51 PM, Saad AB wrote: > Hi, > > Thanks for your response. That definitely helped! > > However, I am still getting an error that does not make a lot of > sense to me. > > I don't think it has to do with my files size being big since the > tutorial > in the following link works with files 4 times bigger than mine > (208MB): > http://fieldtrip.fcdonders.nl/tutorial/coherence > > Here is the code again for anyone willing to help: > %----------------------------------------------- > fieldtripdefs; > filename='recall.dat'; > filelength=129908; > rdata=csvread(filename); > rdata=rdata'; > > % cell-array containing strings, Nchan X 1 > data.label = {'E2' 'E3' 'E4' 'E5' 'E6' 'E7' 'E8' 'E9' 'E10' 'E11' > 'E12' > 'E13' 'E14' 'E15' 'E16' 'E17' 'E18' 'E19' 'E20' 'E21' 'E22' 'E23' > 'E24' > 'E25' 'E26'}; > > % sampling frequency in Hz, single number > data.fsample = 256; > > % cell-array containing a data matrix for each trial (1 X Ntrial), > each data > matrix is Nchan X Nsamples > data.trial = {rdata}; > > % cell-array containing a time axis for each trial (1 X Ntrial), > each time > axis is a 1 X Nsamples vector > data.time{1} = [1:filelength]./data.fsample; > > cfg = []; > cfg.output = 'powandcsd'; > cfg.method = 'mtmfft'; > cfg.foilim = [0.5 50]; > cfg.tapsmofrq = 5; > cfg.keeptrials = 'yes'; > cfg.channel = {'all' }; > cfg.channelcmb = {'all' 'all'}; > freq = ft_freqanalysis(cfg, data); > > cfg = []; > cfg.method = 'coh'; > cfg.channelcmb = {'all' 'all'}; > fd = ft_connectivityanalysis(cfg, freq); > > > %----------------------------------------------- > > and the error: > > the input is raw data with 25 channels and 1 trials > ??? Maximum variable size allowed by the program is exceeded. > > Error in ==> dpss>dpsscalc at 127 > E = zeros(N,k(2)-k(1)+1); > > Error in ==> dpss at 54 > [E,V] = dpsscalc(N,NW,k); > > Error in ==> ft_freqanalysis_mtmfft>double_dpss at 423 > tap = dpss(double(a), double(b), varargin{:}); > > Error in ==> ft_freqanalysis_mtmfft at 249 > tap = double_dpss(numdatbns,numdatbns*(cfg.tapsmofrq./ > data.fsample))'; > > Error in ==> ft_freqanalysis at 75 > [freq] = feval(sprintf('ft_freqanalysis_%s',lower(cfg.method)), > cfg, data); > > Error in ==> saad_fieldtrip at 30 > freq = ft_freqanalysis(cfg, data); > > %------------------------------------------- > > Thanks in advance for your input. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/neuroimaging/fieldtrip. > Dr. J.M. (Jan-Mathijs) Schoffelen Donders Institute for Brain, Cognition and Behaviour, Centre for Cognitive Neuroimaging, Radboud University Nijmegen, The Netherlands J.Schoffelen at donders.ru.nl Telephone: 0031-24-3668063 ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From aardesta at UCLA.EDU Fri May 28 21:07:17 2010 From: aardesta at UCLA.EDU (Allen Ardestani) Date: Fri, 28 May 2010 12:07:17 -0700 Subject: Error in timelockstatistics In-Reply-To: <69C15B57-9A50-41D0-B276-561116F5AB0D@mac.com> Message-ID: Thank you very much for the input - I got the Image Processing Toolbox and am now able to make use of the clustering function. I do have remaining questions about the cluster analysis. I tried looking at the code but still can't figure out what type of clustering approach (e.g., k-means, fuzzy logic, etc) is being used and how to adjust its clustering sensitivity, independent of the cluster thresholding alpha. Any help would be much appreciated! From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Thursday, May 13, 2010 1:22 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Error in timelockstatistics Dear Allen, you need bwlabeln anyhow, no matter how you want to cluster (the function can cluster in n-dimensions). so getting the Image Processing Toolbox may be a good investment if you decide to use fieldtrip statistics in future. an -untested- alternative may be to use the octave version of bwlabeln. usually the code is very compatible to matlab, i.e. if it does not run out-of-the-box it usually just needs a little tweaking. however it may be a lot slower. http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/image/bwlabel.m http://www.gnu.org/software/octave/index.html good luck, nathan On 13.05.2010, at 00:44, Allen Ardestani wrote: Hi everyone, I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: method: 'montecarlo' statistic: 'indepsamplesT' correctm: 'cluster' clusteralpha: 0.0500 clusterstatistic: 'maxsum' tail: 0 clustertail: 0 alpha: 0.0250 numrandomization: 100 design: [1x267 double] channel: 'F1' minnbchan: 0 layout: 'layout.mat' ivar: 1 I get the following error message: ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. Error in ==> findcluster at 89 [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); Error in ==> clusterstat at 194 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> statistics_montecarlo at 321 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 285 [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); Error in ==> ft_timelockstatistics at 96 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I'm assuming that part of the problem is that I don't have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I'm a new user, so any advice is much appreciated. Thanks in advance! ____________________________________________________________________________ ______ Allen Ardestani Email: aardesta at ucla.edu Phone: (310) 825-5528 Medical Scientist Training Program David Geffen School of Medicine at UCLA Semel Institute for Neuroscience and Human Behavior 760 Westwood Plaza Los Angeles, CA 90095-1759 USA ---------------------------------- The aim of this list 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. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.maris at DONDERS.RU.NL Fri May 28 23:29:27 2010 From: e.maris at DONDERS.RU.NL (Eric Maris) Date: Fri, 28 May 2010 23:29:27 +0200 Subject: Error in timelockstatistics In-Reply-To: <015501cafe98$fd6f14c0$f84d3e40$@edu> Message-ID: Hi Allen, Thank you very much for the input - I got the Image Processing Toolbox and am now able to make use of the clustering function. I do have remaining questions about the cluster analysis. I tried looking at the code but still can't figure out what type of clustering approach (e.g., k-means, fuzzy logic, etc) is being used and how to adjust its clustering sensitivity, independent of the cluster thresholding alpha. Any help would be much appreciated! I know it's a bit pretentious to refer to one's own papers, but this is a case where the question forces me: Maris & Oostenveld (2007). Journal of Neuroscience Methods. Good luck, Eric dr. Eric Maris Donders Institute for Brain, Cognition and Behavior Center for Cognition and F.C. Donders Center for Cognitive Neuroimaging Radboud University P.O. Box 9104 6500 HE Nijmegen The Netherlands T:+31 24 3612651 Mobile: 06 39584581 F:+31 24 3616066 E: e. maris at donders.ru.nl From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Nathan Weisz Sent: Thursday, May 13, 2010 1:22 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] Error in timelockstatistics Dear Allen, you need bwlabeln anyhow, no matter how you want to cluster (the function can cluster in n-dimensions). so getting the Image Processing Toolbox may be a good investment if you decide to use fieldtrip statistics in future. an -untested- alternative may be to use the octave version of bwlabeln. usually the code is very compatible to matlab, i.e. if it does not run out-of-the-box it usually just needs a little tweaking. however it may be a lot slower. http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/image/bwlabel.m http://www.gnu.org/software/octave/index.html good luck, nathan On 13.05.2010, at 00:44, Allen Ardestani wrote: Hi everyone, I am having some difficulty using the cluster-based permutations in both time and frequency domains. I have just 8 channels of discrete LFP positions, so I thought it may be problematic to cluster them together in space. I therefore first tried clustering only in time (ERP) or time-frequency (ERS/ERD) by using a single channel. I used [stat] = ft_timelockstatistics(cfg, ave_spatial, ave_non_spatial) with the following cfg: method: 'montecarlo' statistic: 'indepsamplesT' correctm: 'cluster' clusteralpha: 0.0500 clusterstatistic: 'maxsum' tail: 0 clustertail: 0 alpha: 0.0250 numrandomization: 100 design: [1x267 double] channel: 'F1' minnbchan: 0 layout: 'layout.mat' ivar: 1 I get the following error message: ??? Undefined function or method 'bwlabeln' for input arguments of type 'double'. Error in ==> findcluster at 89 [labelmat(spatdimlev, :, :), num] = bwlabeln(reshape(onoff(spatdimlev, :, :), nfreq, ntime), 4); Error in ==> clusterstat at 194 posclusobs = findcluster(reshape(postailobs, [cfg.dim,1]),channeighbstructmat,cfg.minnbchan); Error in ==> statistics_montecarlo at 321 [stat, cfg] = clusterstat(cfg, statrand, statobs,'issource',issource); Error in ==> statistics_wrapper at 285 [stat, cfg] = statmethod(cfg, dat, cfg.design, 'issource',issource); Error in ==> ft_timelockstatistics at 96 [stat, cfg] = statistics_wrapper(cfg, varargin{:}); I'm assuming that part of the problem is that I don't have the Image Processing Toolbox, but is there a way to specify to not cluster across channels? I'm a new user, so any advice is much appreciated. Thanks in advance! ____________________________________________________________________________ ______ Allen Ardestani Email: aardesta at ucla.edu Phone: (310) 825-5528 Medical Scientist Training Program David Geffen School of Medicine at UCLA Semel Institute for Neuroscience and Human Behavior 760 Westwood Plaza Los Angeles, CA 90095-1759 USA ---------------------------------- The aim of this list 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. 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. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.rotonda at GMAIL.COM Sat May 29 18:53:08 2010 From: marco.rotonda at GMAIL.COM (Marco Rotonda) Date: Sat, 29 May 2010 18:53:08 +0200 Subject: cohrefchannel Message-ID: Hi there! I'm trying to plot some coherence analysis I did but I have to specify the reference channel. The point is that I've taken it away in previous analysis done in brainvision and to have it back I have to discard a lot of work. There is a way to bypass this cfg parameter? why is needed? I need only to visualize the coherence indexes I've found... regards Marco ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From r.vandermeij at DONDERS.RU.NL Mon May 31 10:43:54 2010 From: r.vandermeij at DONDERS.RU.NL (Roemer van der Meij) Date: Mon, 31 May 2010 10:43:54 +0200 Subject: issue with cfg.interplimits In-Reply-To: <1D084D6F-BC7F-4DFA-81EB-2684F409E0CA@ccs.fau.edu> Message-ID: Hi Reyna, Sorry for my late reply. I added your bug to our new bug-database, you can track it here if you wish: http://bugzilla.fcdonders.nl/show_bug.cgi?id=86 I'll try to work out a fix in the following days. It probably doesn't have anything to do with your specific ft_prepare_layout options. There has been a reorganization of the plotting-functions several months back, which may have caused this problem. Are you by the way using the most recent fieldtrip version? Best, Roemer On 5/21/2010 8:50 PM, Reyna L. Gordon wrote: > Dear Fieldtrippers, > > I am having an issue with creating topoplots of time-frequency data > acquired on an EGI system and processed in Fieldtrip, and I was > wondering if anyone could help. > > Everything works great (this toolbox has been wonderful to use in > general!) except that the colors that represent power are not > interpolating to electrodes that are lower than the origin. > Unfortunately, using the default option for cfg.projection = > 'orthographic' for ft_prepare_layout, seems to greatly distort the > layout for these data, probably because I have too few electrodes. A > better option for me seems to be cfg.projection = 'polar', and I am > fine with those few electrodes appearing outside of the head. > > However, the data corresponding to those electrodes is not there - I > suspect that there is a problem at the level of cfg.interplimits. > This is the code I'm using: > > cfg = []; > cfg.rotate = 0; > cfg.projection = 'polar'; > newlay=ft_prepare_layout(cfg, bin1); > cfg = []; > > cfg.layout = newlay; > cfg.yparam = 'freq'; > cfg.xlim= [0.150 0.150]; > cfg.ylim= [13 30]; > cfg.zlim = [-0.10 0.10]; > cfg.highlight = 'on'; > cfg.baseline = 'no'; > cfg.commentpos = 'title'; > cfg.shading = 'interp'; > cfg.interplimits = 'electrodes'; %Should work here? > cfg.style = 'straight'; > cfg.zparam = 'powspctrm'; > cfg.fontsize = 12; > cfg.gridscale = 100; > ft_topoplotTFR(cfg, bin1); > > According to the documentation, specifying cfg.interplimits = > 'electrodes' should achieve what I want here, but it still does not > interpolate the plot outside of the head. > Attached are some images generated with different cfg.interplimits and > cfg.projection options. I have tried upgrading to the most recent > release of FT, but it doesn't change the outcome. > > Any and all insight would be greatly appreciated. > Best, > Reyna > > ----------------------- > Reyna L. Gordon > PhD Candidate > Center for Complex Systems & Brain Sciences > Florida Atlantic University > gordon at ccs.fau.edu > > > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. > > > > > > > > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/neuroimaging/fieldtrip. -- Roemer van der Meij MSc Scientific Programmer& Data-Analyst Donders Institute for Brain, Cognition and Behaviour Centre for Cognition P.O. Box 9104 6500 HE Nijmegen The Netherlands Tel: +31(0)24 3612631 E-mail: r.vandermeij at donders.ru.nl ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. From sklein at BERKELEY.EDU Mon May 31 21:43:49 2010 From: sklein at BERKELEY.EDU (Stanley Klein) Date: Mon, 31 May 2010 12:43:49 -0700 Subject: issue with cfg.interplimits In-Reply-To: <4C0376CA.1010205@donders.ru.nl> Message-ID: On Reyna Gordon's comment about interpolation between electrodes. A number of years ago we modified a topo plot so that rather than showing a smooth interpolation it plotted each electrode as a tiny disk with the voltage shown as the color of the disk The disks were made large enough so that with a dense electrode array they would overlap maybe 40%. Three close electrodes could have triple overlap as I recall. The cute thing about the algorithm is that in the overlap regions we would plot the mean of the overlapping electrodes. It produced a very nice plot with cute smoothing and yet one could identify the location of each electrode. I'm sorry I haven't been able to locate that old topoplot code. But here is a crude matlab simulation similar to what we did for the interpolation. elec=[0 1 1 1 1 0 0 0 0 0 ; 0 0 1 1 1 1 0 0 0 0; 0 0 0 0 1 1 1 1 0 0]; V = [1 3 5] [Nelec,Npix]=size(elec) topo=zeros(1,Npix); for i=1:Npix for j=1:Nelec; topo(i)=topo(i)+V(j)*elec(j,i); N=sum(elec(:,i)~=0); end if N>0, topo(i)=topo(i)/N;end end topo where elec is the topographic image where '1' indicates the electrode locations and V is the voltages on the electrodes. The "interpolated" topoplot is topo. As I recall the algorithm we had only worried about 2 electrode overlaps in which case there was a really simple way to do the algorithm without any FOR loops, using a set intersect command from Matlab. I think it would be nifty if this type of option could be included in Fieldtrip so that one sees the electrode locations as well as getting good enough interpolation/smoothing. Stan On Mon, May 31, 2010 at 1:43 AM, Roemer van der Meij wrote: > > Hi Reyna, > > Sorry for my late reply. I added your bug to our new bug-database, you can track it here if you wish: > http://bugzilla.fcdonders.nl/show_bug.cgi?id=86 > > I'll try to work out a fix in the following days. It probably doesn't have anything to do with your specific ft_prepare_layout options. There has been a reorganization of the plotting-functions several months back, which may have caused this problem. > Are you by the way using the most recent fieldtrip version? > > Best, > Roemer > > > > On 5/21/2010 8:50 PM, Reyna L. Gordon wrote: >> >> Dear Fieldtrippers, >> >> I am having an issue with creating topoplots of time-frequency data acquired on an EGI system and processed in Fieldtrip, and I was wondering if anyone could help. >> >> Everything works great (this toolbox has been wonderful to use in general!) except that the colors that represent power are not interpolating to electrodes that are lower than the origin. Unfortunately, using the default option for cfg.projection = 'orthographic' for ft_prepare_layout, seems to greatly distort the layout for these data, probably because I have too few electrodes. A better option for me seems to be cfg.projection = 'polar', and I am fine with those few electrodes appearing outside of the head. >> >> However, the data corresponding to those electrodes is not there - I suspect that there is a problem at the level of cfg.interplimits. >> This is the code I'm using: >> >> cfg = []; >> cfg.rotate = 0; >> cfg.projection = 'polar'; >> newlay=ft_prepare_layout(cfg, bin1); >> cfg = []; >> >> cfg.layout  = newlay; >> cfg.yparam = 'freq'; >> cfg.xlim= [0.150 0.150]; >> cfg.ylim= [13 30]; >> cfg.zlim = [-0.10 0.10]; >> cfg.highlight          = 'on'; >> cfg.baseline = 'no'; >> cfg.commentpos = 'title'; >> cfg.shading    = 'interp'; >> cfg.interplimits = 'electrodes'; %Should work here? >> cfg.style = 'straight'; >> cfg.zparam   = 'powspctrm'; >> cfg.fontsize = 12; >> cfg.gridscale = 100; >> ft_topoplotTFR(cfg, bin1); >> >> According to the documentation,  specifying cfg.interplimits = 'electrodes' should achieve what I want here, but it still does not interpolate the plot outside of the head. >> Attached are some images generated with different cfg.interplimits and cfg.projection options. I have tried upgrading to the most recent release of FT, but it doesn't change the outcome. >> >> Any and all insight would be greatly appreciated. >> Best, >> Reyna >> >> ----------------------- >> Reyna L. Gordon >> PhD Candidate >> Center for Complex Systems & Brain Sciences >> Florida Atlantic University >> gordon at ccs.fau.edu >> >> >> >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. >> >> >> >> >> >> >> >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. > > -- > Roemer van der Meij MSc > Scientific Programmer&  Data-Analyst > Donders Institute for Brain, Cognition and Behaviour > Centre for Cognition > P.O. Box 9104 > 6500 HE Nijmegen > The Netherlands > Tel: +31(0)24 3612631 > E-mail: r.vandermeij at donders.ru.nl > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/neuroimaging/fieldtrip.