From shehsu at INDIANA.EDU Mon Dec 1 11:29:09 2008 From: shehsu at INDIANA.EDU (Hsu, Shen-Mou) Date: Mon, 1 Dec 2008 05:29:09 -0500 Subject: freqgrandaverage-no averaging performed Message-ID: Dear users, The following message was returned when I executed the freqgrandaverage: "not computing grand average, but keeping individual power for 15 subjects Warning: discarding electrode information because it cannot be averaged". I was wondering if someone may shed some light on this issue. Big thanks in advance. Shen-Mou Hsu MY SCRIPT: j = 1; for sub = [1 2 3 6 7 8 9 10 12 13 14 16 17 18 19] load (['Sub',num2str(sub),'_ERSP_N_fieldtrip_',num2str(i)]); ERSPall(j) = TFRwave; j= j+1; end cfg = []; cfg.keepindividual = 'yes'; ERSP_N_LV = freqgrandaverage(cfg, ERSPall(1), ERSPall(2),ERSPall(3),... ERSPall(4), ERSPall(5), ERSPall(6),ERSPall(7),ERSPall(8),... ERSPall(9),ERSPall(10),ERSPall(11),ERSPall(12),ERSPall(13),... ERSPall(14),ERSPall(15)); save('ERSP_N_LV','ERSP_N_LV'); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Dec 1 14:20:57 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 1 Dec 2008 14:20:57 +0100 Subject: coordinates In-Reply-To: <20081128143502.d7ybij6e0cggc484@courriel.upmc.fr> Message-ID: On 28 Nov 2008, at 14:35, Marco SPERDUTI wrote: > hallo, > > i would like to know it is possible, once i've made the source > reconstruction, to have a text file with the coordinates of the > sources. after using the "sourceanalysis" function the source positions are stored in source.pos as Nx3 matrix with [x y z]. best regards Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From bleichner.martin at GMAIL.COM Mon Dec 1 14:47:42 2008 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Mon, 1 Dec 2008 14:47:42 +0100 Subject: Different results using multitapers and wavelet Message-ID: hi there, I am using multitapers as well as wavelets to compute my time frequency spectrum of ECoG data (50Hz-90Hz). Recently I realized some discrepancy using these two methods, until than I found that these to method lead to comparable results. In one of our datasets we found very large differences between the two methods. When I looked closer at the problem I found out that the two methods lead to similar results when the effect (increase in power) is large, while they deviate quite a bit when the effect is small. In that case i get a kind of 'checkerboard' like time frequency spectrum for the mutlitapers. I also compared the output of the frequency analysis with the bandpassed raw signal and found that the wavelet transform was the better match. A re there any prerequisites for multitaper use? Does anybody has some experience with this effect? Do I do something wrong? Below you can find the cfg settings I am using Multitaper cfg.output ='pow' cfg.method='mtmconvol' cfg.tapers='dpss' cfg.toi=[-0.5:0.01:2.5] cfg.foi=[55:2:95] cfg.t_ftimwin=ones(size(cfg.foi))*0.2; cfg.tapsmofrq=ones(size(cfg.foi))*15; Wavelet cfg.method='wltconvol'; cfg.width=7; cfg.foi=[55:2:95] cfg.toi=[-0.5:0.01:2.5] Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingrid.nieuwenhuis at FCDONDERS.RU.NL Mon Dec 1 15:51:00 2008 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Mon, 1 Dec 2008 15:51:00 +0100 Subject: Different results using multitapers and wavelet In-Reply-To: Message-ID: Hi Martin, If you use multitapers (or any frequency analysis) you have to take care that you have an integer amount of cycles in your timewindow. Since you use a fixed timewindow of 0.2 seconds, your frequency steps should be a multiple of 5, so cfg.foi should be 55:5:95 or either you should use a cfg.timwin which is dependent on the cfg.foi (fi 7 cycles, just as in your wavelets). See the tutorial on the FieldTrip website for more explanation. (fieldtrip > documentation > tutorial >Time-frequency Analysis Using Multitapers and Wavelets) Best Ingrid _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Martin Bleichner Sent: Monday, December 01, 2008 2:48 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] Different results using multitapers and wavelet hi there, I am using multitapers as well as wavelets to compute my time frequency spectrum of ECoG data (50Hz-90Hz). Recently I realized some discrepancy using these two methods, until than I found that these to method lead to comparable results. In one of our datasets we found very large differences between the two methods. When I looked closer at the problem I found out that the two methods lead to similar results when the effect (increase in power) is large, while they deviate quite a bit when the effect is small. In that case i get a kind of 'checkerboard' like time frequency spectrum for the mutlitapers. I also compared the output of the frequency analysis with the bandpassed raw signal and found that the wavelet transform was the better match. A re there any prerequisites for multitaper use? Does anybody has some experience with this effect? Do I do something wrong? Below you can find the cfg settings I am using Multitaper cfg.output ='pow' cfg.method='mtmconvol' cfg.tapers='dpss' cfg.toi=[-0.5:0.01:2.5] cfg.foi=[55:2:95] cfg.t_ftimwin=ones(size(cfg.foi))*0.2; cfg.tapsmofrq=ones(size(cfg.foi))*15; Wavelet cfg.method='wltconvol'; cfg.width=7; cfg.foi=[55:2:95] cfg.toi=[-0.5:0.01:2.5] Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From saskia.haegens at DONDERS.RU.NL Mon Dec 1 15:53:09 2008 From: saskia.haegens at DONDERS.RU.NL (Saskia Haegens) Date: Mon, 1 Dec 2008 15:53:09 +0100 Subject: freqgrandaverage-no averaging performed In-Reply-To: <7F00B6A0D4D0674E80A6C1D6DA873B5701E4AC782B@iu-mssg-mbx05.ads.iu.edu> Message-ID: If you want to calculate the average over subjects, use cfg.keepindividual = 'no'; If you want to keep the individual data (e.g. for doing statistics) use cfg.keepindividual = 'yes'; Best, Saskia > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Hsu, Shen-Mou > Sent: 01 December 2008 11:29 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] freqgrandaverage-no averaging performed > > Dear users, > > The following message was returned when I executed the freqgrandaverage: > "not computing grand average, but keeping individual power for 15 subjects > Warning: discarding electrode information because it cannot be averaged". > > I was wondering if someone may shed some light on this issue. > > Big thanks in advance. > > Shen-Mou Hsu > > MY SCRIPT: > > j = 1; > > for sub = [1 2 3 6 7 8 9 10 12 13 14 16 17 18 19] > load (['Sub',num2str(sub),'_ERSP_N_fieldtrip_',num2str(i)]); > > ERSPall(j) = TFRwave; > j= j+1; > end > > > > cfg = []; > cfg.keepindividual = 'yes'; > > ERSP_N_LV = freqgrandaverage(cfg, ERSPall(1), ERSPall(2),ERSPall(3),... > ERSPall(4), ERSPall(5), ERSPall(6),ERSPall(7),ERSPall(8),... > ERSPall(9),ERSPall(10),ERSPall(11),ERSPall(12),ERSPall(13),... > ERSPall(14),ERSPall(15)); > > > save('ERSP_N_LV','ERSP_N_LV'); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From bleichner.martin at GMAIL.COM Mon Dec 1 16:17:40 2008 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Mon, 1 Dec 2008 16:17:40 +0100 Subject: Different results using multitapers and wavelet In-Reply-To: <001501c953c4$39f6f0b0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid, thanks for the tip, but it does not solve the problem. I tried now the method that I am normally using for the low frequencies (hanning) for my high frequency range and get results comparable to the wavelet. See below. Any other suggestions? best Martin cfg.output ='pow' cfg.method='mtmconvol' cfg.tapers='hanning' cfg.toi=[-0.5:0.01:2.5] cfg.foi=[55:2:95] cfg.t_ftimwin=4./cfgLow.foi 2008/12/1 Ingrid Nieuwenhuis > Hi Martin, > > > > If you use multitapers (or any frequency analysis) you have to take care > that you have an integer amount of cycles in your timewindow. Since you use > a fixed timewindow of 0.2 seconds, your frequency steps should be a multiple > of 5, so cfg.foi should be 55:5:95 or either you should use a cfg.timwin > which is dependent on the cfg.foi (fi 7 cycles, just as in your wavelets). > See the tutorial on the FieldTrip website for more explanation. (fieldtrip » > documentation » tutorial »Time-frequency Analysis Using Multitapers and > Wavelets) > > > > Best Ingrid > ------------------------------ > > *From:* FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] *On > Behalf Of *Martin Bleichner > *Sent:* Monday, December 01, 2008 2:48 PM > *To:* FIELDTRIP at NIC.SURFNET.NL > *Subject:* [FIELDTRIP] Different results using multitapers and wavelet > > > > hi there, > > I am using multitapers as well as wavelets to compute my time frequency > spectrum of ECoG data (50Hz-90Hz). Recently I realized some discrepancy > using these two methods, until than I found that these to method lead to > comparable results. > > In one of our datasets we found very large differences between the two > methods. When I looked closer at the problem I found out that the two > methods lead to similar results when the effect (increase in power) is > large, while they deviate quite a bit when the effect is small. > In that case i get a kind of 'checkerboard' like time frequency spectrum > for the mutlitapers. > I also compared the output of the frequency analysis with the bandpassed > raw signal and found that the wavelet transform was the better match. A > > re there any prerequisites for multitaper use? Does anybody has some > experience with this effect? Do I do something wrong? > Below you can find the cfg settings I am using > > Multitaper > cfg.output ='pow' > cfg.method='mtmconvol' > cfg.tapers='dpss' > cfg.toi=[-0.5:0.01:2.5] > cfg.foi=[55:2:95] > cfg.t_ftimwin=ones(size(cfg.foi))*0.2; > cfg.tapsmofrq=ones(size(cfg.foi))*15; > > > Wavelet > cfg.method='wltconvol'; > cfg.width=7; > cfg.foi=[55:2:95] > cfg.toi=[-0.5:0.01:2.5] > > Thanks > > Martin > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredericroux at HOTMAIL.DE Wed Dec 3 23:23:45 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Wed, 3 Dec 2008 23:23:45 +0100 Subject: error using denoise_synthetic Message-ID: Hi, I'm getting an error message related to the number of channels when using the denoise_synthetic function. I use the following code: cfg = []; cfg.channel = {'all', 'EEG'}; etc. etc. etc. cfg.gradient = 'G3BR'; cfg.trial = 'all'; data = preprocessing(cfg); data = denoise_synthetic(cfg,data); The error message states that not all channels required for the montage are in the data set. Now, before I used denoise_synthetic my script was perfectly running and the data looked ok. Can anyone tell me what may be the issue here? Thank you in advance for any kind of suggestion, Frederic _________________________________________________________________ Wer erfand den Glückskeks? Kleiner Tipp: Die Chinesen waren es nicht! - Mehr auf msn.de http://redirect.gimas.net/?n=M0812xMSNDE ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bleichner.martin at GMAIL.COM Thu Dec 4 13:40:13 2008 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Thu, 4 Dec 2008 13:40:13 +0100 Subject: multiplotER for averaged time frequency data Message-ID: Hi there, I am trying to get a multiplotER() kind of plot for time frequency data, averaged over a specific frequency range. I.e. I compute a time frequency spectrum average over the gamma band and want to plot the resulting traces for all electrodes. However, mutliplotER() refuses to accept time frequency data. I managed to trick it into accepting it but wondered whether there is a cleaner possibility to plot this kind of data. Thanks best Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhamidi at WISC.EDU Fri Dec 5 20:18:35 2008 From: mhamidi at WISC.EDU (Massih Hamidi) Date: Fri, 5 Dec 2008 20:18:35 +0100 Subject: Creating BEM headmodel for EEG Message-ID: I am trying to create a BEM model using the Create BEM headmodel for EEG script. Everything works well until the prepare_bemmodel command. When using the dipoli executable script, I receive an error that says I have duplicate vertices (and looking at vol.bnd.pnt, it looks like I do have a few vertices with the same coordinates). I have also tried using the "brainstorm" option for calculating the bem model, but although it runs without error, the script ends with a keyboard command and no system matrix is added to the vol variable. I am pretty new at this (so forgive me if I'm missing something simple). Thanks. Massih Hamidi ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From A.Stolk at EWI.UTWENTE.NL Tue Dec 9 11:26:22 2008 From: A.Stolk at EWI.UTWENTE.NL (A. Stolk) Date: Tue, 9 Dec 2008 11:26:22 +0100 Subject: volumesegment in BEM model Message-ID: Hi there, Using the example script 'create bemmodel for eeg', I keep struggling with the volumesegment part. mri = read_fcdc_mri('t1_icbm_normal_1mm_pn0_rf0.mnc'); cfg = []; seg = volumesegment(cfg, mri); And when I add commands like, cfg.write = 'no'; cfg.coordinates = 'spm'; cfg.template = '\fieldtrip-20081015\spm5\templates\T1.mnc'; I receive the same errors related to the file's dimensions, namely; ??? Error using ==> spm_slice_vol Wrong sized dim. Error in ==> spm_read_vols at 35 Y(:,:,p,i) = spm_slice_vol(V(i),spm_matrix([0 0 p]),V(i).dim(1:2),0); Error in ==> read_fcdc_mri at 107 img = spm_read_vols(hdr); Error in ==> bemmodelfieldtrip at 14 mri = read_fcdc_mri('t1_icbm_normal_1mm_pn0_rf0.mnc'); I got this error using multiple fieldtrip versions. p.s. Also did have to add the spm_slice_vol.mexw32 file, found in the spm2 update. Regards, Arjen ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Tue Dec 9 15:54:27 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Tue, 9 Dec 2008 15:54:27 +0100 Subject: Problem running source grand average a nd source statistics Message-ID: Hi Jan-Matthijs, hi Ingrid, dear listusers thanks for your help with the problem of sparsified data. I have meanwhile managed to "fix" sourcegrandaverage simply by telling it to use something like Nvoxel = length(dataset.stat) (dirty hack I know...). But it seems that sourcestatistics isn't fooled that easily and I am getting a bit lost moving from subfunction to subfunction. And I was just wondering whether working with sparse data and reverse transformed, irregular grids in sourcestatistics is something anyone else is still doing (we'd like to keep on doing it to have corresponding virtual electrodes over subjects). ... and whether my problems are possibly related to the fact that I am trying to use the 'stat' field instead of the 'pow' field in sourcestatistics. In version 20081203 and 20081208 there is also again a bug that makes sourcestatistics complain about a missing dim field.: ?? Reference to non-existent field 'dim'. Error in ==> fieldtrip-20081208/private/statistics_wrapper>get_source_trial at 621 fprintf('only selecting voxels inside the brain for statistics (%.1f%%)\n', 100*length(varargin{1}.inside)/prod(varargin{1}.dim)); Error in ==> fieldtrip-20081208/private/statistics_wrapper at 290 [dat, cfg] = get_source_trial(cfg, varargin{:}); Error in ==> sourcestatistics at 155 stat = statistics_wrapper(cfg, varargin{:}); Error in ==> NewDICSAnalysis200809_01 at 559 SourceStat = sourcestatistics(cfg,RawSources ); My code is still the same as posted below, the section it complains about now used to run smoothly with the November versions. It seems as if the dim field is not being added when using the reverse transformed grid from the tutorial. Any help appreciated Michael > -----Ursprüngliche Nachricht----- > Von: "jan-mathijs schoffelen" > Gesendet: 05.11.08 15:36:05 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Problem running source grand average a nd source statistics > Hi Michael, > > > stat: [3297x1 double] > > This indicates that your singlesubjects are indeed sparsified, so > that when you getsubfield this guy, you end up with fewer data-points > than expected (which is Nvoxel==prod(dim)). > > Does this give you enough guidelines to fix it? > > JM > > > On Nov 5, 2008, at 1:50 PM, Michael Wibral wrote: > > > Dear Ingrid, dear Jan-Mathijs > > > > I guess Ingrid is indeed correct, as all my datasets have the same > > dimension of the stat field and of the inside/outside fields. I was > > actually also supplying the dim field from the template to all > > datasets, so the product of dims' should be the same everywhere, > > but that hasn't really solved the problem. The length of the inside > > field is 3297, the outside field is 3129, their sum is 6426 which > > is identical to the product of dimensions of the template grid > > which are 17 x 21 x 18 =6426. So I am really a bit puzzled here... > > > > Anyway, here's the code I use, maybe someone a really stupid error, > > that I simply overlooked: > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % FIRST I prepare a file with the data and the settings for the > > statistics that is later read in again: > > % datapath = '/data/home1/ctillman/data/MooneyMEEGFieldtripAnalysis/ > > DICSBeamformingMW200808/Stats/'; > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > DesignData1 = { > > 'ABA04_Up_StatSources.mat' > > 'IFS20_Up_StatSources.mat'; > > 'IKE28_Up_StatSources.mat'; > > 'JHA07_Up_StatSources.mat'; > > 'JPA05_Up_StatSources.mat'; > > 'MKA21_Up_StatSources.mat'; > > 'MMA07_Up_StatSources.mat'; > > 'PSS16_Up_StatSources.mat'; > > 'SNI05_Up_StatSources.mat'; > > 'UWA31_Up_StatSources.mat'; > > > > }; > > > > DesignData2 = { > > 'ABA04_In_StatSources.mat'; > > 'IFS20_In_StatSources.mat'; > > 'IKE28_In_StatSources.mat'; > > 'JHA07_In_StatSources.mat'; > > 'JPA05_In_StatSources.mat'; > > 'MKA21_In_StatSources.mat'; > > 'MMA07_In_StatSources.mat'; > > 'PSS16_In_StatSources.mat'; > > 'SNI05_In_StatSources.mat'; > > 'UWA31_In_StatSources.mat'; > > > > }; > > > > % The statistics configuration > > cfg = []; > > nSubjects = min(length(DesignData1),length(DesignData2)); > > a = [1:nSubjects]; > > b = ones(1,nSubjects); > > cfg.design = [a a; b (2*b)]; > > cfg.ivar = 2; % independent variable: condition > > cfg.uvar = 1; % subjects > > cfg.method = 'montecarlo'; > > cfg.correctm = 'cluster'; > > cfg.clusteralpha = 0.01; > > cfg.alpha = 0.05; > > cfg.clusterstatistic = 'maxsum'; > > cfg.numrandomization = 500; %2000; > > cfg.threshold = 0.01; > > cfg.parameter = 'stat'; > > cfg.statistic = 'depsamplesT'; > > > > % create output file > > OutFileName = strcat(datapath,'DesignStat2008_11_04.mat'); > > save(OutFileName, 'DesignData1', 'DesignData2', 'cfg', 'datapath'); > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % SECOND I read in this file and the template and try to perform > > grandaveraging and sourcestatistics at the second level: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > function [] = StatisticsDICS(DesignStatLCMVFile); > > > > > > template = load('/data/home1/ctillman/data/ > > MooneyMEEGFieldtripAnalysis/DICSBeamformingMW200808/Grids/ > > MNItemplate_231008_-1p5iws.mat'); > > Nx = length(template.template_grid.xgrid) > > Ny = length(template.template_grid.ygrid) > > Nz = length(template.template_grid.zgrid) > > > > load(DesignStatLCMVFile); % contains datapath, DesignData1, > > DesignData2, cfg > > > > % Load Data from DesignData1,2 automatically ensuring matching sizes > > % please ensure that data pairs are OK if using paired statistics ! > > > > > > for i = 1:min(length(DesignData1),length(DesignData2)) > > m=strcat('loading dataset#:', num2str(2*i-1)); > > disp(m); > > fullname1 = strcat(datapath,DesignData1{i,1}); > > Data1{i} = load(fullname1); > > m=strcat('loading dataset#:', num2str(2*i)); > > disp(m); > > fullname2 = strcat(datapath,DesignData2{i,1}); > > Data2{i} = load(fullname2); > > end > > > > % Fixing the structure properties > > > > for l = 1:size(Data1,2) > > > > Data1{l}.SourceStat.xgrid = template.template_grid.xgrid; > > Data1{l}.SourceStat.ygrid = template.template_grid.ygrid; > > Data1{l}.SourceStat.zgrid = template.template_grid.zgrid; > > Data1{l}.SourceStat.dim = [Nx Ny Nz]; > > Data1{l}.SourceStat.pos = template.template_grid.pos; > > Data1{l}.SourceStat.inside = template.template_grid.inside; > > Data1{l}.SourceStat.outside = template.template_grid.outside; > > Data1{l} = Data1{l}.SourceStat; > > > > > > Data2{l}.SourceStat.xgrid = template.template_grid.xgrid; > > Data2{l}.SourceStat.ygrid = template.template_grid.ygrid; > > Data2{l}.SourceStat.zgrid = template.template_grid.zgrid; > > Data2{l}.SourceStat.dim = [Nx Ny Nz]; > > Data2{l}.SourceStat.pos = template.template_grid.pos; > > Data2{l}.SourceStat.inside = template.template_grid.inside; > > Data2{l}.SourceStat.outside = template.template_grid.outside; > > Data2{l} = Data2{l}.SourceStat; > > > > end > > > > % prepare the statistics by computing the grandaverage with individual > > % subject data retained > > % Compute grand average for Condition 1 and 2 > > cfgGA = []; > > cfgGA.keepindividual = 'yes'; > > cfgGA.parameter='stat'; > > % create command strings for the computaion: > > commandstr1 = strcat ('DataGA1', '=sourcegrandaverage(cfgGA'); > > commandstr2 = strcat ('DataGA2', '=sourcegrandaverage(cfgGA'); > > > > for l = 1 : length(Data1) > > commandstr1 = strcat(commandstr1, ',Data1{', num2str(l) , '}'); > > commandstr2 = strcat(commandstr2, ',Data2{', num2str(l) , '}'); > > end > > % finalize command strings > > commandstr1=strcat(commandstr1,');') > > commandstr2=strcat(commandstr2,');') > > eval(commandstr1) % yields DataGA1; > > eval(commandstr2) % yields DataGA2; > > > > clear Data1; clear Data2; % no longer needed we now have DataGA1,2 > > > > %SourceStatsitics cfg is known from the design file! > > sourceStat = sourcestatistics(cfg, DataGA1, DataGA2); > > OutFilename = ... > > strcat(datapath, > > 'SourceStatisticsLCMV_denoisedDataAndNewGrids_1000rand_',DesignData1 > > {i,1}(7:end-4),'_calpha',num2str(cfg.clusteralpha), > > '_alpha_',num2str(cfg.alpha),'.mat'); > > save(OutFilename, 'sourceStat'); > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > %%%%%%%%%%%%%%%%%%% > > > > > > Here's the inforamtion from the datasets and the template: > > > > Information of a dataset after processing/preparing for > > sourcegrandaverage: > > > > > > stat: [3297x1 double] > > df: 134 > > critval: [-1.9778 1.9778] > > prob: [3297x1 double] > > mask: [3297x1 logical] > > dim: [17 21 18] > > inside: [1x3297 double] > > outside: [1x3129 double] > > pos: [6426x3 double] > > cfg: [1x1 struct] > > xgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 > > 70 80] > > ygrid: [-120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 > > 10 20 30 40 50 60 70 80] > > zgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 > > 70 80 90] > > > > Information of the template: > > xgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80] > > ygrid: [-120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 > > 10 20 30 40 50 60 70 80] > > zgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 > > 70 80 90] > > dim: [17 21 18] > > pos: [6426x3 double] > > inside: [1x3297 double] > > outside: [1x3129 double] > > > > The onlz thing that I see varying fron dataset to dataset is the df > > field. > > > > Any help appreciated, > > Michael > > > > > >> -----Ursprüngliche Nachricht----- > >> Von: "Ingrid Nieuwenhuis" > >> Gesendet: 05.11.08 14:02:04 > >> An: FIELDTRIP at NIC.SURFNET.NL > >> Betreff: Re: [FIELDTRIP] Problem running source grand average and > >> source statistics > > > > > >> Dear Michael and Jan-Mathijs, > >> > >> If the same procedure is followed as on the wiki, the inside of > >> the template > >> grid is copied to the single subjects, so by definition also the > >> 'sparsified' single subjects sources should all have the same > >> amount of > >> (inside) voxels. So point 2 J-M raised can't be it, point 1 could > >> well be: > >> Because in line 115 dat's size is defined as (Nvoxels, Nsubj) and > >> Nvoxels is > >> the product of the dim. > >> > >> Best Ingrid > >> > >> -----Original Message----- > >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > >> On Behalf > >> Of jan-mathijs schoffelen > >> Sent: Wednesday, November 05, 2008 10:20 AM > >> To: FIELDTRIP at NIC.SURFNET.NL > >> Subject: Re: [FIELDTRIP] Problem running source grand average and > >> source > >> statistics > >> > >> Dear Michael, > >> > >> I agree with you that a likely cause is that the Nvoxel (which is > >> based on the dimensionality of the first singlesubject-source in the > >> input) varies across subjects. However, this would be strange, > >> because you use the same dipole grid for all subjects. On the other > >> hand: could it be that you 'sparsified' the single subjects? Each > >> subject could have a slightly different number of 'inside' positions. > >> This obviously leads to problems: > >> 1 because the Nvoxel is incorrect in the first place (it's the > >> product of the dim, so the input is assumed to be full 3D, or a > >> linear array with all outside voxels present (either as nans or zeros > >> or whichever number you fancy). > >> 2 because the length of the array per subject varies. > >> > >> Hope this helps, > >> > >> Jan-M > >> > >> > >> > >> On Nov 4, 2008, at 5:35 PM, Michael Wibral wrote: > >> > >>> Dear list users, > >>> > >>> I am having a problem running, source grandaverage and source > >>> statistics (over multiple subjects) on the output of > >>> soucrestatistictics (from multiple trials in single subjects). > >>> > >>> I ran first sourceanalysis supplying the backwads warped grids (as > >>> described in the wiki) to compute filters. Then I ran source > >>> analysis again to extract the single trial source images and the > >>> ran sourcestatistitics on this to get the single subject > >>> statistical images - all this runs fine. I then supply the pos (and > >>> dim) data of the template grid to each structure, replacing the > >>> original pos data (that do not match and of course prohibit using > >>> sourceststatistics and sourcegrandaverage). When trying to do > >>> either a source grand average or a sourcestatistics at the > >>> multisubject level I get the same error: > >>> > >>> subscripted assignment dimension mismatch > >>> dat(:,i) = tmp(:); > >>> > >>> Error in ==> sourcegrandaverage at 173 > >>> > >>> > >>> The corresponding lines of code in sourcegrandaverage are: > >>> > >>> % get the source parameter from each input source reconstruction > >>> % get the inside parameter from each input source reconstruction > >>> for i=1:Nsubject > >>> % TODO this function should use parameterselection > >>> if issubfield(varargin{i}, ['avg.' cfg.parameter]) > >>> tmp = getsubfield(varargin{i}, ['avg.' cfg.parameter]); > >>> else > >>> tmp = getsubfield(varargin{i}, cfg.parameter); > >>> end > >>> dat(:,i) = tmp(:); > >>> tmp = getsubfield(varargin{i}, 'inside'); > >>> inside(tmp,i) = 1; > >>> end > >>> > >>> I get an identical error when using sourcestatistics at the > >>> multisubject level. > >>> The variable dat(:,i) is created like this: > >>> dat = zeros(Nvoxel, Nsubject) > >>> > >>> > >>> I suspect that somehow trying to use the 'stat' instead of the > >>> power parameter is a problem (TODO?) or that Nvoxel somehow differs > >>> over the various subjects ?? > >>> > >>> Any advice on what to try and test further would very much > >>> appreciated. > >>> > >>> Thanks in advance, > >>> Michael > >>> > >>> > >>> ---------------------------------- > >>> The aim of this list is to facilitate the discussion between users > >>> of the FieldTrip toolbox, to share experiences and to discuss new > >>> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > >>> archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > >>> fieldtrip. > >> > >> ---------------------------------- > >> The aim of this list is to facilitate the discussion between users > >> of the > >> FieldTrip toolbox, to share experiences and to discuss new ideas > >> for MEG > >> and EEG analysis. See also > >> http://listserv.surfnet.nl/archives/fieldtrip.html and > >> http://www.ru.nl/fcdonders/fieldtrip. > >> > >> ---------------------------------- > >> The aim of this list is to facilitate the discussion between users > >> of the FieldTrip toolbox, to share experiences and to discuss new > >> ideas for MEG and EEG analysis. See also http:// > >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ > >> fcdonders/fieldtrip. > >> > > > > > > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > > of the FieldTrip toolbox, to share experiences and to discuss new > > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > > fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Thu Dec 11 17:02:14 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 11 Dec 2008 17:02:14 +0100 Subject: bug in freqanalysis_mtmfft in case of non-dpss tapers and variable trial length Message-ID: Dear all, I just identified and fixed a bug in freqanalysis_mtmfft. The bug caused an incorrect scaling of non-dpss tapers in case of variable trial length. Multitapers (cfg.taper=dpss) are not affected, and data in which all trials are of equal length are also not affected. The bug became apparent to me when I compared hanning-tapered power estimates in which some trials were missing some samples versus the same data in which all trials were of exactly equal length. The power difference between those two was a factor ~100x, whereas the difference was that in one condition the data of a few trials was one sample too short. The consequence of the taper not being scaled/normalized correctly is that all frequencies are multiplied by a fixed amount. The overall shape of the power spectrum will not look different, it is just multiplied with a fixed amount. Comparing two datasets with variable trial length for both conditions is also not affected (the absolute power values will both be off with a similar factor). There are cases thinkeable in which the bug will have caused problems in the subsequent analysis, e.g. in the data that I was analyzing. The problem was quite obvious: a factor ~100 difference between the power spectra in the two conditions, where that factor 100 was frequency aspecific. Sorry for the inconvenience that it may have caused. best regards, Robert PS for the external users: the fixed version will be uploaded to the ftp server this evening around 22h CET. ----------------------------------------------------------- Robert Oostenveld Senior Researcher Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/neuroimaging ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From amano at BRAIN.K.U-TOKYO.AC.JP Fri Dec 12 07:02:25 2008 From: amano at BRAIN.K.U-TOKYO.AC.JP (Kaoru Amano) Date: Fri, 12 Dec 2008 15:02:25 +0900 Subject: Transformation from head to MEG coordinate In-Reply-To: <91FE2963-4911-4996-B0AD-0B8909BE6DA6@fcdonders.ru.nl> Message-ID: Dear all We are using Yokogawa's MEG system and are trying to do source localization using fieldtrip. In "prepare_leadfield.m", dipole grid is supposed to be provided in head coordinate, while sensor location is defined in MEG coordinate. For the registration between head and MEG coordinates, we need to specify the information of head positioning, in which we get MEG coordinates of three markers. Could you tell me how we can specify the information of head positioning? Best, Kaoru -- Kaoru Amano email: amano at brain.k.u-tokyo.ac.jp URL: http://www.brain.k.u-tokyo.ac.jp/~amano/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri Dec 12 07:41:12 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 12 Dec 2008 06:41:12 +0000 Subject: Transformation from head to MEG coordinate In-Reply-To: <4941FE71.1060501@brain.k.u-tokyo.ac.jp> Message-ID: Dear Kaoru, 1) There is no requirement to provide the grid in head coordinates. vol, grid and sensors can be in any coordinate system as long as it is the same system. 2) What do you use to read sensor positions and fiducials for Yokogawa? The code available in Fieldtrip at the moment is incomplete and would not allow you to use the beamformer. If you have something better, we'd be very interested in integrating your code. 3) There are some functions in Fieldtrip to do coregistration. Look at electroderealign and interactiverealign. 4) SPM8b (http://www.fil.ion.ucl.ac.uk/spm/software/spm8b/) which is very well integrated with Fieldtrip has some facilities for coregistering sensors and head models using GUI. The resulting coregistered volume in sensors can be used for beamforming in Fieldtrip. But this wil only work with proper Yokogawa support which we lack at the moment. Best, Vladimir On Fri, Dec 12, 2008 at 6:02 AM, Kaoru Amano wrote: > Dear all > > We are using Yokogawa's MEG system and are trying to do source localization > using fieldtrip. > > In "prepare_leadfield.m", dipole grid is supposed to be provided in head > coordinate, while sensor location is defined in MEG coordinate. For the > registration between head and MEG coordinates, we need to specify the > information of head positioning, in which we get MEG coordinates of three > markers. > > Could you tell me how we can specify the information of head positioning? > > > Best, > Kaoru > > > > -- > Kaoru Amano > email: amano at brain.k.u-tokyo.ac.jp > URL: http://www.brain.k.u-tokyo.ac.jp/~amano/ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marco.sperduti at UPMC.FR Fri Dec 12 12:20:31 2008 From: marco.sperduti at UPMC.FR (Marco SPERDUTI) Date: Fri, 12 Dec 2008 12:20:31 +0100 Subject: group sources statistics Message-ID: Dear users, once i've done sources statistics for a single subject, is there a way to do it on the group keeping subjects informations? thank you, 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/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri Dec 12 17:37:12 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 12 Dec 2008 17:37:12 +0100 Subject: Problems with second level source statistics for multi plew subjects and firsty level stats - solved :-) Message-ID: Dear listusers, in several previous mails I have reported about problems occuring when: 1) doing single subjects source analysis using reverse-normalized grids (thanks to Ingrid's tutorial), common filters for the two conditions and generating single trial source data 2) then performing single subject sourcestatistics (getting a sparse data representation with a stat field) 3) then doing second level sourcestatistics (which didn't work) I am happy to report these problems are solved :-). I actually just overlooked a WARNING:... when doing single subject sourceanalysis and sourcestatistics (1st level) is says that you yourself have to add a dim field by hand, when trying to use clusterrandanalysis/sourcestatistics later. I now simply added a dim field to both, to the data and to the cfg for the second level source statistics. The correct choice for this dim field are the dimension of the original, orthogonal, regular grid in MNI space and everything works now. I just didn't realize that dim can't be all that easily generated automatically by fieldtrip for sparse data and *warped* grids. This is because the warping could - in principle - be such that dim doesn't make any sense anymore, e.g. because points (almost) switch places along a certain dimension (if they differ in the other coordinates). So neighborhood relations are not well defined a priori in sparse data. Hence, the need for a manual addition of dim in this case (please correct me me if any of the above is wrong). The version I used and that I can confirm to work was 20081208. Many thanks for all your support, Michael ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From mhamidi at WISC.EDU Sat Dec 13 00:56:53 2008 From: mhamidi at WISC.EDU (Massih Hamidi) Date: Sat, 13 Dec 2008 00:56:53 +0100 Subject: error with sourceanalysis Message-ID: I am running the "localizing oscillatory sources using beamformer techniques" tutorial on my EEG data (imported from EEGlab) using the mnc t1 template MRI (as described in the "Create BEM headmodel for EEG" tutorial). However, I get an error when running sourceinterpolate (?? Attempted to access sel(1); index out of bounds because numel(sel)=0.) When I plotted the output of sourceanalysis (without the anatomical mri), I get a strange pattern (attached). I then tried to run prepare_leadfield with cfg.mri (create the dipole grid based on segmented mri) and I was able to successfully run sourceanalysis and sourceitnerpolate, but the map of power estimates look nothing like what is shown in the tutorial (also attached). Plotting the data and time-frequency analysis results seem fine, so I don't think it's an import or freqanalysis problem. Any ideas on what's wrong? Thanks. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: sourcepost.jpg Type: image/jpeg Size: 25321 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sourcepostwithMRIbasedgrid.jpg Type: image/jpeg Size: 61407 bytes Desc: not available URL: From nathanweisz at MAC.COM Sat Dec 13 18:15:16 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Sat, 13 Dec 2008 18:15:16 +0100 Subject: problems while calculating leadfield Message-ID: hi, i have a problem while performing prepare_leadfield. the data is some old CTF data i collected ~2 years ago. i calculated a multisphere model in fieldtrip using prepare_localspheres. this step works (i.e. i get a vol structure that looks ok in my opinion). however when continuing with prepare_leadfield the the program crashes. here's the code: cfg=[]; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; cfg.vol=vol; cfg.channel='MEG'; cfg.grad=dataCLeConI.grad; cfg.inwardshift=0; cfg.grid.resolution=1; cfg.reducerank=2; lf=prepare_leadfield(cfg); i get this error message: ??? Error using ==> prepare_headmodel at 301 synthetic gradients not supported during volume conductor setup Error in ==> prepare_leadfield at 223 [vol, sens, cfg] = prepare_headmodel(cfg, data); Error in ==> newcat_calcgrid at 52 lf=prepare_leadfield(cfg); i messed around with different headmodels just to see how prepare_leadfield behaves: *when the headmodel is a single sphere (cfg.singlesphere='yes') prepare_leadfield works fine *when using the nolte headmodel (via prepare_singleshell), prepare_leadfield does not crash, but the leadfields contain only NaN ... is that perhaps related to the issue above? again, any help is greatly appreciated. best, nathan -------------------------------------------- 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/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Mon Dec 15 11:36:54 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Dec 2008 11:36:54 +0100 Subject: error with sourceanalysis In-Reply-To: Message-ID: My first suspicion is that there there is a problem with the coordinate system, e.g. that you express one geometrical object (the mri) in mm and the other geometrical object (the volume conduction model, the eelctrode positions or the source positions) in cm. Please use the headmodelplot function to check that the electrodes, volume conduction model and sources are appropriately aligned to each other. Plotting those together with the MRI is difficult, but you can look at the positions as numbers and check that those are epressed in mm. best regards Robert On 13 Dec 2008, at 0:56, Massih Hamidi wrote: > I am running the "localizing oscillatory sources using beamformer > techniques" tutorial on my EEG data (imported from EEGlab) using the > mnc t1 > template MRI (as described in the "Create BEM headmodel for EEG" > tutorial). > > However, I get an error when running sourceinterpolate (?? Attempted > to > access sel(1); index out of bounds because numel(sel)=0.) > When I plotted the output of sourceanalysis (without the anatomical > mri), I > get a strange pattern (attached). > > I then tried to run prepare_leadfield with cfg.mri (create the > dipole grid > based on segmented mri) and I was able to successfully run > sourceanalysis > and sourceitnerpolate, but the map of power estimates look nothing > like what > is shown in the tutorial (also attached). > > Plotting the data and time-frequency analysis results seem fine, so > I don't > think it's an import or freqanalysis problem. Any ideas on what's > wrong? > Thanks. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marco.sperduti at UPMC.FR Mon Dec 15 11:42:06 2008 From: marco.sperduti at UPMC.FR (Marco SPERDUTI) Date: Mon, 15 Dec 2008 11:42:06 +0100 Subject: regions of interest for source statistics Message-ID: Dear all, I would like to define regions of interest for sources statistics. I found on the sourcestatics tutorial that i have to define these parameters: cfg.atlas = filename of the atlas cfg.roi = cell-array with labels according to the atlas cfg.avgoverroi = 'yes' or 'no' (default = 'no') cfg.hemisphere = 'left', 'right', 'both', 'combined', cfg.inputcoord = 'mni' or 'tal' what can I use as atlas? Do you have an example script for doing that? thank you all, 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/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Dec 15 13:39:22 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Dec 2008 13:39:22 +0100 Subject: problems while calculating leadfield In-Reply-To: <75FE5F2D-C449-4E04-8553-AA2266DEC889@mac.com> Message-ID: Hi Nathan Each MEG channel consists of two coils, one with a weight of +1 and the other with a weight of -1. For a synthetic 3rd order gradiometer system, also the reference coils are weighted and part of the signal picked up at the reference channels is subtracted from the normal MEG channels. That means that the reference coils also get a weight in the output of a MEG channel. For setting up the volume conduction model in case of a multi-sphere model, for each _coil_ the corresponding sphere has to be determined. For the bottom and top coil (with the +1 and -1 weight) the two spheres are the same and correspond to the sphere fitted to the scalp under that channel. In case of the 3rd order synthetic gradiometer data, the reference coils also have a (small) weight, which means that also for those coils a "local" sphere has to be identified. At the moment assigning local spheres to the reference coils is not yet supported in the code. Probably the best would be to use the local spheres for the 2 meg coils and to use a single sphere that is fitted to the complete headshape (i.e. the "single sphere") for the reference coils. It requires some work though to get the bookkeeping of all coils and all spheres correct. A better solution (and the one we use here at the FCDC) might be to use prepare_singleshell instead of prepare_localspheres. The singleshell volume conduction model also approximates the geometry with a realistic shape, but is better for the lower part of the brain. In short, there are no disadvantages(*) in the singleshell model compared to the localspheres model, but only advantages. best regards, Robert *) expect perhaps that it is computationally slightly slower, and that the localspheres can also be constructed with a polhemus measured head surface, whereas the singleshell requires a segmented anatomical MRI. On 13 Dec 2008, at 18:15, Nathan Weisz wrote: > i have a problem while performing prepare_leadfield. > the data is some old CTF data i collected ~2 years ago. i calculated > a multisphere model in fieldtrip using prepare_localspheres. this > step works (i.e. i get a vol structure that looks ok in my opinion). > however when continuing with prepare_leadfield the the program > crashes. > > here's the code: > cfg=[]; > cfg.grid.xgrid='auto'; > cfg.grid.ygrid='auto'; > cfg.grid.zgrid='auto'; > cfg.vol=vol; > cfg.channel='MEG'; > cfg.grad=dataCLeConI.grad; > cfg.inwardshift=0; > cfg.grid.resolution=1; > cfg.reducerank=2; > > lf=prepare_leadfield(cfg); > > i get this error message: > ??? Error using ==> prepare_headmodel at 301 > synthetic gradients not supported during volume conductor setup > > Error in ==> prepare_leadfield at 223 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > Error in ==> newcat_calcgrid at 52 > lf=prepare_leadfield(cfg); > > i messed around with different headmodels just to see how > prepare_leadfield behaves: > *when the headmodel is a single sphere (cfg.singlesphere='yes') > prepare_leadfield works fine > *when using the nolte headmodel (via prepare_singleshell), > prepare_leadfield does not crash, but the leadfields contain only > NaN ... is that perhaps related to the issue above? > > again, any help is greatly appreciated. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Mon Dec 15 14:25:39 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Mon, 15 Dec 2008 14:25:39 +0100 Subject: problems while calculating leadfield In-Reply-To: <8D72E95C-87AF-4873-85CE-79BF2690562F@fcdonders.ru.nl> Message-ID: hi robert, thanks for your help. i tried the singleshell option, but calculating the leadfield still makes problems. here some code: cfg=[]; %cfg.grad=dataCLeConI.grad; %cfg.grad.pnt=dataCLeConI.grad.pnt; cfg.headshape=hs; %hs nx3 in cm vol=prepare_singleshell(cfg); This seems to work fine: K>> vol vol = bnd: [1x1 struct] type: 'nolte' K>> vol.bnd.pnt(1:3,:) ans = -3.2750 -4.6410 -0.8710 -3.2750 -4.6410 -0.8710 -0.8710 -5.8870 -0.9760 K>> vol.bnd.tri(1:3,:) ans = 935 843 936 912 1007 911 1803 1802 1692 However when I attempt to calculate the leadfield: cfg=[]; cfg.grid.xgrid=[-20:1:20]; cfg.grid.ygrid=[-20:1:20]; cfg.grid.zgrid=[0:1:20]; cfg.vol=vol; cfg.channel={'MEG'}; cfg.grad=dataCLeConI.grad; cfg.reducerank=2; lf=prepare_leadfield(cfg); I get following error: using headmodel specified in the configuration using gradiometers specified in the configuration computing surface normals Warning: Divide by zero. > In normals at 60 In prepare_headmodel at 323 In prepare_leadfield at 223 In newcat_calcgrid at 39 Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In meg_ini>getcoeffs at 94 In meg_ini at 36 In prepare_headmodel at 329 In prepare_leadfield at 223 In newcat_calcgrid at 39 creating dipole grid based on user specified 3D grid 2256 dipoles inside, 33045 dipoles outside brain computing leadfield computing leadfield 1/2256 ??? Error using ==> svd Input to SVD must not contain NaN or Inf. Error in ==> compute_leadfield at 484 [u, s, v] = svd(lf); Error in ==> prepare_leadfield at 242 grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize, 'normalizeparam', cfg.normalizeparam); Is there something special in the function call I have to consider when calculating leadfields using singleshell? Cheers, nathan On 15.12.2008, at 13:39, Robert Oostenveld wrote: > Hi Nathan > > Each MEG channel consists of two coils, one with a weight of +1 and > the other with a weight of -1. For a synthetic 3rd order gradiometer > system, also the reference coils are weighted and part of the signal > picked up at the reference channels is subtracted from the normal > MEG channels. That means that the reference coils also get a weight > in the output of a MEG channel. > > For setting up the volume conduction model in case of a multi-sphere > model, for each _coil_ the corresponding sphere has to be > determined. For the bottom and top coil (with the +1 and -1 weight) > the two spheres are the same and correspond to the sphere fitted to > the scalp under that channel. In case of the 3rd order synthetic > gradiometer data, the reference coils also have a (small) weight, > which means that also for those coils a "local" sphere has to be > identified. At the moment assigning local spheres to the reference > coils is not yet supported in the code. > > Probably the best would be to use the local spheres for the 2 meg > coils and to use a single sphere that is fitted to the complete > headshape (i.e. the "single sphere") for the reference coils. It > requires some work though to get the bookkeeping of all coils and > all spheres correct. > > A better solution (and the one we use here at the FCDC) might be to > use prepare_singleshell instead of prepare_localspheres. The > singleshell volume conduction model also approximates the geometry > with a realistic shape, but is better for the lower part of the > brain. In short, there are no disadvantages(*) in the singleshell > model compared to the localspheres model, but only advantages. > > best regards, > Robert > > *) expect perhaps that it is computationally slightly slower, and > that the localspheres can also be constructed with a polhemus > measured head surface, whereas the singleshell requires a segmented > anatomical MRI. > > > > On 13 Dec 2008, at 18:15, Nathan Weisz wrote: > >> i have a problem while performing prepare_leadfield. >> the data is some old CTF data i collected ~2 years ago. i >> calculated a multisphere model in fieldtrip using >> prepare_localspheres. this step works (i.e. i get a vol structure >> that looks ok in my opinion). however when continuing with >> prepare_leadfield the the program crashes. >> >> here's the code: >> cfg=[]; >> cfg.grid.xgrid='auto'; >> cfg.grid.ygrid='auto'; >> cfg.grid.zgrid='auto'; >> cfg.vol=vol; >> cfg.channel='MEG'; >> cfg.grad=dataCLeConI.grad; >> cfg.inwardshift=0; >> cfg.grid.resolution=1; >> cfg.reducerank=2; >> >> lf=prepare_leadfield(cfg); >> >> i get this error message: >> ??? Error using ==> prepare_headmodel at 301 >> synthetic gradients not supported during volume conductor setup >> >> Error in ==> prepare_leadfield at 223 >> [vol, sens, cfg] = prepare_headmodel(cfg, data); >> >> Error in ==> newcat_calcgrid at 52 >> lf=prepare_leadfield(cfg); >> >> i messed around with different headmodels just to see how >> prepare_leadfield behaves: >> *when the headmodel is a single sphere (cfg.singlesphere='yes') >> prepare_leadfield works fine >> *when using the nolte headmodel (via prepare_singleshell), >> prepare_leadfield does not crash, but the leadfields contain only >> NaN ... is that perhaps related to the issue above? >> >> again, any help is greatly appreciated. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Dec 15 15:51:19 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Dec 2008 15:51:19 +0100 Subject: scaling plexon *.nex data changed Message-ID: Dear plexon nex users I have modified the scaling of the data from plexon nex files in the corresponding low-level functions by a factor of 1000x. It turned out that this data was scaled as milivolt/mV, whereas for allmost all other formats fieldtrip uses microvolt/uV scaling for the data. To ensure consistency, I have changed the scaling for reading and writing plexon nex files to now also use microvolts. Please be aware of this when you compare computations done with different versions of fieldtrip, and when interpreting your figures. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marco.sperduti at UPMC.FR Mon Dec 15 18:33:03 2008 From: marco.sperduti at UPMC.FR (Marco SPERDUTI) Date: Mon, 15 Dec 2008 18:33:03 +0100 Subject: regions of interest for source statistics 2 Message-ID: Hi all, i'm trying to define ROI for sourcestatistic using wfu_pickatlas (i've also tried with AFNI) but i always have this error: ??? Error using ==> read_fcdc_mri unrecognized filetype of 'wfu_pickatlas' Error in ==> atlas_init at 536 atlas = read_fcdc_mri(filename); % /home/... works, ~/.... does not work Error in ==> statistics_wrapper at 217 atlas = atlas_init(cfg.atlas); Error in ==> sourcestatistics at 152 stat = statistics_wrapper(cfg, varargin{:}); that's my code: cfg.atlas = 'wfu_pickatlas'; cfg.roi = {'Inferior Parietal Lobule' ; 'Superior Temporal Gyrus'}; cfg.hemisphere = 'both'; cfg.inputcoord = 'mni'; any idea? thank you, 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/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Dec 16 22:23:46 2008 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 16 Dec 2008 22:23:46 +0100 Subject: regions of interest for source statistics In-Reply-To: <20081215114206.hpr3cztnw4s4888k@courriel.upmc.fr> Message-ID: Dear Marco, You can use the AFNI brik file that is available from http://afni.nimh.nih.gov/afni/doc/misc/ttatlas_tlrc , or use one of the WFU atlases available from http://fmri.wfubmc.edu For cfg.atlas you then specify the whole path to the atlas for instance: cfg.atlas = /matlab/wfu_pickatlas/MNI_atlas_templates/aal_MNI_V4.img'; cfg.roi should be the name (or names) of the ROIs. You can use prepare_atlas to see the precise names of the atlas you're using. Note: The data on which you want to do sourcestatistics has to be normalized to the MNI or Talairach coordinate system. All the best, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Marco SPERDUTI Sent: Monday, December 15, 2008 11:42 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] regions of interest for source statistics Dear all, I would like to define regions of interest for sources statistics. I found on the sourcestatics tutorial that i have to define these parameters: cfg.atlas = filename of the atlas cfg.roi = cell-array with labels according to the atlas cfg.avgoverroi = 'yes' or 'no' (default = 'no') cfg.hemisphere = 'left', 'right', 'both', 'combined', cfg.inputcoord = 'mni' or 'tal' what can I use as atlas? Do you have an example script for doing that? thank you all, 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/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jackm_ustc at YAHOO.COM.CN Thu Dec 18 21:47:35 2008 From: jackm_ustc at YAHOO.COM.CN (SUBSCRIBE FIELDTRIP Jack M.) Date: Thu, 18 Dec 2008 21:47:35 +0100 Subject: Trouble in recompiling the Fieldtrip Message-ID: Hello, I met exactly the same problem as listed on the Fieldtrip wiki under the FAQ section "Matlab complains about a missing or invalid MEX file, what should I do?" So I followed the instruction on that wiki and tried to recompile the binaries. I am using an iMac (OS X 10.5.5) and Matlab2007b. When I tried mex meg_leadfield1.c , the error message said, " /Applications/MATLAB_R2007b/bin/mex: line 1025: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 1004: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 930: gcc-4.0: command not found mex: compile of 'meg_leadfield1.c' failed. ??? Error using ==> mex at 208 Unable to complete successfully. " I am a newbie. Could anyone please give me a solution? Thanks a lot! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jackm_ustc at YAHOO.COM.CN Thu Dec 18 21:55:03 2008 From: jackm_ustc at YAHOO.COM.CN (Alan Yi) Date: Fri, 19 Dec 2008 04:55:03 +0800 Subject: Trouble in recompiling the fieldtrip Message-ID: Hello, I met exactly the same problem as listed on the Fieldtrip wiki under the FAQ section "Matlab complains about a missing or invalid MEX file, what should I do?" So I followed the instruction and tried to recompile the fieldtrip binaries. However, an error message appeared: >> mex meg_leadfield1.c /Applications/MATLAB_R2007b/bin/mex: line 1025: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 1004: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 930: gcc-4.0: command not found     mex: compile of 'meg_leadfield1.c' failed. ??? Error using ==> mex at 208 Unable to complete successfully. I am a newbie. Could anyone please tell me how to do? I am using Matlab2007b on my iMac (OS X 10.5.5). Thanks a lot! ___________________________________________________________ 好玩贺卡等你发,邮箱贺卡全新上线! http://card.mail.cn.yahoo.com/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedmeltzer at YAHOO.COM Fri Dec 19 21:36:44 2008 From: jedmeltzer at YAHOO.COM (Jed Meltzer) Date: Fri, 19 Dec 2008 12:36:44 -0800 Subject: dealing with missing channels in group cluster analysis Message-ID: Hi, I'm interested in using the cluster-based randomization statistical functions in fieldtrip, on EEG data that I've already mostly processed using other software. I have power spectra from multiple conditions, already averaged within subjects, and I want to do cross-subject comparisons, i.e. a paired t-test with two conditions in each subject. I think for this I could use "timelockstatistics" and just trick the software into thinking that the input is timepoints rather than frequency components (this is from windowed fourier spectra, with no time dimension). If anyone sees any problem with that, please let me know, but otherwise I'll move on to my problem... So I'm trying to put my data into the same format as that used in the tutorial example. I have 24 subjects, 34 electrodes, and 257 frequency points, so it looks like I need to contstruct for each condition a data structure with a field like: data.individual: 24x34x257 Now, my problem is that in a few subjects there are some missing channels. Some channels in the course of the experiment are deemed unacceptably noisy and excluded from analysis. This is all kept track of in my processing schemes, but how can I deal with it here, when I need to fill in the full array? Normally I would fill in the missing space with NaN, but I'm not sure that the cluster analysis programs in field trip can deal with NaN. Maybe it wouldn't be such a big deal to change them? I've thought about doing it myself, but I'm afraid I would miss something due to unfamiliarity with the code. But it seems like functions such as statfun_depsamplesT.m (which I'm using) call matlab functions like mean() and var(), when they could easily call nanmean() and nanvar() (from the statistics toolbox) instead. One would have to check for NaN data and adjust the degrees of freedom as well. Do you think there's any hope for this? Or would you suggest a different approach? Just please don't say "interpolate the missing channels" or I will have to bang my head against the wall... -Jed Jed A. Meltzer, Ph.D. Postdoctoral Fellow, Language Section, Voice, Speech, and Language Branch National Institute on Deafness and Other Communication Disorders, National Institutes of Health 10 Center Drive, Building 10, Rm 5C410, Bethesda, MD 20892-1065 301-435-5144 meltzerj at nidcd.nih.gov ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jrkerlin at UCDAVIS.EDU Fri Dec 19 22:41:53 2008 From: jrkerlin at UCDAVIS.EDU (Jess R. Kerlin) Date: Fri, 19 Dec 2008 13:41:53 -0800 Subject: Problems with second level source statistics for multi plew subjects and firsty level stats - solved :-) In-Reply-To: <853421468@web.de> Message-ID: Dear FTrippers, I've been replicating the beamformer tutorial to the letter, and arrived at problem which may be related to the one described below. Running : stat = sourcestatistics(cfg, sourceSTAT); Gives the error: ??? Index of element to remove exceeds matrix dimensions. Error in ==> /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m (get_source_trial) On line 443 ==> dat((j-1).*dim(1) + varargin{1}.outside, :) = []; Error in ==> /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m On line 179 ==> [dat, cfg] = get_source_trial(cfg, varargin{:}); Error in ==> /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/sourcestatistics.m On line 127 ==> stat = statistics_wrapper(cfg, varargin{:}); My sourceSTAT.trial(1).pow is a 1 by 2652 double array (so the dim in get_source_trial is the same) , which may or may not be the proper dimensions for pow (sourceSTAT.dim = [17 13 12] ). If not, exactly how/where would I add the proper dim field? I've also tried running freqanalysis and sourcestatistics with a recent release (20081218), with the same results. Any advice would be greatly appreciated. Thanks, Jess Michael Wibral wrote: > Dear listusers, > > in several previous mails I have reported about problems occuring when: > > 1) doing single subjects source analysis using reverse-normalized grids (thanks to Ingrid's tutorial), common filters for the two conditions and generating single trial source data > 2) then performing single subject sourcestatistics (getting a sparse data representation with a stat field) > 3) then doing second level sourcestatistics (which didn't work) > > I am happy to report these problems are solved :-). I actually just overlooked a WARNING:... when doing single subject sourceanalysis and sourcestatistics (1st level) is says that you yourself have to add a dim field by hand, when trying to use clusterrandanalysis/sourcestatistics later. I now simply added a dim field to both, to the data and to the cfg for the second level source statistics. The correct choice for this dim field are the dimension of the original, orthogonal, regular grid in MNI space and everything works now. > > I just didn't realize that dim can't be all that easily generated automatically by fieldtrip for sparse data and *warped* grids. This is because the warping could - in principle - be such that dim doesn't make any sense anymore, e.g. because points (almost) switch places along a certain dimension (if they differ in the other coordinates). So neighborhood relations are not well defined a priori in sparse data. Hence, the need for a manual addition of dim in this case (please correct me me if any of the above is wrong). > > The version I used and that I can confirm to work was 20081208. > > Many thanks for all your support, > Michael > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jrkerlin at UCDAVIS.EDU Sat Dec 20 01:14:05 2008 From: jrkerlin at UCDAVIS.EDU (Jess R. Kerlin) Date: Fri, 19 Dec 2008 16:14:05 -0800 Subject: Problems with second level source statistics for multi plew subjects and firsty level stats - solved :-) In-Reply-To: <494C1521.6070805@ucdavis.edu> Message-ID: Regarding my previous email: I got the tutorial code to move forward by editing source_wrapper. I don't know if this is a bug or something else is wrong which will nail me later. Editing get_source_trial in source_wrapper : if isfield(varargin{1}, 'inside') fprintf('only selecting voxels inside the brain for statistics (%.1f%%)\n', 100*length(varargin{1}.inside)/prod(varargin{1}.dim)); % for j=prod(dim(2:end)):-1:1 comment out; jk % dat((j-1).*dim(1) + varargin{1}.outside, :) = []; jk dat(varargin{1}.outside, :) = 0; % replaced formula jk % end comment out; jk end Cheers, Jess Jess R. Kerlin wrote: > Dear FTrippers, > > I've been replicating the beamformer tutorial to the letter, and > arrived at problem which may be related to the one described below. > > Running : > stat = sourcestatistics(cfg, sourceSTAT); > > Gives the error: > > ??? Index of element to remove exceeds matrix dimensions. > > Error in ==> > /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m > (get_source_trial) > On line 443 ==> dat((j-1).*dim(1) + varargin{1}.outside, :) = []; > > Error in ==> > /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m > On line 179 ==> [dat, cfg] = get_source_trial(cfg, varargin{:}); > > Error in ==> > /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/sourcestatistics.m > On line 127 ==> stat = statistics_wrapper(cfg, varargin{:}); > > My sourceSTAT.trial(1).pow is a 1 by 2652 double array (so the dim in > get_source_trial is the same) , which may or may not be the proper > dimensions for pow (sourceSTAT.dim = [17 13 12] ). If not, exactly > how/where would I add the proper dim field? > > I've also tried running freqanalysis and sourcestatistics with a > recent release (20081218), with the same results. > > Any advice would be greatly appreciated. > > Thanks, > Jess > > Michael Wibral wrote: >> Dear listusers, >> >> in several previous mails I have reported about problems occuring when: >> >> 1) doing single subjects source analysis using reverse-normalized >> grids (thanks to Ingrid's tutorial), common filters for the two >> conditions and generating single trial source data 2) then performing >> single subject sourcestatistics (getting a sparse data representation >> with a stat field) >> 3) then doing second level sourcestatistics (which didn't work) >> >> I am happy to report these problems are solved :-). I actually just >> overlooked a WARNING:... when doing single subject sourceanalysis and >> sourcestatistics (1st level) is says that you yourself have to add a >> dim field by hand, when trying to use >> clusterrandanalysis/sourcestatistics later. I now simply added a dim >> field to both, to the data and to the cfg for the second level source >> statistics. The correct choice for this dim field are the dimension >> of the original, orthogonal, regular grid in MNI space and everything >> works now. >> >> I just didn't realize that dim can't be all that easily generated >> automatically by fieldtrip for sparse data and *warped* grids. This >> is because the warping could - in principle - be such that dim >> doesn't make any sense anymore, e.g. because points (almost) switch >> places along a certain dimension (if they differ in the other >> coordinates). So neighborhood relations are not well defined a priori >> in sparse data. Hence, the need for a manual addition of dim in this >> case (please correct me me if any of the above is wrong). >> >> The version I used and that I can confirm to work was 20081208. >> >> Many thanks for all your support, >> Michael >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From lmoranr at GMAIL.COM Sat Dec 27 13:35:31 2008 From: lmoranr at GMAIL.COM (=?ISO-8859-1?Q?Luis_Mor=E1n?=) Date: Sat, 27 Dec 2008 13:35:31 +0100 Subject: Problem with DipoleSimulation Message-ID: Dear collegues! I'm new on fieldtrip so I'd be very pleased if someone could help me. I have a problem while using dipolesimulation. I'm trying to make a simulation with 2 dipoles. I introduce the position as a 2-by-3 matrix, and the moment as a 3-by-2. My problem comes when the leadfield is calculated. lf is m-by-n matrix where m is the number of channels and n is 2*number of dipoles. Then, in the script this lf is multiplied by dipmom (a 3-by-Ndipoles matrix) and by dippos (a N-dipoles -by- 3). So this operation only works when we have only one dipole. Thanks in advance -- Luis Morán Rodríguez Altentic lmoran at altentic.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/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Mon Dec 29 10:36:50 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 29 Dec 2008 09:36:50 +0000 Subject: Problem with DipoleSimulation Message-ID: > From: jan-mathijs schoffelen > Date: December 29, 2008 9:22:40 AM BST > To: FieldTrip discussion list > Subject: Re: [FIELDTRIP] Problem with DipoleSimulation > > > Dear Luis, > > The trick is to define the moment-matrix as 6-by-2, i.e. nx3-by-n. > It should look like this: > > [Mx 0 > My 0 > Mz 0 > 0 Mx2 > 0 My2 > 0 Mz2] > > In this case the matrix-multiplication should work out fine. > > Best, > > Jan-Mathijs > > > On Dec 27, 2008, at 12:35 PM, Luis Morán wrote: > >> Dear collegues! >> >> I'm new on fieldtrip so I'd be very pleased if someone could help me. >> >> I have a problem while using dipolesimulation. I'm trying to make >> a simulation with 2 dipoles. I introduce the position as a 2-by-3 >> matrix, and the moment as a 3-by-2. >> >> My problem comes when the leadfield is calculated. lf is m-by-n >> matrix where m is the number of channels and n is 2*number of >> dipoles. Then, in the script this lf is multiplied by dipmom (a 3- >> by-Ndipoles matrix) and by dippos (a N-dipoles -by- 3). So this >> operation only works when we have only one dipole. >> >> Thanks in advance >> >> -- >> Luis Morán Rodríguez >> >> Altentic >> >> lmoran at altentic.com >> ---------------------------------- >> >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. >> >> http://listserv.surfnet.nl/archives/fieldtrip.html >> >> http://www.ru.nl/fcdonders/fieldtrip/ >> > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wibral at BIC.UNI-FRANKFURT.DE Tue Dec 30 15:49:31 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Tue, 30 Dec 2008 15:49:31 +0100 Subject: Job Offer in Frankfurt / Germany Message-ID: Dear colleagues, please find attached below an offer for a position in EEG analysis in Frankfurt/Germany: The research center IDeA (Individual Development and Adaptive Education) in collaboration with the Brain Imaging Center Frankfurt (BIC) offers a position with focus on analysis of EEG data collected longitudinally from children at the age of 6 - 12 years. These data should be combined with fMRI as well as DTI data collected from the same participants. Candidates should have a solid expertise in EEG data analysis. Experience in one or more relevant domains will be considered an advantage: - source analysis - connectivity analysis - time-frequency analysis - combination of EEG and fMRI/DTI data - programming skills (Matlab, C++) The contract will run until June 2011 (renewable). Salary (BAT IIa or BAT IIa/2) depends on qualification and years of working experience. Qualified scientists are encouraged to apply by submitting a motivation letter and a CV to Prof. Dr. Marcus Hasselhorn - Scientific Coordinator IDeA Schloßstraße 29 60486 Frankfurt am Main Phone: +49 69 24708 214 Fax: +49 69 24708 216 Email : hasselhorndipf.de as well as to: Michael Wibral, PhD - Lab Manager MEG Unit Core Structure Brain Imaging Center Frankfurt J.W. Goethe University Heinrich Hoffmann Strasse 10 60528 Frankfurt am Main Phone: +49 69 6301 83193 +49 69 6301 83192 Fax: +49 69 6301 83231 email: wibralbic.uni-frankfurt.de ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From susannah.murphy at PSYCH.OX.AC.UK Tue Dec 30 15:49:59 2008 From: susannah.murphy at PSYCH.OX.AC.UK (Susannah Murphy) Date: Tue, 30 Dec 2008 14:49:59 +0000 Subject: Job Offer in Frankfurt / Germany In-Reply-To: <866243563@web.de> Message-ID: Thanks for your message. I am away until Monday 12th January. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From shehsu at INDIANA.EDU Mon Dec 1 11:29:09 2008 From: shehsu at INDIANA.EDU (Hsu, Shen-Mou) Date: Mon, 1 Dec 2008 05:29:09 -0500 Subject: freqgrandaverage-no averaging performed Message-ID: Dear users, The following message was returned when I executed the freqgrandaverage: "not computing grand average, but keeping individual power for 15 subjects Warning: discarding electrode information because it cannot be averaged". I was wondering if someone may shed some light on this issue. Big thanks in advance. Shen-Mou Hsu MY SCRIPT: j = 1; for sub = [1 2 3 6 7 8 9 10 12 13 14 16 17 18 19] load (['Sub',num2str(sub),'_ERSP_N_fieldtrip_',num2str(i)]); ERSPall(j) = TFRwave; j= j+1; end cfg = []; cfg.keepindividual = 'yes'; ERSP_N_LV = freqgrandaverage(cfg, ERSPall(1), ERSPall(2),ERSPall(3),... ERSPall(4), ERSPall(5), ERSPall(6),ERSPall(7),ERSPall(8),... ERSPall(9),ERSPall(10),ERSPall(11),ERSPall(12),ERSPall(13),... ERSPall(14),ERSPall(15)); save('ERSP_N_LV','ERSP_N_LV'); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Dec 1 14:20:57 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 1 Dec 2008 14:20:57 +0100 Subject: coordinates In-Reply-To: <20081128143502.d7ybij6e0cggc484@courriel.upmc.fr> Message-ID: On 28 Nov 2008, at 14:35, Marco SPERDUTI wrote: > hallo, > > i would like to know it is possible, once i've made the source > reconstruction, to have a text file with the coordinates of the > sources. after using the "sourceanalysis" function the source positions are stored in source.pos as Nx3 matrix with [x y z]. best regards Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From bleichner.martin at GMAIL.COM Mon Dec 1 14:47:42 2008 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Mon, 1 Dec 2008 14:47:42 +0100 Subject: Different results using multitapers and wavelet Message-ID: hi there, I am using multitapers as well as wavelets to compute my time frequency spectrum of ECoG data (50Hz-90Hz). Recently I realized some discrepancy using these two methods, until than I found that these to method lead to comparable results. In one of our datasets we found very large differences between the two methods. When I looked closer at the problem I found out that the two methods lead to similar results when the effect (increase in power) is large, while they deviate quite a bit when the effect is small. In that case i get a kind of 'checkerboard' like time frequency spectrum for the mutlitapers. I also compared the output of the frequency analysis with the bandpassed raw signal and found that the wavelet transform was the better match. A re there any prerequisites for multitaper use? Does anybody has some experience with this effect? Do I do something wrong? Below you can find the cfg settings I am using Multitaper cfg.output ='pow' cfg.method='mtmconvol' cfg.tapers='dpss' cfg.toi=[-0.5:0.01:2.5] cfg.foi=[55:2:95] cfg.t_ftimwin=ones(size(cfg.foi))*0.2; cfg.tapsmofrq=ones(size(cfg.foi))*15; Wavelet cfg.method='wltconvol'; cfg.width=7; cfg.foi=[55:2:95] cfg.toi=[-0.5:0.01:2.5] Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingrid.nieuwenhuis at FCDONDERS.RU.NL Mon Dec 1 15:51:00 2008 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Mon, 1 Dec 2008 15:51:00 +0100 Subject: Different results using multitapers and wavelet In-Reply-To: Message-ID: Hi Martin, If you use multitapers (or any frequency analysis) you have to take care that you have an integer amount of cycles in your timewindow. Since you use a fixed timewindow of 0.2 seconds, your frequency steps should be a multiple of 5, so cfg.foi should be 55:5:95 or either you should use a cfg.timwin which is dependent on the cfg.foi (fi 7 cycles, just as in your wavelets). See the tutorial on the FieldTrip website for more explanation. (fieldtrip > documentation > tutorial >Time-frequency Analysis Using Multitapers and Wavelets) Best Ingrid _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Martin Bleichner Sent: Monday, December 01, 2008 2:48 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] Different results using multitapers and wavelet hi there, I am using multitapers as well as wavelets to compute my time frequency spectrum of ECoG data (50Hz-90Hz). Recently I realized some discrepancy using these two methods, until than I found that these to method lead to comparable results. In one of our datasets we found very large differences between the two methods. When I looked closer at the problem I found out that the two methods lead to similar results when the effect (increase in power) is large, while they deviate quite a bit when the effect is small. In that case i get a kind of 'checkerboard' like time frequency spectrum for the mutlitapers. I also compared the output of the frequency analysis with the bandpassed raw signal and found that the wavelet transform was the better match. A re there any prerequisites for multitaper use? Does anybody has some experience with this effect? Do I do something wrong? Below you can find the cfg settings I am using Multitaper cfg.output ='pow' cfg.method='mtmconvol' cfg.tapers='dpss' cfg.toi=[-0.5:0.01:2.5] cfg.foi=[55:2:95] cfg.t_ftimwin=ones(size(cfg.foi))*0.2; cfg.tapsmofrq=ones(size(cfg.foi))*15; Wavelet cfg.method='wltconvol'; cfg.width=7; cfg.foi=[55:2:95] cfg.toi=[-0.5:0.01:2.5] Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From saskia.haegens at DONDERS.RU.NL Mon Dec 1 15:53:09 2008 From: saskia.haegens at DONDERS.RU.NL (Saskia Haegens) Date: Mon, 1 Dec 2008 15:53:09 +0100 Subject: freqgrandaverage-no averaging performed In-Reply-To: <7F00B6A0D4D0674E80A6C1D6DA873B5701E4AC782B@iu-mssg-mbx05.ads.iu.edu> Message-ID: If you want to calculate the average over subjects, use cfg.keepindividual = 'no'; If you want to keep the individual data (e.g. for doing statistics) use cfg.keepindividual = 'yes'; Best, Saskia > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Hsu, Shen-Mou > Sent: 01 December 2008 11:29 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] freqgrandaverage-no averaging performed > > Dear users, > > The following message was returned when I executed the freqgrandaverage: > "not computing grand average, but keeping individual power for 15 subjects > Warning: discarding electrode information because it cannot be averaged". > > I was wondering if someone may shed some light on this issue. > > Big thanks in advance. > > Shen-Mou Hsu > > MY SCRIPT: > > j = 1; > > for sub = [1 2 3 6 7 8 9 10 12 13 14 16 17 18 19] > load (['Sub',num2str(sub),'_ERSP_N_fieldtrip_',num2str(i)]); > > ERSPall(j) = TFRwave; > j= j+1; > end > > > > cfg = []; > cfg.keepindividual = 'yes'; > > ERSP_N_LV = freqgrandaverage(cfg, ERSPall(1), ERSPall(2),ERSPall(3),... > ERSPall(4), ERSPall(5), ERSPall(6),ERSPall(7),ERSPall(8),... > ERSPall(9),ERSPall(10),ERSPall(11),ERSPall(12),ERSPall(13),... > ERSPall(14),ERSPall(15)); > > > save('ERSP_N_LV','ERSP_N_LV'); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From bleichner.martin at GMAIL.COM Mon Dec 1 16:17:40 2008 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Mon, 1 Dec 2008 16:17:40 +0100 Subject: Different results using multitapers and wavelet In-Reply-To: <001501c953c4$39f6f0b0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid, thanks for the tip, but it does not solve the problem. I tried now the method that I am normally using for the low frequencies (hanning) for my high frequency range and get results comparable to the wavelet. See below. Any other suggestions? best Martin cfg.output ='pow' cfg.method='mtmconvol' cfg.tapers='hanning' cfg.toi=[-0.5:0.01:2.5] cfg.foi=[55:2:95] cfg.t_ftimwin=4./cfgLow.foi 2008/12/1 Ingrid Nieuwenhuis > Hi Martin, > > > > If you use multitapers (or any frequency analysis) you have to take care > that you have an integer amount of cycles in your timewindow. Since you use > a fixed timewindow of 0.2 seconds, your frequency steps should be a multiple > of 5, so cfg.foi should be 55:5:95 or either you should use a cfg.timwin > which is dependent on the cfg.foi (fi 7 cycles, just as in your wavelets). > See the tutorial on the FieldTrip website for more explanation. (fieldtrip » > documentation » tutorial »Time-frequency Analysis Using Multitapers and > Wavelets) > > > > Best Ingrid > ------------------------------ > > *From:* FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] *On > Behalf Of *Martin Bleichner > *Sent:* Monday, December 01, 2008 2:48 PM > *To:* FIELDTRIP at NIC.SURFNET.NL > *Subject:* [FIELDTRIP] Different results using multitapers and wavelet > > > > hi there, > > I am using multitapers as well as wavelets to compute my time frequency > spectrum of ECoG data (50Hz-90Hz). Recently I realized some discrepancy > using these two methods, until than I found that these to method lead to > comparable results. > > In one of our datasets we found very large differences between the two > methods. When I looked closer at the problem I found out that the two > methods lead to similar results when the effect (increase in power) is > large, while they deviate quite a bit when the effect is small. > In that case i get a kind of 'checkerboard' like time frequency spectrum > for the mutlitapers. > I also compared the output of the frequency analysis with the bandpassed > raw signal and found that the wavelet transform was the better match. A > > re there any prerequisites for multitaper use? Does anybody has some > experience with this effect? Do I do something wrong? > Below you can find the cfg settings I am using > > Multitaper > cfg.output ='pow' > cfg.method='mtmconvol' > cfg.tapers='dpss' > cfg.toi=[-0.5:0.01:2.5] > cfg.foi=[55:2:95] > cfg.t_ftimwin=ones(size(cfg.foi))*0.2; > cfg.tapsmofrq=ones(size(cfg.foi))*15; > > > Wavelet > cfg.method='wltconvol'; > cfg.width=7; > cfg.foi=[55:2:95] > cfg.toi=[-0.5:0.01:2.5] > > Thanks > > Martin > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredericroux at HOTMAIL.DE Wed Dec 3 23:23:45 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Wed, 3 Dec 2008 23:23:45 +0100 Subject: error using denoise_synthetic Message-ID: Hi, I'm getting an error message related to the number of channels when using the denoise_synthetic function. I use the following code: cfg = []; cfg.channel = {'all', 'EEG'}; etc. etc. etc. cfg.gradient = 'G3BR'; cfg.trial = 'all'; data = preprocessing(cfg); data = denoise_synthetic(cfg,data); The error message states that not all channels required for the montage are in the data set. Now, before I used denoise_synthetic my script was perfectly running and the data looked ok. Can anyone tell me what may be the issue here? Thank you in advance for any kind of suggestion, Frederic _________________________________________________________________ Wer erfand den Glückskeks? Kleiner Tipp: Die Chinesen waren es nicht! - Mehr auf msn.de http://redirect.gimas.net/?n=M0812xMSNDE ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bleichner.martin at GMAIL.COM Thu Dec 4 13:40:13 2008 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Thu, 4 Dec 2008 13:40:13 +0100 Subject: multiplotER for averaged time frequency data Message-ID: Hi there, I am trying to get a multiplotER() kind of plot for time frequency data, averaged over a specific frequency range. I.e. I compute a time frequency spectrum average over the gamma band and want to plot the resulting traces for all electrodes. However, mutliplotER() refuses to accept time frequency data. I managed to trick it into accepting it but wondered whether there is a cleaner possibility to plot this kind of data. Thanks best Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhamidi at WISC.EDU Fri Dec 5 20:18:35 2008 From: mhamidi at WISC.EDU (Massih Hamidi) Date: Fri, 5 Dec 2008 20:18:35 +0100 Subject: Creating BEM headmodel for EEG Message-ID: I am trying to create a BEM model using the Create BEM headmodel for EEG script. Everything works well until the prepare_bemmodel command. When using the dipoli executable script, I receive an error that says I have duplicate vertices (and looking at vol.bnd.pnt, it looks like I do have a few vertices with the same coordinates). I have also tried using the "brainstorm" option for calculating the bem model, but although it runs without error, the script ends with a keyboard command and no system matrix is added to the vol variable. I am pretty new at this (so forgive me if I'm missing something simple). Thanks. Massih Hamidi ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From A.Stolk at EWI.UTWENTE.NL Tue Dec 9 11:26:22 2008 From: A.Stolk at EWI.UTWENTE.NL (A. Stolk) Date: Tue, 9 Dec 2008 11:26:22 +0100 Subject: volumesegment in BEM model Message-ID: Hi there, Using the example script 'create bemmodel for eeg', I keep struggling with the volumesegment part. mri = read_fcdc_mri('t1_icbm_normal_1mm_pn0_rf0.mnc'); cfg = []; seg = volumesegment(cfg, mri); And when I add commands like, cfg.write = 'no'; cfg.coordinates = 'spm'; cfg.template = '\fieldtrip-20081015\spm5\templates\T1.mnc'; I receive the same errors related to the file's dimensions, namely; ??? Error using ==> spm_slice_vol Wrong sized dim. Error in ==> spm_read_vols at 35 Y(:,:,p,i) = spm_slice_vol(V(i),spm_matrix([0 0 p]),V(i).dim(1:2),0); Error in ==> read_fcdc_mri at 107 img = spm_read_vols(hdr); Error in ==> bemmodelfieldtrip at 14 mri = read_fcdc_mri('t1_icbm_normal_1mm_pn0_rf0.mnc'); I got this error using multiple fieldtrip versions. p.s. Also did have to add the spm_slice_vol.mexw32 file, found in the spm2 update. Regards, Arjen ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Tue Dec 9 15:54:27 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Tue, 9 Dec 2008 15:54:27 +0100 Subject: Problem running source grand average a nd source statistics Message-ID: Hi Jan-Matthijs, hi Ingrid, dear listusers thanks for your help with the problem of sparsified data. I have meanwhile managed to "fix" sourcegrandaverage simply by telling it to use something like Nvoxel = length(dataset.stat) (dirty hack I know...). But it seems that sourcestatistics isn't fooled that easily and I am getting a bit lost moving from subfunction to subfunction. And I was just wondering whether working with sparse data and reverse transformed, irregular grids in sourcestatistics is something anyone else is still doing (we'd like to keep on doing it to have corresponding virtual electrodes over subjects). ... and whether my problems are possibly related to the fact that I am trying to use the 'stat' field instead of the 'pow' field in sourcestatistics. In version 20081203 and 20081208 there is also again a bug that makes sourcestatistics complain about a missing dim field.: ?? Reference to non-existent field 'dim'. Error in ==> fieldtrip-20081208/private/statistics_wrapper>get_source_trial at 621 fprintf('only selecting voxels inside the brain for statistics (%.1f%%)\n', 100*length(varargin{1}.inside)/prod(varargin{1}.dim)); Error in ==> fieldtrip-20081208/private/statistics_wrapper at 290 [dat, cfg] = get_source_trial(cfg, varargin{:}); Error in ==> sourcestatistics at 155 stat = statistics_wrapper(cfg, varargin{:}); Error in ==> NewDICSAnalysis200809_01 at 559 SourceStat = sourcestatistics(cfg,RawSources ); My code is still the same as posted below, the section it complains about now used to run smoothly with the November versions. It seems as if the dim field is not being added when using the reverse transformed grid from the tutorial. Any help appreciated Michael > -----Ursprüngliche Nachricht----- > Von: "jan-mathijs schoffelen" > Gesendet: 05.11.08 15:36:05 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Problem running source grand average a nd source statistics > Hi Michael, > > > stat: [3297x1 double] > > This indicates that your singlesubjects are indeed sparsified, so > that when you getsubfield this guy, you end up with fewer data-points > than expected (which is Nvoxel==prod(dim)). > > Does this give you enough guidelines to fix it? > > JM > > > On Nov 5, 2008, at 1:50 PM, Michael Wibral wrote: > > > Dear Ingrid, dear Jan-Mathijs > > > > I guess Ingrid is indeed correct, as all my datasets have the same > > dimension of the stat field and of the inside/outside fields. I was > > actually also supplying the dim field from the template to all > > datasets, so the product of dims' should be the same everywhere, > > but that hasn't really solved the problem. The length of the inside > > field is 3297, the outside field is 3129, their sum is 6426 which > > is identical to the product of dimensions of the template grid > > which are 17 x 21 x 18 =6426. So I am really a bit puzzled here... > > > > Anyway, here's the code I use, maybe someone a really stupid error, > > that I simply overlooked: > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % FIRST I prepare a file with the data and the settings for the > > statistics that is later read in again: > > % datapath = '/data/home1/ctillman/data/MooneyMEEGFieldtripAnalysis/ > > DICSBeamformingMW200808/Stats/'; > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > DesignData1 = { > > 'ABA04_Up_StatSources.mat' > > 'IFS20_Up_StatSources.mat'; > > 'IKE28_Up_StatSources.mat'; > > 'JHA07_Up_StatSources.mat'; > > 'JPA05_Up_StatSources.mat'; > > 'MKA21_Up_StatSources.mat'; > > 'MMA07_Up_StatSources.mat'; > > 'PSS16_Up_StatSources.mat'; > > 'SNI05_Up_StatSources.mat'; > > 'UWA31_Up_StatSources.mat'; > > > > }; > > > > DesignData2 = { > > 'ABA04_In_StatSources.mat'; > > 'IFS20_In_StatSources.mat'; > > 'IKE28_In_StatSources.mat'; > > 'JHA07_In_StatSources.mat'; > > 'JPA05_In_StatSources.mat'; > > 'MKA21_In_StatSources.mat'; > > 'MMA07_In_StatSources.mat'; > > 'PSS16_In_StatSources.mat'; > > 'SNI05_In_StatSources.mat'; > > 'UWA31_In_StatSources.mat'; > > > > }; > > > > % The statistics configuration > > cfg = []; > > nSubjects = min(length(DesignData1),length(DesignData2)); > > a = [1:nSubjects]; > > b = ones(1,nSubjects); > > cfg.design = [a a; b (2*b)]; > > cfg.ivar = 2; % independent variable: condition > > cfg.uvar = 1; % subjects > > cfg.method = 'montecarlo'; > > cfg.correctm = 'cluster'; > > cfg.clusteralpha = 0.01; > > cfg.alpha = 0.05; > > cfg.clusterstatistic = 'maxsum'; > > cfg.numrandomization = 500; %2000; > > cfg.threshold = 0.01; > > cfg.parameter = 'stat'; > > cfg.statistic = 'depsamplesT'; > > > > % create output file > > OutFileName = strcat(datapath,'DesignStat2008_11_04.mat'); > > save(OutFileName, 'DesignData1', 'DesignData2', 'cfg', 'datapath'); > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % SECOND I read in this file and the template and try to perform > > grandaveraging and sourcestatistics at the second level: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > function [] = StatisticsDICS(DesignStatLCMVFile); > > > > > > template = load('/data/home1/ctillman/data/ > > MooneyMEEGFieldtripAnalysis/DICSBeamformingMW200808/Grids/ > > MNItemplate_231008_-1p5iws.mat'); > > Nx = length(template.template_grid.xgrid) > > Ny = length(template.template_grid.ygrid) > > Nz = length(template.template_grid.zgrid) > > > > load(DesignStatLCMVFile); % contains datapath, DesignData1, > > DesignData2, cfg > > > > % Load Data from DesignData1,2 automatically ensuring matching sizes > > % please ensure that data pairs are OK if using paired statistics ! > > > > > > for i = 1:min(length(DesignData1),length(DesignData2)) > > m=strcat('loading dataset#:', num2str(2*i-1)); > > disp(m); > > fullname1 = strcat(datapath,DesignData1{i,1}); > > Data1{i} = load(fullname1); > > m=strcat('loading dataset#:', num2str(2*i)); > > disp(m); > > fullname2 = strcat(datapath,DesignData2{i,1}); > > Data2{i} = load(fullname2); > > end > > > > % Fixing the structure properties > > > > for l = 1:size(Data1,2) > > > > Data1{l}.SourceStat.xgrid = template.template_grid.xgrid; > > Data1{l}.SourceStat.ygrid = template.template_grid.ygrid; > > Data1{l}.SourceStat.zgrid = template.template_grid.zgrid; > > Data1{l}.SourceStat.dim = [Nx Ny Nz]; > > Data1{l}.SourceStat.pos = template.template_grid.pos; > > Data1{l}.SourceStat.inside = template.template_grid.inside; > > Data1{l}.SourceStat.outside = template.template_grid.outside; > > Data1{l} = Data1{l}.SourceStat; > > > > > > Data2{l}.SourceStat.xgrid = template.template_grid.xgrid; > > Data2{l}.SourceStat.ygrid = template.template_grid.ygrid; > > Data2{l}.SourceStat.zgrid = template.template_grid.zgrid; > > Data2{l}.SourceStat.dim = [Nx Ny Nz]; > > Data2{l}.SourceStat.pos = template.template_grid.pos; > > Data2{l}.SourceStat.inside = template.template_grid.inside; > > Data2{l}.SourceStat.outside = template.template_grid.outside; > > Data2{l} = Data2{l}.SourceStat; > > > > end > > > > % prepare the statistics by computing the grandaverage with individual > > % subject data retained > > % Compute grand average for Condition 1 and 2 > > cfgGA = []; > > cfgGA.keepindividual = 'yes'; > > cfgGA.parameter='stat'; > > % create command strings for the computaion: > > commandstr1 = strcat ('DataGA1', '=sourcegrandaverage(cfgGA'); > > commandstr2 = strcat ('DataGA2', '=sourcegrandaverage(cfgGA'); > > > > for l = 1 : length(Data1) > > commandstr1 = strcat(commandstr1, ',Data1{', num2str(l) , '}'); > > commandstr2 = strcat(commandstr2, ',Data2{', num2str(l) , '}'); > > end > > % finalize command strings > > commandstr1=strcat(commandstr1,');') > > commandstr2=strcat(commandstr2,');') > > eval(commandstr1) % yields DataGA1; > > eval(commandstr2) % yields DataGA2; > > > > clear Data1; clear Data2; % no longer needed we now have DataGA1,2 > > > > %SourceStatsitics cfg is known from the design file! > > sourceStat = sourcestatistics(cfg, DataGA1, DataGA2); > > OutFilename = ... > > strcat(datapath, > > 'SourceStatisticsLCMV_denoisedDataAndNewGrids_1000rand_',DesignData1 > > {i,1}(7:end-4),'_calpha',num2str(cfg.clusteralpha), > > '_alpha_',num2str(cfg.alpha),'.mat'); > > save(OutFilename, 'sourceStat'); > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > %%%%%%%%%%%%%%%%%%% > > > > > > Here's the inforamtion from the datasets and the template: > > > > Information of a dataset after processing/preparing for > > sourcegrandaverage: > > > > > > stat: [3297x1 double] > > df: 134 > > critval: [-1.9778 1.9778] > > prob: [3297x1 double] > > mask: [3297x1 logical] > > dim: [17 21 18] > > inside: [1x3297 double] > > outside: [1x3129 double] > > pos: [6426x3 double] > > cfg: [1x1 struct] > > xgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 > > 70 80] > > ygrid: [-120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 > > 10 20 30 40 50 60 70 80] > > zgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 > > 70 80 90] > > > > Information of the template: > > xgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80] > > ygrid: [-120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 > > 10 20 30 40 50 60 70 80] > > zgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 > > 70 80 90] > > dim: [17 21 18] > > pos: [6426x3 double] > > inside: [1x3297 double] > > outside: [1x3129 double] > > > > The onlz thing that I see varying fron dataset to dataset is the df > > field. > > > > Any help appreciated, > > Michael > > > > > >> -----Ursprüngliche Nachricht----- > >> Von: "Ingrid Nieuwenhuis" > >> Gesendet: 05.11.08 14:02:04 > >> An: FIELDTRIP at NIC.SURFNET.NL > >> Betreff: Re: [FIELDTRIP] Problem running source grand average and > >> source statistics > > > > > >> Dear Michael and Jan-Mathijs, > >> > >> If the same procedure is followed as on the wiki, the inside of > >> the template > >> grid is copied to the single subjects, so by definition also the > >> 'sparsified' single subjects sources should all have the same > >> amount of > >> (inside) voxels. So point 2 J-M raised can't be it, point 1 could > >> well be: > >> Because in line 115 dat's size is defined as (Nvoxels, Nsubj) and > >> Nvoxels is > >> the product of the dim. > >> > >> Best Ingrid > >> > >> -----Original Message----- > >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > >> On Behalf > >> Of jan-mathijs schoffelen > >> Sent: Wednesday, November 05, 2008 10:20 AM > >> To: FIELDTRIP at NIC.SURFNET.NL > >> Subject: Re: [FIELDTRIP] Problem running source grand average and > >> source > >> statistics > >> > >> Dear Michael, > >> > >> I agree with you that a likely cause is that the Nvoxel (which is > >> based on the dimensionality of the first singlesubject-source in the > >> input) varies across subjects. However, this would be strange, > >> because you use the same dipole grid for all subjects. On the other > >> hand: could it be that you 'sparsified' the single subjects? Each > >> subject could have a slightly different number of 'inside' positions. > >> This obviously leads to problems: > >> 1 because the Nvoxel is incorrect in the first place (it's the > >> product of the dim, so the input is assumed to be full 3D, or a > >> linear array with all outside voxels present (either as nans or zeros > >> or whichever number you fancy). > >> 2 because the length of the array per subject varies. > >> > >> Hope this helps, > >> > >> Jan-M > >> > >> > >> > >> On Nov 4, 2008, at 5:35 PM, Michael Wibral wrote: > >> > >>> Dear list users, > >>> > >>> I am having a problem running, source grandaverage and source > >>> statistics (over multiple subjects) on the output of > >>> soucrestatistictics (from multiple trials in single subjects). > >>> > >>> I ran first sourceanalysis supplying the backwads warped grids (as > >>> described in the wiki) to compute filters. Then I ran source > >>> analysis again to extract the single trial source images and the > >>> ran sourcestatistitics on this to get the single subject > >>> statistical images - all this runs fine. I then supply the pos (and > >>> dim) data of the template grid to each structure, replacing the > >>> original pos data (that do not match and of course prohibit using > >>> sourceststatistics and sourcegrandaverage). When trying to do > >>> either a source grand average or a sourcestatistics at the > >>> multisubject level I get the same error: > >>> > >>> subscripted assignment dimension mismatch > >>> dat(:,i) = tmp(:); > >>> > >>> Error in ==> sourcegrandaverage at 173 > >>> > >>> > >>> The corresponding lines of code in sourcegrandaverage are: > >>> > >>> % get the source parameter from each input source reconstruction > >>> % get the inside parameter from each input source reconstruction > >>> for i=1:Nsubject > >>> % TODO this function should use parameterselection > >>> if issubfield(varargin{i}, ['avg.' cfg.parameter]) > >>> tmp = getsubfield(varargin{i}, ['avg.' cfg.parameter]); > >>> else > >>> tmp = getsubfield(varargin{i}, cfg.parameter); > >>> end > >>> dat(:,i) = tmp(:); > >>> tmp = getsubfield(varargin{i}, 'inside'); > >>> inside(tmp,i) = 1; > >>> end > >>> > >>> I get an identical error when using sourcestatistics at the > >>> multisubject level. > >>> The variable dat(:,i) is created like this: > >>> dat = zeros(Nvoxel, Nsubject) > >>> > >>> > >>> I suspect that somehow trying to use the 'stat' instead of the > >>> power parameter is a problem (TODO?) or that Nvoxel somehow differs > >>> over the various subjects ?? > >>> > >>> Any advice on what to try and test further would very much > >>> appreciated. > >>> > >>> Thanks in advance, > >>> Michael > >>> > >>> > >>> ---------------------------------- > >>> The aim of this list is to facilitate the discussion between users > >>> of the FieldTrip toolbox, to share experiences and to discuss new > >>> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > >>> archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > >>> fieldtrip. > >> > >> ---------------------------------- > >> The aim of this list is to facilitate the discussion between users > >> of the > >> FieldTrip toolbox, to share experiences and to discuss new ideas > >> for MEG > >> and EEG analysis. See also > >> http://listserv.surfnet.nl/archives/fieldtrip.html and > >> http://www.ru.nl/fcdonders/fieldtrip. > >> > >> ---------------------------------- > >> The aim of this list is to facilitate the discussion between users > >> of the FieldTrip toolbox, to share experiences and to discuss new > >> ideas for MEG and EEG analysis. See also http:// > >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ > >> fcdonders/fieldtrip. > >> > > > > > > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > > of the FieldTrip toolbox, to share experiences and to discuss new > > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > > fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Thu Dec 11 17:02:14 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 11 Dec 2008 17:02:14 +0100 Subject: bug in freqanalysis_mtmfft in case of non-dpss tapers and variable trial length Message-ID: Dear all, I just identified and fixed a bug in freqanalysis_mtmfft. The bug caused an incorrect scaling of non-dpss tapers in case of variable trial length. Multitapers (cfg.taper=dpss) are not affected, and data in which all trials are of equal length are also not affected. The bug became apparent to me when I compared hanning-tapered power estimates in which some trials were missing some samples versus the same data in which all trials were of exactly equal length. The power difference between those two was a factor ~100x, whereas the difference was that in one condition the data of a few trials was one sample too short. The consequence of the taper not being scaled/normalized correctly is that all frequencies are multiplied by a fixed amount. The overall shape of the power spectrum will not look different, it is just multiplied with a fixed amount. Comparing two datasets with variable trial length for both conditions is also not affected (the absolute power values will both be off with a similar factor). There are cases thinkeable in which the bug will have caused problems in the subsequent analysis, e.g. in the data that I was analyzing. The problem was quite obvious: a factor ~100 difference between the power spectra in the two conditions, where that factor 100 was frequency aspecific. Sorry for the inconvenience that it may have caused. best regards, Robert PS for the external users: the fixed version will be uploaded to the ftp server this evening around 22h CET. ----------------------------------------------------------- Robert Oostenveld Senior Researcher Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/neuroimaging ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From amano at BRAIN.K.U-TOKYO.AC.JP Fri Dec 12 07:02:25 2008 From: amano at BRAIN.K.U-TOKYO.AC.JP (Kaoru Amano) Date: Fri, 12 Dec 2008 15:02:25 +0900 Subject: Transformation from head to MEG coordinate In-Reply-To: <91FE2963-4911-4996-B0AD-0B8909BE6DA6@fcdonders.ru.nl> Message-ID: Dear all We are using Yokogawa's MEG system and are trying to do source localization using fieldtrip. In "prepare_leadfield.m", dipole grid is supposed to be provided in head coordinate, while sensor location is defined in MEG coordinate. For the registration between head and MEG coordinates, we need to specify the information of head positioning, in which we get MEG coordinates of three markers. Could you tell me how we can specify the information of head positioning? Best, Kaoru -- Kaoru Amano email: amano at brain.k.u-tokyo.ac.jp URL: http://www.brain.k.u-tokyo.ac.jp/~amano/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri Dec 12 07:41:12 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 12 Dec 2008 06:41:12 +0000 Subject: Transformation from head to MEG coordinate In-Reply-To: <4941FE71.1060501@brain.k.u-tokyo.ac.jp> Message-ID: Dear Kaoru, 1) There is no requirement to provide the grid in head coordinates. vol, grid and sensors can be in any coordinate system as long as it is the same system. 2) What do you use to read sensor positions and fiducials for Yokogawa? The code available in Fieldtrip at the moment is incomplete and would not allow you to use the beamformer. If you have something better, we'd be very interested in integrating your code. 3) There are some functions in Fieldtrip to do coregistration. Look at electroderealign and interactiverealign. 4) SPM8b (http://www.fil.ion.ucl.ac.uk/spm/software/spm8b/) which is very well integrated with Fieldtrip has some facilities for coregistering sensors and head models using GUI. The resulting coregistered volume in sensors can be used for beamforming in Fieldtrip. But this wil only work with proper Yokogawa support which we lack at the moment. Best, Vladimir On Fri, Dec 12, 2008 at 6:02 AM, Kaoru Amano wrote: > Dear all > > We are using Yokogawa's MEG system and are trying to do source localization > using fieldtrip. > > In "prepare_leadfield.m", dipole grid is supposed to be provided in head > coordinate, while sensor location is defined in MEG coordinate. For the > registration between head and MEG coordinates, we need to specify the > information of head positioning, in which we get MEG coordinates of three > markers. > > Could you tell me how we can specify the information of head positioning? > > > Best, > Kaoru > > > > -- > Kaoru Amano > email: amano at brain.k.u-tokyo.ac.jp > URL: http://www.brain.k.u-tokyo.ac.jp/~amano/ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marco.sperduti at UPMC.FR Fri Dec 12 12:20:31 2008 From: marco.sperduti at UPMC.FR (Marco SPERDUTI) Date: Fri, 12 Dec 2008 12:20:31 +0100 Subject: group sources statistics Message-ID: Dear users, once i've done sources statistics for a single subject, is there a way to do it on the group keeping subjects informations? thank you, 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/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri Dec 12 17:37:12 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 12 Dec 2008 17:37:12 +0100 Subject: Problems with second level source statistics for multi plew subjects and firsty level stats - solved :-) Message-ID: Dear listusers, in several previous mails I have reported about problems occuring when: 1) doing single subjects source analysis using reverse-normalized grids (thanks to Ingrid's tutorial), common filters for the two conditions and generating single trial source data 2) then performing single subject sourcestatistics (getting a sparse data representation with a stat field) 3) then doing second level sourcestatistics (which didn't work) I am happy to report these problems are solved :-). I actually just overlooked a WARNING:... when doing single subject sourceanalysis and sourcestatistics (1st level) is says that you yourself have to add a dim field by hand, when trying to use clusterrandanalysis/sourcestatistics later. I now simply added a dim field to both, to the data and to the cfg for the second level source statistics. The correct choice for this dim field are the dimension of the original, orthogonal, regular grid in MNI space and everything works now. I just didn't realize that dim can't be all that easily generated automatically by fieldtrip for sparse data and *warped* grids. This is because the warping could - in principle - be such that dim doesn't make any sense anymore, e.g. because points (almost) switch places along a certain dimension (if they differ in the other coordinates). So neighborhood relations are not well defined a priori in sparse data. Hence, the need for a manual addition of dim in this case (please correct me me if any of the above is wrong). The version I used and that I can confirm to work was 20081208. Many thanks for all your support, Michael ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From mhamidi at WISC.EDU Sat Dec 13 00:56:53 2008 From: mhamidi at WISC.EDU (Massih Hamidi) Date: Sat, 13 Dec 2008 00:56:53 +0100 Subject: error with sourceanalysis Message-ID: I am running the "localizing oscillatory sources using beamformer techniques" tutorial on my EEG data (imported from EEGlab) using the mnc t1 template MRI (as described in the "Create BEM headmodel for EEG" tutorial). However, I get an error when running sourceinterpolate (?? Attempted to access sel(1); index out of bounds because numel(sel)=0.) When I plotted the output of sourceanalysis (without the anatomical mri), I get a strange pattern (attached). I then tried to run prepare_leadfield with cfg.mri (create the dipole grid based on segmented mri) and I was able to successfully run sourceanalysis and sourceitnerpolate, but the map of power estimates look nothing like what is shown in the tutorial (also attached). Plotting the data and time-frequency analysis results seem fine, so I don't think it's an import or freqanalysis problem. Any ideas on what's wrong? Thanks. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: sourcepost.jpg Type: image/jpeg Size: 25321 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sourcepostwithMRIbasedgrid.jpg Type: image/jpeg Size: 61407 bytes Desc: not available URL: From nathanweisz at MAC.COM Sat Dec 13 18:15:16 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Sat, 13 Dec 2008 18:15:16 +0100 Subject: problems while calculating leadfield Message-ID: hi, i have a problem while performing prepare_leadfield. the data is some old CTF data i collected ~2 years ago. i calculated a multisphere model in fieldtrip using prepare_localspheres. this step works (i.e. i get a vol structure that looks ok in my opinion). however when continuing with prepare_leadfield the the program crashes. here's the code: cfg=[]; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; cfg.vol=vol; cfg.channel='MEG'; cfg.grad=dataCLeConI.grad; cfg.inwardshift=0; cfg.grid.resolution=1; cfg.reducerank=2; lf=prepare_leadfield(cfg); i get this error message: ??? Error using ==> prepare_headmodel at 301 synthetic gradients not supported during volume conductor setup Error in ==> prepare_leadfield at 223 [vol, sens, cfg] = prepare_headmodel(cfg, data); Error in ==> newcat_calcgrid at 52 lf=prepare_leadfield(cfg); i messed around with different headmodels just to see how prepare_leadfield behaves: *when the headmodel is a single sphere (cfg.singlesphere='yes') prepare_leadfield works fine *when using the nolte headmodel (via prepare_singleshell), prepare_leadfield does not crash, but the leadfields contain only NaN ... is that perhaps related to the issue above? again, any help is greatly appreciated. best, nathan -------------------------------------------- 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/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Mon Dec 15 11:36:54 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Dec 2008 11:36:54 +0100 Subject: error with sourceanalysis In-Reply-To: Message-ID: My first suspicion is that there there is a problem with the coordinate system, e.g. that you express one geometrical object (the mri) in mm and the other geometrical object (the volume conduction model, the eelctrode positions or the source positions) in cm. Please use the headmodelplot function to check that the electrodes, volume conduction model and sources are appropriately aligned to each other. Plotting those together with the MRI is difficult, but you can look at the positions as numbers and check that those are epressed in mm. best regards Robert On 13 Dec 2008, at 0:56, Massih Hamidi wrote: > I am running the "localizing oscillatory sources using beamformer > techniques" tutorial on my EEG data (imported from EEGlab) using the > mnc t1 > template MRI (as described in the "Create BEM headmodel for EEG" > tutorial). > > However, I get an error when running sourceinterpolate (?? Attempted > to > access sel(1); index out of bounds because numel(sel)=0.) > When I plotted the output of sourceanalysis (without the anatomical > mri), I > get a strange pattern (attached). > > I then tried to run prepare_leadfield with cfg.mri (create the > dipole grid > based on segmented mri) and I was able to successfully run > sourceanalysis > and sourceitnerpolate, but the map of power estimates look nothing > like what > is shown in the tutorial (also attached). > > Plotting the data and time-frequency analysis results seem fine, so > I don't > think it's an import or freqanalysis problem. Any ideas on what's > wrong? > Thanks. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marco.sperduti at UPMC.FR Mon Dec 15 11:42:06 2008 From: marco.sperduti at UPMC.FR (Marco SPERDUTI) Date: Mon, 15 Dec 2008 11:42:06 +0100 Subject: regions of interest for source statistics Message-ID: Dear all, I would like to define regions of interest for sources statistics. I found on the sourcestatics tutorial that i have to define these parameters: cfg.atlas = filename of the atlas cfg.roi = cell-array with labels according to the atlas cfg.avgoverroi = 'yes' or 'no' (default = 'no') cfg.hemisphere = 'left', 'right', 'both', 'combined', cfg.inputcoord = 'mni' or 'tal' what can I use as atlas? Do you have an example script for doing that? thank you all, 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/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Dec 15 13:39:22 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Dec 2008 13:39:22 +0100 Subject: problems while calculating leadfield In-Reply-To: <75FE5F2D-C449-4E04-8553-AA2266DEC889@mac.com> Message-ID: Hi Nathan Each MEG channel consists of two coils, one with a weight of +1 and the other with a weight of -1. For a synthetic 3rd order gradiometer system, also the reference coils are weighted and part of the signal picked up at the reference channels is subtracted from the normal MEG channels. That means that the reference coils also get a weight in the output of a MEG channel. For setting up the volume conduction model in case of a multi-sphere model, for each _coil_ the corresponding sphere has to be determined. For the bottom and top coil (with the +1 and -1 weight) the two spheres are the same and correspond to the sphere fitted to the scalp under that channel. In case of the 3rd order synthetic gradiometer data, the reference coils also have a (small) weight, which means that also for those coils a "local" sphere has to be identified. At the moment assigning local spheres to the reference coils is not yet supported in the code. Probably the best would be to use the local spheres for the 2 meg coils and to use a single sphere that is fitted to the complete headshape (i.e. the "single sphere") for the reference coils. It requires some work though to get the bookkeeping of all coils and all spheres correct. A better solution (and the one we use here at the FCDC) might be to use prepare_singleshell instead of prepare_localspheres. The singleshell volume conduction model also approximates the geometry with a realistic shape, but is better for the lower part of the brain. In short, there are no disadvantages(*) in the singleshell model compared to the localspheres model, but only advantages. best regards, Robert *) expect perhaps that it is computationally slightly slower, and that the localspheres can also be constructed with a polhemus measured head surface, whereas the singleshell requires a segmented anatomical MRI. On 13 Dec 2008, at 18:15, Nathan Weisz wrote: > i have a problem while performing prepare_leadfield. > the data is some old CTF data i collected ~2 years ago. i calculated > a multisphere model in fieldtrip using prepare_localspheres. this > step works (i.e. i get a vol structure that looks ok in my opinion). > however when continuing with prepare_leadfield the the program > crashes. > > here's the code: > cfg=[]; > cfg.grid.xgrid='auto'; > cfg.grid.ygrid='auto'; > cfg.grid.zgrid='auto'; > cfg.vol=vol; > cfg.channel='MEG'; > cfg.grad=dataCLeConI.grad; > cfg.inwardshift=0; > cfg.grid.resolution=1; > cfg.reducerank=2; > > lf=prepare_leadfield(cfg); > > i get this error message: > ??? Error using ==> prepare_headmodel at 301 > synthetic gradients not supported during volume conductor setup > > Error in ==> prepare_leadfield at 223 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > Error in ==> newcat_calcgrid at 52 > lf=prepare_leadfield(cfg); > > i messed around with different headmodels just to see how > prepare_leadfield behaves: > *when the headmodel is a single sphere (cfg.singlesphere='yes') > prepare_leadfield works fine > *when using the nolte headmodel (via prepare_singleshell), > prepare_leadfield does not crash, but the leadfields contain only > NaN ... is that perhaps related to the issue above? > > again, any help is greatly appreciated. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Mon Dec 15 14:25:39 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Mon, 15 Dec 2008 14:25:39 +0100 Subject: problems while calculating leadfield In-Reply-To: <8D72E95C-87AF-4873-85CE-79BF2690562F@fcdonders.ru.nl> Message-ID: hi robert, thanks for your help. i tried the singleshell option, but calculating the leadfield still makes problems. here some code: cfg=[]; %cfg.grad=dataCLeConI.grad; %cfg.grad.pnt=dataCLeConI.grad.pnt; cfg.headshape=hs; %hs nx3 in cm vol=prepare_singleshell(cfg); This seems to work fine: K>> vol vol = bnd: [1x1 struct] type: 'nolte' K>> vol.bnd.pnt(1:3,:) ans = -3.2750 -4.6410 -0.8710 -3.2750 -4.6410 -0.8710 -0.8710 -5.8870 -0.9760 K>> vol.bnd.tri(1:3,:) ans = 935 843 936 912 1007 911 1803 1802 1692 However when I attempt to calculate the leadfield: cfg=[]; cfg.grid.xgrid=[-20:1:20]; cfg.grid.ygrid=[-20:1:20]; cfg.grid.zgrid=[0:1:20]; cfg.vol=vol; cfg.channel={'MEG'}; cfg.grad=dataCLeConI.grad; cfg.reducerank=2; lf=prepare_leadfield(cfg); I get following error: using headmodel specified in the configuration using gradiometers specified in the configuration computing surface normals Warning: Divide by zero. > In normals at 60 In prepare_headmodel at 323 In prepare_leadfield at 223 In newcat_calcgrid at 39 Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In meg_ini>getcoeffs at 94 In meg_ini at 36 In prepare_headmodel at 329 In prepare_leadfield at 223 In newcat_calcgrid at 39 creating dipole grid based on user specified 3D grid 2256 dipoles inside, 33045 dipoles outside brain computing leadfield computing leadfield 1/2256 ??? Error using ==> svd Input to SVD must not contain NaN or Inf. Error in ==> compute_leadfield at 484 [u, s, v] = svd(lf); Error in ==> prepare_leadfield at 242 grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize, 'normalizeparam', cfg.normalizeparam); Is there something special in the function call I have to consider when calculating leadfields using singleshell? Cheers, nathan On 15.12.2008, at 13:39, Robert Oostenveld wrote: > Hi Nathan > > Each MEG channel consists of two coils, one with a weight of +1 and > the other with a weight of -1. For a synthetic 3rd order gradiometer > system, also the reference coils are weighted and part of the signal > picked up at the reference channels is subtracted from the normal > MEG channels. That means that the reference coils also get a weight > in the output of a MEG channel. > > For setting up the volume conduction model in case of a multi-sphere > model, for each _coil_ the corresponding sphere has to be > determined. For the bottom and top coil (with the +1 and -1 weight) > the two spheres are the same and correspond to the sphere fitted to > the scalp under that channel. In case of the 3rd order synthetic > gradiometer data, the reference coils also have a (small) weight, > which means that also for those coils a "local" sphere has to be > identified. At the moment assigning local spheres to the reference > coils is not yet supported in the code. > > Probably the best would be to use the local spheres for the 2 meg > coils and to use a single sphere that is fitted to the complete > headshape (i.e. the "single sphere") for the reference coils. It > requires some work though to get the bookkeeping of all coils and > all spheres correct. > > A better solution (and the one we use here at the FCDC) might be to > use prepare_singleshell instead of prepare_localspheres. The > singleshell volume conduction model also approximates the geometry > with a realistic shape, but is better for the lower part of the > brain. In short, there are no disadvantages(*) in the singleshell > model compared to the localspheres model, but only advantages. > > best regards, > Robert > > *) expect perhaps that it is computationally slightly slower, and > that the localspheres can also be constructed with a polhemus > measured head surface, whereas the singleshell requires a segmented > anatomical MRI. > > > > On 13 Dec 2008, at 18:15, Nathan Weisz wrote: > >> i have a problem while performing prepare_leadfield. >> the data is some old CTF data i collected ~2 years ago. i >> calculated a multisphere model in fieldtrip using >> prepare_localspheres. this step works (i.e. i get a vol structure >> that looks ok in my opinion). however when continuing with >> prepare_leadfield the the program crashes. >> >> here's the code: >> cfg=[]; >> cfg.grid.xgrid='auto'; >> cfg.grid.ygrid='auto'; >> cfg.grid.zgrid='auto'; >> cfg.vol=vol; >> cfg.channel='MEG'; >> cfg.grad=dataCLeConI.grad; >> cfg.inwardshift=0; >> cfg.grid.resolution=1; >> cfg.reducerank=2; >> >> lf=prepare_leadfield(cfg); >> >> i get this error message: >> ??? Error using ==> prepare_headmodel at 301 >> synthetic gradients not supported during volume conductor setup >> >> Error in ==> prepare_leadfield at 223 >> [vol, sens, cfg] = prepare_headmodel(cfg, data); >> >> Error in ==> newcat_calcgrid at 52 >> lf=prepare_leadfield(cfg); >> >> i messed around with different headmodels just to see how >> prepare_leadfield behaves: >> *when the headmodel is a single sphere (cfg.singlesphere='yes') >> prepare_leadfield works fine >> *when using the nolte headmodel (via prepare_singleshell), >> prepare_leadfield does not crash, but the leadfields contain only >> NaN ... is that perhaps related to the issue above? >> >> again, any help is greatly appreciated. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Dec 15 15:51:19 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Dec 2008 15:51:19 +0100 Subject: scaling plexon *.nex data changed Message-ID: Dear plexon nex users I have modified the scaling of the data from plexon nex files in the corresponding low-level functions by a factor of 1000x. It turned out that this data was scaled as milivolt/mV, whereas for allmost all other formats fieldtrip uses microvolt/uV scaling for the data. To ensure consistency, I have changed the scaling for reading and writing plexon nex files to now also use microvolts. Please be aware of this when you compare computations done with different versions of fieldtrip, and when interpreting your figures. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marco.sperduti at UPMC.FR Mon Dec 15 18:33:03 2008 From: marco.sperduti at UPMC.FR (Marco SPERDUTI) Date: Mon, 15 Dec 2008 18:33:03 +0100 Subject: regions of interest for source statistics 2 Message-ID: Hi all, i'm trying to define ROI for sourcestatistic using wfu_pickatlas (i've also tried with AFNI) but i always have this error: ??? Error using ==> read_fcdc_mri unrecognized filetype of 'wfu_pickatlas' Error in ==> atlas_init at 536 atlas = read_fcdc_mri(filename); % /home/... works, ~/.... does not work Error in ==> statistics_wrapper at 217 atlas = atlas_init(cfg.atlas); Error in ==> sourcestatistics at 152 stat = statistics_wrapper(cfg, varargin{:}); that's my code: cfg.atlas = 'wfu_pickatlas'; cfg.roi = {'Inferior Parietal Lobule' ; 'Superior Temporal Gyrus'}; cfg.hemisphere = 'both'; cfg.inputcoord = 'mni'; any idea? thank you, 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/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Dec 16 22:23:46 2008 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 16 Dec 2008 22:23:46 +0100 Subject: regions of interest for source statistics In-Reply-To: <20081215114206.hpr3cztnw4s4888k@courriel.upmc.fr> Message-ID: Dear Marco, You can use the AFNI brik file that is available from http://afni.nimh.nih.gov/afni/doc/misc/ttatlas_tlrc , or use one of the WFU atlases available from http://fmri.wfubmc.edu For cfg.atlas you then specify the whole path to the atlas for instance: cfg.atlas = /matlab/wfu_pickatlas/MNI_atlas_templates/aal_MNI_V4.img'; cfg.roi should be the name (or names) of the ROIs. You can use prepare_atlas to see the precise names of the atlas you're using. Note: The data on which you want to do sourcestatistics has to be normalized to the MNI or Talairach coordinate system. All the best, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Marco SPERDUTI Sent: Monday, December 15, 2008 11:42 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] regions of interest for source statistics Dear all, I would like to define regions of interest for sources statistics. I found on the sourcestatics tutorial that i have to define these parameters: cfg.atlas = filename of the atlas cfg.roi = cell-array with labels according to the atlas cfg.avgoverroi = 'yes' or 'no' (default = 'no') cfg.hemisphere = 'left', 'right', 'both', 'combined', cfg.inputcoord = 'mni' or 'tal' what can I use as atlas? Do you have an example script for doing that? thank you all, 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/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jackm_ustc at YAHOO.COM.CN Thu Dec 18 21:47:35 2008 From: jackm_ustc at YAHOO.COM.CN (SUBSCRIBE FIELDTRIP Jack M.) Date: Thu, 18 Dec 2008 21:47:35 +0100 Subject: Trouble in recompiling the Fieldtrip Message-ID: Hello, I met exactly the same problem as listed on the Fieldtrip wiki under the FAQ section "Matlab complains about a missing or invalid MEX file, what should I do?" So I followed the instruction on that wiki and tried to recompile the binaries. I am using an iMac (OS X 10.5.5) and Matlab2007b. When I tried mex meg_leadfield1.c , the error message said, " /Applications/MATLAB_R2007b/bin/mex: line 1025: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 1004: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 930: gcc-4.0: command not found mex: compile of 'meg_leadfield1.c' failed. ??? Error using ==> mex at 208 Unable to complete successfully. " I am a newbie. Could anyone please give me a solution? Thanks a lot! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jackm_ustc at YAHOO.COM.CN Thu Dec 18 21:55:03 2008 From: jackm_ustc at YAHOO.COM.CN (Alan Yi) Date: Fri, 19 Dec 2008 04:55:03 +0800 Subject: Trouble in recompiling the fieldtrip Message-ID: Hello, I met exactly the same problem as listed on the Fieldtrip wiki under the FAQ section "Matlab complains about a missing or invalid MEX file, what should I do?" So I followed the instruction and tried to recompile the fieldtrip binaries. However, an error message appeared: >> mex meg_leadfield1.c /Applications/MATLAB_R2007b/bin/mex: line 1025: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 1004: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 930: gcc-4.0: command not found     mex: compile of 'meg_leadfield1.c' failed. ??? Error using ==> mex at 208 Unable to complete successfully. I am a newbie. Could anyone please tell me how to do? I am using Matlab2007b on my iMac (OS X 10.5.5). Thanks a lot! ___________________________________________________________ 好玩贺卡等你发,邮箱贺卡全新上线! http://card.mail.cn.yahoo.com/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedmeltzer at YAHOO.COM Fri Dec 19 21:36:44 2008 From: jedmeltzer at YAHOO.COM (Jed Meltzer) Date: Fri, 19 Dec 2008 12:36:44 -0800 Subject: dealing with missing channels in group cluster analysis Message-ID: Hi, I'm interested in using the cluster-based randomization statistical functions in fieldtrip, on EEG data that I've already mostly processed using other software. I have power spectra from multiple conditions, already averaged within subjects, and I want to do cross-subject comparisons, i.e. a paired t-test with two conditions in each subject. I think for this I could use "timelockstatistics" and just trick the software into thinking that the input is timepoints rather than frequency components (this is from windowed fourier spectra, with no time dimension). If anyone sees any problem with that, please let me know, but otherwise I'll move on to my problem... So I'm trying to put my data into the same format as that used in the tutorial example. I have 24 subjects, 34 electrodes, and 257 frequency points, so it looks like I need to contstruct for each condition a data structure with a field like: data.individual: 24x34x257 Now, my problem is that in a few subjects there are some missing channels. Some channels in the course of the experiment are deemed unacceptably noisy and excluded from analysis. This is all kept track of in my processing schemes, but how can I deal with it here, when I need to fill in the full array? Normally I would fill in the missing space with NaN, but I'm not sure that the cluster analysis programs in field trip can deal with NaN. Maybe it wouldn't be such a big deal to change them? I've thought about doing it myself, but I'm afraid I would miss something due to unfamiliarity with the code. But it seems like functions such as statfun_depsamplesT.m (which I'm using) call matlab functions like mean() and var(), when they could easily call nanmean() and nanvar() (from the statistics toolbox) instead. One would have to check for NaN data and adjust the degrees of freedom as well. Do you think there's any hope for this? Or would you suggest a different approach? Just please don't say "interpolate the missing channels" or I will have to bang my head against the wall... -Jed Jed A. Meltzer, Ph.D. Postdoctoral Fellow, Language Section, Voice, Speech, and Language Branch National Institute on Deafness and Other Communication Disorders, National Institutes of Health 10 Center Drive, Building 10, Rm 5C410, Bethesda, MD 20892-1065 301-435-5144 meltzerj at nidcd.nih.gov ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jrkerlin at UCDAVIS.EDU Fri Dec 19 22:41:53 2008 From: jrkerlin at UCDAVIS.EDU (Jess R. Kerlin) Date: Fri, 19 Dec 2008 13:41:53 -0800 Subject: Problems with second level source statistics for multi plew subjects and firsty level stats - solved :-) In-Reply-To: <853421468@web.de> Message-ID: Dear FTrippers, I've been replicating the beamformer tutorial to the letter, and arrived at problem which may be related to the one described below. Running : stat = sourcestatistics(cfg, sourceSTAT); Gives the error: ??? Index of element to remove exceeds matrix dimensions. Error in ==> /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m (get_source_trial) On line 443 ==> dat((j-1).*dim(1) + varargin{1}.outside, :) = []; Error in ==> /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m On line 179 ==> [dat, cfg] = get_source_trial(cfg, varargin{:}); Error in ==> /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/sourcestatistics.m On line 127 ==> stat = statistics_wrapper(cfg, varargin{:}); My sourceSTAT.trial(1).pow is a 1 by 2652 double array (so the dim in get_source_trial is the same) , which may or may not be the proper dimensions for pow (sourceSTAT.dim = [17 13 12] ). If not, exactly how/where would I add the proper dim field? I've also tried running freqanalysis and sourcestatistics with a recent release (20081218), with the same results. Any advice would be greatly appreciated. Thanks, Jess Michael Wibral wrote: > Dear listusers, > > in several previous mails I have reported about problems occuring when: > > 1) doing single subjects source analysis using reverse-normalized grids (thanks to Ingrid's tutorial), common filters for the two conditions and generating single trial source data > 2) then performing single subject sourcestatistics (getting a sparse data representation with a stat field) > 3) then doing second level sourcestatistics (which didn't work) > > I am happy to report these problems are solved :-). I actually just overlooked a WARNING:... when doing single subject sourceanalysis and sourcestatistics (1st level) is says that you yourself have to add a dim field by hand, when trying to use clusterrandanalysis/sourcestatistics later. I now simply added a dim field to both, to the data and to the cfg for the second level source statistics. The correct choice for this dim field are the dimension of the original, orthogonal, regular grid in MNI space and everything works now. > > I just didn't realize that dim can't be all that easily generated automatically by fieldtrip for sparse data and *warped* grids. This is because the warping could - in principle - be such that dim doesn't make any sense anymore, e.g. because points (almost) switch places along a certain dimension (if they differ in the other coordinates). So neighborhood relations are not well defined a priori in sparse data. Hence, the need for a manual addition of dim in this case (please correct me me if any of the above is wrong). > > The version I used and that I can confirm to work was 20081208. > > Many thanks for all your support, > Michael > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jrkerlin at UCDAVIS.EDU Sat Dec 20 01:14:05 2008 From: jrkerlin at UCDAVIS.EDU (Jess R. Kerlin) Date: Fri, 19 Dec 2008 16:14:05 -0800 Subject: Problems with second level source statistics for multi plew subjects and firsty level stats - solved :-) In-Reply-To: <494C1521.6070805@ucdavis.edu> Message-ID: Regarding my previous email: I got the tutorial code to move forward by editing source_wrapper. I don't know if this is a bug or something else is wrong which will nail me later. Editing get_source_trial in source_wrapper : if isfield(varargin{1}, 'inside') fprintf('only selecting voxels inside the brain for statistics (%.1f%%)\n', 100*length(varargin{1}.inside)/prod(varargin{1}.dim)); % for j=prod(dim(2:end)):-1:1 comment out; jk % dat((j-1).*dim(1) + varargin{1}.outside, :) = []; jk dat(varargin{1}.outside, :) = 0; % replaced formula jk % end comment out; jk end Cheers, Jess Jess R. Kerlin wrote: > Dear FTrippers, > > I've been replicating the beamformer tutorial to the letter, and > arrived at problem which may be related to the one described below. > > Running : > stat = sourcestatistics(cfg, sourceSTAT); > > Gives the error: > > ??? Index of element to remove exceeds matrix dimensions. > > Error in ==> > /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m > (get_source_trial) > On line 443 ==> dat((j-1).*dim(1) + varargin{1}.outside, :) = []; > > Error in ==> > /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m > On line 179 ==> [dat, cfg] = get_source_trial(cfg, varargin{:}); > > Error in ==> > /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/sourcestatistics.m > On line 127 ==> stat = statistics_wrapper(cfg, varargin{:}); > > My sourceSTAT.trial(1).pow is a 1 by 2652 double array (so the dim in > get_source_trial is the same) , which may or may not be the proper > dimensions for pow (sourceSTAT.dim = [17 13 12] ). If not, exactly > how/where would I add the proper dim field? > > I've also tried running freqanalysis and sourcestatistics with a > recent release (20081218), with the same results. > > Any advice would be greatly appreciated. > > Thanks, > Jess > > Michael Wibral wrote: >> Dear listusers, >> >> in several previous mails I have reported about problems occuring when: >> >> 1) doing single subjects source analysis using reverse-normalized >> grids (thanks to Ingrid's tutorial), common filters for the two >> conditions and generating single trial source data 2) then performing >> single subject sourcestatistics (getting a sparse data representation >> with a stat field) >> 3) then doing second level sourcestatistics (which didn't work) >> >> I am happy to report these problems are solved :-). I actually just >> overlooked a WARNING:... when doing single subject sourceanalysis and >> sourcestatistics (1st level) is says that you yourself have to add a >> dim field by hand, when trying to use >> clusterrandanalysis/sourcestatistics later. I now simply added a dim >> field to both, to the data and to the cfg for the second level source >> statistics. The correct choice for this dim field are the dimension >> of the original, orthogonal, regular grid in MNI space and everything >> works now. >> >> I just didn't realize that dim can't be all that easily generated >> automatically by fieldtrip for sparse data and *warped* grids. This >> is because the warping could - in principle - be such that dim >> doesn't make any sense anymore, e.g. because points (almost) switch >> places along a certain dimension (if they differ in the other >> coordinates). So neighborhood relations are not well defined a priori >> in sparse data. Hence, the need for a manual addition of dim in this >> case (please correct me me if any of the above is wrong). >> >> The version I used and that I can confirm to work was 20081208. >> >> Many thanks for all your support, >> Michael >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From lmoranr at GMAIL.COM Sat Dec 27 13:35:31 2008 From: lmoranr at GMAIL.COM (=?ISO-8859-1?Q?Luis_Mor=E1n?=) Date: Sat, 27 Dec 2008 13:35:31 +0100 Subject: Problem with DipoleSimulation Message-ID: Dear collegues! I'm new on fieldtrip so I'd be very pleased if someone could help me. I have a problem while using dipolesimulation. I'm trying to make a simulation with 2 dipoles. I introduce the position as a 2-by-3 matrix, and the moment as a 3-by-2. My problem comes when the leadfield is calculated. lf is m-by-n matrix where m is the number of channels and n is 2*number of dipoles. Then, in the script this lf is multiplied by dipmom (a 3-by-Ndipoles matrix) and by dippos (a N-dipoles -by- 3). So this operation only works when we have only one dipole. Thanks in advance -- Luis Morán Rodríguez Altentic lmoran at altentic.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/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Mon Dec 29 10:36:50 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 29 Dec 2008 09:36:50 +0000 Subject: Problem with DipoleSimulation Message-ID: > From: jan-mathijs schoffelen > Date: December 29, 2008 9:22:40 AM BST > To: FieldTrip discussion list > Subject: Re: [FIELDTRIP] Problem with DipoleSimulation > > > Dear Luis, > > The trick is to define the moment-matrix as 6-by-2, i.e. nx3-by-n. > It should look like this: > > [Mx 0 > My 0 > Mz 0 > 0 Mx2 > 0 My2 > 0 Mz2] > > In this case the matrix-multiplication should work out fine. > > Best, > > Jan-Mathijs > > > On Dec 27, 2008, at 12:35 PM, Luis Morán wrote: > >> Dear collegues! >> >> I'm new on fieldtrip so I'd be very pleased if someone could help me. >> >> I have a problem while using dipolesimulation. I'm trying to make >> a simulation with 2 dipoles. I introduce the position as a 2-by-3 >> matrix, and the moment as a 3-by-2. >> >> My problem comes when the leadfield is calculated. lf is m-by-n >> matrix where m is the number of channels and n is 2*number of >> dipoles. Then, in the script this lf is multiplied by dipmom (a 3- >> by-Ndipoles matrix) and by dippos (a N-dipoles -by- 3). So this >> operation only works when we have only one dipole. >> >> Thanks in advance >> >> -- >> Luis Morán Rodríguez >> >> Altentic >> >> lmoran at altentic.com >> ---------------------------------- >> >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. >> >> http://listserv.surfnet.nl/archives/fieldtrip.html >> >> http://www.ru.nl/fcdonders/fieldtrip/ >> > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wibral at BIC.UNI-FRANKFURT.DE Tue Dec 30 15:49:31 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Tue, 30 Dec 2008 15:49:31 +0100 Subject: Job Offer in Frankfurt / Germany Message-ID: Dear colleagues, please find attached below an offer for a position in EEG analysis in Frankfurt/Germany: The research center IDeA (Individual Development and Adaptive Education) in collaboration with the Brain Imaging Center Frankfurt (BIC) offers a position with focus on analysis of EEG data collected longitudinally from children at the age of 6 - 12 years. These data should be combined with fMRI as well as DTI data collected from the same participants. Candidates should have a solid expertise in EEG data analysis. Experience in one or more relevant domains will be considered an advantage: - source analysis - connectivity analysis - time-frequency analysis - combination of EEG and fMRI/DTI data - programming skills (Matlab, C++) The contract will run until June 2011 (renewable). Salary (BAT IIa or BAT IIa/2) depends on qualification and years of working experience. Qualified scientists are encouraged to apply by submitting a motivation letter and a CV to Prof. Dr. Marcus Hasselhorn - Scientific Coordinator IDeA Schloßstraße 29 60486 Frankfurt am Main Phone: +49 69 24708 214 Fax: +49 69 24708 216 Email : hasselhorndipf.de as well as to: Michael Wibral, PhD - Lab Manager MEG Unit Core Structure Brain Imaging Center Frankfurt J.W. Goethe University Heinrich Hoffmann Strasse 10 60528 Frankfurt am Main Phone: +49 69 6301 83193 +49 69 6301 83192 Fax: +49 69 6301 83231 email: wibralbic.uni-frankfurt.de ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From susannah.murphy at PSYCH.OX.AC.UK Tue Dec 30 15:49:59 2008 From: susannah.murphy at PSYCH.OX.AC.UK (Susannah Murphy) Date: Tue, 30 Dec 2008 14:49:59 +0000 Subject: Job Offer in Frankfurt / Germany In-Reply-To: <866243563@web.de> Message-ID: Thanks for your message. I am away until Monday 12th January. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From shehsu at INDIANA.EDU Mon Dec 1 11:29:09 2008 From: shehsu at INDIANA.EDU (Hsu, Shen-Mou) Date: Mon, 1 Dec 2008 05:29:09 -0500 Subject: freqgrandaverage-no averaging performed Message-ID: Dear users, The following message was returned when I executed the freqgrandaverage: "not computing grand average, but keeping individual power for 15 subjects Warning: discarding electrode information because it cannot be averaged". I was wondering if someone may shed some light on this issue. Big thanks in advance. Shen-Mou Hsu MY SCRIPT: j = 1; for sub = [1 2 3 6 7 8 9 10 12 13 14 16 17 18 19] load (['Sub',num2str(sub),'_ERSP_N_fieldtrip_',num2str(i)]); ERSPall(j) = TFRwave; j= j+1; end cfg = []; cfg.keepindividual = 'yes'; ERSP_N_LV = freqgrandaverage(cfg, ERSPall(1), ERSPall(2),ERSPall(3),... ERSPall(4), ERSPall(5), ERSPall(6),ERSPall(7),ERSPall(8),... ERSPall(9),ERSPall(10),ERSPall(11),ERSPall(12),ERSPall(13),... ERSPall(14),ERSPall(15)); save('ERSP_N_LV','ERSP_N_LV'); ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Dec 1 14:20:57 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 1 Dec 2008 14:20:57 +0100 Subject: coordinates In-Reply-To: <20081128143502.d7ybij6e0cggc484@courriel.upmc.fr> Message-ID: On 28 Nov 2008, at 14:35, Marco SPERDUTI wrote: > hallo, > > i would like to know it is possible, once i've made the source > reconstruction, to have a text file with the coordinates of the > sources. after using the "sourceanalysis" function the source positions are stored in source.pos as Nx3 matrix with [x y z]. best regards Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From bleichner.martin at GMAIL.COM Mon Dec 1 14:47:42 2008 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Mon, 1 Dec 2008 14:47:42 +0100 Subject: Different results using multitapers and wavelet Message-ID: hi there, I am using multitapers as well as wavelets to compute my time frequency spectrum of ECoG data (50Hz-90Hz). Recently I realized some discrepancy using these two methods, until than I found that these to method lead to comparable results. In one of our datasets we found very large differences between the two methods. When I looked closer at the problem I found out that the two methods lead to similar results when the effect (increase in power) is large, while they deviate quite a bit when the effect is small. In that case i get a kind of 'checkerboard' like time frequency spectrum for the mutlitapers. I also compared the output of the frequency analysis with the bandpassed raw signal and found that the wavelet transform was the better match. A re there any prerequisites for multitaper use? Does anybody has some experience with this effect? Do I do something wrong? Below you can find the cfg settings I am using Multitaper cfg.output ='pow' cfg.method='mtmconvol' cfg.tapers='dpss' cfg.toi=[-0.5:0.01:2.5] cfg.foi=[55:2:95] cfg.t_ftimwin=ones(size(cfg.foi))*0.2; cfg.tapsmofrq=ones(size(cfg.foi))*15; Wavelet cfg.method='wltconvol'; cfg.width=7; cfg.foi=[55:2:95] cfg.toi=[-0.5:0.01:2.5] Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingrid.nieuwenhuis at FCDONDERS.RU.NL Mon Dec 1 15:51:00 2008 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Mon, 1 Dec 2008 15:51:00 +0100 Subject: Different results using multitapers and wavelet In-Reply-To: Message-ID: Hi Martin, If you use multitapers (or any frequency analysis) you have to take care that you have an integer amount of cycles in your timewindow. Since you use a fixed timewindow of 0.2 seconds, your frequency steps should be a multiple of 5, so cfg.foi should be 55:5:95 or either you should use a cfg.timwin which is dependent on the cfg.foi (fi 7 cycles, just as in your wavelets). See the tutorial on the FieldTrip website for more explanation. (fieldtrip > documentation > tutorial >Time-frequency Analysis Using Multitapers and Wavelets) Best Ingrid _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Martin Bleichner Sent: Monday, December 01, 2008 2:48 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] Different results using multitapers and wavelet hi there, I am using multitapers as well as wavelets to compute my time frequency spectrum of ECoG data (50Hz-90Hz). Recently I realized some discrepancy using these two methods, until than I found that these to method lead to comparable results. In one of our datasets we found very large differences between the two methods. When I looked closer at the problem I found out that the two methods lead to similar results when the effect (increase in power) is large, while they deviate quite a bit when the effect is small. In that case i get a kind of 'checkerboard' like time frequency spectrum for the mutlitapers. I also compared the output of the frequency analysis with the bandpassed raw signal and found that the wavelet transform was the better match. A re there any prerequisites for multitaper use? Does anybody has some experience with this effect? Do I do something wrong? Below you can find the cfg settings I am using Multitaper cfg.output ='pow' cfg.method='mtmconvol' cfg.tapers='dpss' cfg.toi=[-0.5:0.01:2.5] cfg.foi=[55:2:95] cfg.t_ftimwin=ones(size(cfg.foi))*0.2; cfg.tapsmofrq=ones(size(cfg.foi))*15; Wavelet cfg.method='wltconvol'; cfg.width=7; cfg.foi=[55:2:95] cfg.toi=[-0.5:0.01:2.5] Thanks Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. http://listserv.surfnet.nl/archives/fieldtrip.html http://www.ru.nl/fcdonders/fieldtrip/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From saskia.haegens at DONDERS.RU.NL Mon Dec 1 15:53:09 2008 From: saskia.haegens at DONDERS.RU.NL (Saskia Haegens) Date: Mon, 1 Dec 2008 15:53:09 +0100 Subject: freqgrandaverage-no averaging performed In-Reply-To: <7F00B6A0D4D0674E80A6C1D6DA873B5701E4AC782B@iu-mssg-mbx05.ads.iu.edu> Message-ID: If you want to calculate the average over subjects, use cfg.keepindividual = 'no'; If you want to keep the individual data (e.g. for doing statistics) use cfg.keepindividual = 'yes'; Best, Saskia > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Hsu, Shen-Mou > Sent: 01 December 2008 11:29 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] freqgrandaverage-no averaging performed > > Dear users, > > The following message was returned when I executed the freqgrandaverage: > "not computing grand average, but keeping individual power for 15 subjects > Warning: discarding electrode information because it cannot be averaged". > > I was wondering if someone may shed some light on this issue. > > Big thanks in advance. > > Shen-Mou Hsu > > MY SCRIPT: > > j = 1; > > for sub = [1 2 3 6 7 8 9 10 12 13 14 16 17 18 19] > load (['Sub',num2str(sub),'_ERSP_N_fieldtrip_',num2str(i)]); > > ERSPall(j) = TFRwave; > j= j+1; > end > > > > cfg = []; > cfg.keepindividual = 'yes'; > > ERSP_N_LV = freqgrandaverage(cfg, ERSPall(1), ERSPall(2),ERSPall(3),... > ERSPall(4), ERSPall(5), ERSPall(6),ERSPall(7),ERSPall(8),... > ERSPall(9),ERSPall(10),ERSPall(11),ERSPall(12),ERSPall(13),... > ERSPall(14),ERSPall(15)); > > > save('ERSP_N_LV','ERSP_N_LV'); > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From bleichner.martin at GMAIL.COM Mon Dec 1 16:17:40 2008 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Mon, 1 Dec 2008 16:17:40 +0100 Subject: Different results using multitapers and wavelet In-Reply-To: <001501c953c4$39f6f0b0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid, thanks for the tip, but it does not solve the problem. I tried now the method that I am normally using for the low frequencies (hanning) for my high frequency range and get results comparable to the wavelet. See below. Any other suggestions? best Martin cfg.output ='pow' cfg.method='mtmconvol' cfg.tapers='hanning' cfg.toi=[-0.5:0.01:2.5] cfg.foi=[55:2:95] cfg.t_ftimwin=4./cfgLow.foi 2008/12/1 Ingrid Nieuwenhuis > Hi Martin, > > > > If you use multitapers (or any frequency analysis) you have to take care > that you have an integer amount of cycles in your timewindow. Since you use > a fixed timewindow of 0.2 seconds, your frequency steps should be a multiple > of 5, so cfg.foi should be 55:5:95 or either you should use a cfg.timwin > which is dependent on the cfg.foi (fi 7 cycles, just as in your wavelets). > See the tutorial on the FieldTrip website for more explanation. (fieldtrip » > documentation » tutorial »Time-frequency Analysis Using Multitapers and > Wavelets) > > > > Best Ingrid > ------------------------------ > > *From:* FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] *On > Behalf Of *Martin Bleichner > *Sent:* Monday, December 01, 2008 2:48 PM > *To:* FIELDTRIP at NIC.SURFNET.NL > *Subject:* [FIELDTRIP] Different results using multitapers and wavelet > > > > hi there, > > I am using multitapers as well as wavelets to compute my time frequency > spectrum of ECoG data (50Hz-90Hz). Recently I realized some discrepancy > using these two methods, until than I found that these to method lead to > comparable results. > > In one of our datasets we found very large differences between the two > methods. When I looked closer at the problem I found out that the two > methods lead to similar results when the effect (increase in power) is > large, while they deviate quite a bit when the effect is small. > In that case i get a kind of 'checkerboard' like time frequency spectrum > for the mutlitapers. > I also compared the output of the frequency analysis with the bandpassed > raw signal and found that the wavelet transform was the better match. A > > re there any prerequisites for multitaper use? Does anybody has some > experience with this effect? Do I do something wrong? > Below you can find the cfg settings I am using > > Multitaper > cfg.output ='pow' > cfg.method='mtmconvol' > cfg.tapers='dpss' > cfg.toi=[-0.5:0.01:2.5] > cfg.foi=[55:2:95] > cfg.t_ftimwin=ones(size(cfg.foi))*0.2; > cfg.tapsmofrq=ones(size(cfg.foi))*15; > > > Wavelet > cfg.method='wltconvol'; > cfg.width=7; > cfg.foi=[55:2:95] > cfg.toi=[-0.5:0.01:2.5] > > Thanks > > Martin > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and > EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fredericroux at HOTMAIL.DE Wed Dec 3 23:23:45 2008 From: fredericroux at HOTMAIL.DE (Frederic Roux) Date: Wed, 3 Dec 2008 23:23:45 +0100 Subject: error using denoise_synthetic Message-ID: Hi, I'm getting an error message related to the number of channels when using the denoise_synthetic function. I use the following code: cfg = []; cfg.channel = {'all', 'EEG'}; etc. etc. etc. cfg.gradient = 'G3BR'; cfg.trial = 'all'; data = preprocessing(cfg); data = denoise_synthetic(cfg,data); The error message states that not all channels required for the montage are in the data set. Now, before I used denoise_synthetic my script was perfectly running and the data looked ok. Can anyone tell me what may be the issue here? Thank you in advance for any kind of suggestion, Frederic _________________________________________________________________ Wer erfand den Glückskeks? Kleiner Tipp: Die Chinesen waren es nicht! - Mehr auf msn.de http://redirect.gimas.net/?n=M0812xMSNDE ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bleichner.martin at GMAIL.COM Thu Dec 4 13:40:13 2008 From: bleichner.martin at GMAIL.COM (Martin Bleichner) Date: Thu, 4 Dec 2008 13:40:13 +0100 Subject: multiplotER for averaged time frequency data Message-ID: Hi there, I am trying to get a multiplotER() kind of plot for time frequency data, averaged over a specific frequency range. I.e. I compute a time frequency spectrum average over the gamma band and want to plot the resulting traces for all electrodes. However, mutliplotER() refuses to accept time frequency data. I managed to trick it into accepting it but wondered whether there is a cleaner possibility to plot this kind of data. Thanks best Martin ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhamidi at WISC.EDU Fri Dec 5 20:18:35 2008 From: mhamidi at WISC.EDU (Massih Hamidi) Date: Fri, 5 Dec 2008 20:18:35 +0100 Subject: Creating BEM headmodel for EEG Message-ID: I am trying to create a BEM model using the Create BEM headmodel for EEG script. Everything works well until the prepare_bemmodel command. When using the dipoli executable script, I receive an error that says I have duplicate vertices (and looking at vol.bnd.pnt, it looks like I do have a few vertices with the same coordinates). I have also tried using the "brainstorm" option for calculating the bem model, but although it runs without error, the script ends with a keyboard command and no system matrix is added to the vol variable. I am pretty new at this (so forgive me if I'm missing something simple). Thanks. Massih Hamidi ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From A.Stolk at EWI.UTWENTE.NL Tue Dec 9 11:26:22 2008 From: A.Stolk at EWI.UTWENTE.NL (A. Stolk) Date: Tue, 9 Dec 2008 11:26:22 +0100 Subject: volumesegment in BEM model Message-ID: Hi there, Using the example script 'create bemmodel for eeg', I keep struggling with the volumesegment part. mri = read_fcdc_mri('t1_icbm_normal_1mm_pn0_rf0.mnc'); cfg = []; seg = volumesegment(cfg, mri); And when I add commands like, cfg.write = 'no'; cfg.coordinates = 'spm'; cfg.template = '\fieldtrip-20081015\spm5\templates\T1.mnc'; I receive the same errors related to the file's dimensions, namely; ??? Error using ==> spm_slice_vol Wrong sized dim. Error in ==> spm_read_vols at 35 Y(:,:,p,i) = spm_slice_vol(V(i),spm_matrix([0 0 p]),V(i).dim(1:2),0); Error in ==> read_fcdc_mri at 107 img = spm_read_vols(hdr); Error in ==> bemmodelfieldtrip at 14 mri = read_fcdc_mri('t1_icbm_normal_1mm_pn0_rf0.mnc'); I got this error using multiple fieldtrip versions. p.s. Also did have to add the spm_slice_vol.mexw32 file, found in the spm2 update. Regards, Arjen ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Tue Dec 9 15:54:27 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Tue, 9 Dec 2008 15:54:27 +0100 Subject: Problem running source grand average a nd source statistics Message-ID: Hi Jan-Matthijs, hi Ingrid, dear listusers thanks for your help with the problem of sparsified data. I have meanwhile managed to "fix" sourcegrandaverage simply by telling it to use something like Nvoxel = length(dataset.stat) (dirty hack I know...). But it seems that sourcestatistics isn't fooled that easily and I am getting a bit lost moving from subfunction to subfunction. And I was just wondering whether working with sparse data and reverse transformed, irregular grids in sourcestatistics is something anyone else is still doing (we'd like to keep on doing it to have corresponding virtual electrodes over subjects). ... and whether my problems are possibly related to the fact that I am trying to use the 'stat' field instead of the 'pow' field in sourcestatistics. In version 20081203 and 20081208 there is also again a bug that makes sourcestatistics complain about a missing dim field.: ?? Reference to non-existent field 'dim'. Error in ==> fieldtrip-20081208/private/statistics_wrapper>get_source_trial at 621 fprintf('only selecting voxels inside the brain for statistics (%.1f%%)\n', 100*length(varargin{1}.inside)/prod(varargin{1}.dim)); Error in ==> fieldtrip-20081208/private/statistics_wrapper at 290 [dat, cfg] = get_source_trial(cfg, varargin{:}); Error in ==> sourcestatistics at 155 stat = statistics_wrapper(cfg, varargin{:}); Error in ==> NewDICSAnalysis200809_01 at 559 SourceStat = sourcestatistics(cfg,RawSources ); My code is still the same as posted below, the section it complains about now used to run smoothly with the November versions. It seems as if the dim field is not being added when using the reverse transformed grid from the tutorial. Any help appreciated Michael > -----Ursprüngliche Nachricht----- > Von: "jan-mathijs schoffelen" > Gesendet: 05.11.08 15:36:05 > An: FIELDTRIP at NIC.SURFNET.NL > Betreff: Re: [FIELDTRIP] Problem running source grand average a nd source statistics > Hi Michael, > > > stat: [3297x1 double] > > This indicates that your singlesubjects are indeed sparsified, so > that when you getsubfield this guy, you end up with fewer data-points > than expected (which is Nvoxel==prod(dim)). > > Does this give you enough guidelines to fix it? > > JM > > > On Nov 5, 2008, at 1:50 PM, Michael Wibral wrote: > > > Dear Ingrid, dear Jan-Mathijs > > > > I guess Ingrid is indeed correct, as all my datasets have the same > > dimension of the stat field and of the inside/outside fields. I was > > actually also supplying the dim field from the template to all > > datasets, so the product of dims' should be the same everywhere, > > but that hasn't really solved the problem. The length of the inside > > field is 3297, the outside field is 3129, their sum is 6426 which > > is identical to the product of dimensions of the template grid > > which are 17 x 21 x 18 =6426. So I am really a bit puzzled here... > > > > Anyway, here's the code I use, maybe someone a really stupid error, > > that I simply overlooked: > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % FIRST I prepare a file with the data and the settings for the > > statistics that is later read in again: > > % datapath = '/data/home1/ctillman/data/MooneyMEEGFieldtripAnalysis/ > > DICSBeamformingMW200808/Stats/'; > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > DesignData1 = { > > 'ABA04_Up_StatSources.mat' > > 'IFS20_Up_StatSources.mat'; > > 'IKE28_Up_StatSources.mat'; > > 'JHA07_Up_StatSources.mat'; > > 'JPA05_Up_StatSources.mat'; > > 'MKA21_Up_StatSources.mat'; > > 'MMA07_Up_StatSources.mat'; > > 'PSS16_Up_StatSources.mat'; > > 'SNI05_Up_StatSources.mat'; > > 'UWA31_Up_StatSources.mat'; > > > > }; > > > > DesignData2 = { > > 'ABA04_In_StatSources.mat'; > > 'IFS20_In_StatSources.mat'; > > 'IKE28_In_StatSources.mat'; > > 'JHA07_In_StatSources.mat'; > > 'JPA05_In_StatSources.mat'; > > 'MKA21_In_StatSources.mat'; > > 'MMA07_In_StatSources.mat'; > > 'PSS16_In_StatSources.mat'; > > 'SNI05_In_StatSources.mat'; > > 'UWA31_In_StatSources.mat'; > > > > }; > > > > % The statistics configuration > > cfg = []; > > nSubjects = min(length(DesignData1),length(DesignData2)); > > a = [1:nSubjects]; > > b = ones(1,nSubjects); > > cfg.design = [a a; b (2*b)]; > > cfg.ivar = 2; % independent variable: condition > > cfg.uvar = 1; % subjects > > cfg.method = 'montecarlo'; > > cfg.correctm = 'cluster'; > > cfg.clusteralpha = 0.01; > > cfg.alpha = 0.05; > > cfg.clusterstatistic = 'maxsum'; > > cfg.numrandomization = 500; %2000; > > cfg.threshold = 0.01; > > cfg.parameter = 'stat'; > > cfg.statistic = 'depsamplesT'; > > > > % create output file > > OutFileName = strcat(datapath,'DesignStat2008_11_04.mat'); > > save(OutFileName, 'DesignData1', 'DesignData2', 'cfg', 'datapath'); > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > % SECOND I read in this file and the template and try to perform > > grandaveraging and sourcestatistics at the second level: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > > > function [] = StatisticsDICS(DesignStatLCMVFile); > > > > > > template = load('/data/home1/ctillman/data/ > > MooneyMEEGFieldtripAnalysis/DICSBeamformingMW200808/Grids/ > > MNItemplate_231008_-1p5iws.mat'); > > Nx = length(template.template_grid.xgrid) > > Ny = length(template.template_grid.ygrid) > > Nz = length(template.template_grid.zgrid) > > > > load(DesignStatLCMVFile); % contains datapath, DesignData1, > > DesignData2, cfg > > > > % Load Data from DesignData1,2 automatically ensuring matching sizes > > % please ensure that data pairs are OK if using paired statistics ! > > > > > > for i = 1:min(length(DesignData1),length(DesignData2)) > > m=strcat('loading dataset#:', num2str(2*i-1)); > > disp(m); > > fullname1 = strcat(datapath,DesignData1{i,1}); > > Data1{i} = load(fullname1); > > m=strcat('loading dataset#:', num2str(2*i)); > > disp(m); > > fullname2 = strcat(datapath,DesignData2{i,1}); > > Data2{i} = load(fullname2); > > end > > > > % Fixing the structure properties > > > > for l = 1:size(Data1,2) > > > > Data1{l}.SourceStat.xgrid = template.template_grid.xgrid; > > Data1{l}.SourceStat.ygrid = template.template_grid.ygrid; > > Data1{l}.SourceStat.zgrid = template.template_grid.zgrid; > > Data1{l}.SourceStat.dim = [Nx Ny Nz]; > > Data1{l}.SourceStat.pos = template.template_grid.pos; > > Data1{l}.SourceStat.inside = template.template_grid.inside; > > Data1{l}.SourceStat.outside = template.template_grid.outside; > > Data1{l} = Data1{l}.SourceStat; > > > > > > Data2{l}.SourceStat.xgrid = template.template_grid.xgrid; > > Data2{l}.SourceStat.ygrid = template.template_grid.ygrid; > > Data2{l}.SourceStat.zgrid = template.template_grid.zgrid; > > Data2{l}.SourceStat.dim = [Nx Ny Nz]; > > Data2{l}.SourceStat.pos = template.template_grid.pos; > > Data2{l}.SourceStat.inside = template.template_grid.inside; > > Data2{l}.SourceStat.outside = template.template_grid.outside; > > Data2{l} = Data2{l}.SourceStat; > > > > end > > > > % prepare the statistics by computing the grandaverage with individual > > % subject data retained > > % Compute grand average for Condition 1 and 2 > > cfgGA = []; > > cfgGA.keepindividual = 'yes'; > > cfgGA.parameter='stat'; > > % create command strings for the computaion: > > commandstr1 = strcat ('DataGA1', '=sourcegrandaverage(cfgGA'); > > commandstr2 = strcat ('DataGA2', '=sourcegrandaverage(cfgGA'); > > > > for l = 1 : length(Data1) > > commandstr1 = strcat(commandstr1, ',Data1{', num2str(l) , '}'); > > commandstr2 = strcat(commandstr2, ',Data2{', num2str(l) , '}'); > > end > > % finalize command strings > > commandstr1=strcat(commandstr1,');') > > commandstr2=strcat(commandstr2,');') > > eval(commandstr1) % yields DataGA1; > > eval(commandstr2) % yields DataGA2; > > > > clear Data1; clear Data2; % no longer needed we now have DataGA1,2 > > > > %SourceStatsitics cfg is known from the design file! > > sourceStat = sourcestatistics(cfg, DataGA1, DataGA2); > > OutFilename = ... > > strcat(datapath, > > 'SourceStatisticsLCMV_denoisedDataAndNewGrids_1000rand_',DesignData1 > > {i,1}(7:end-4),'_calpha',num2str(cfg.clusteralpha), > > '_alpha_',num2str(cfg.alpha),'.mat'); > > save(OutFilename, 'sourceStat'); > > > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > %%%%%%%%%%%%%%%%%%% > > > > > > Here's the inforamtion from the datasets and the template: > > > > Information of a dataset after processing/preparing for > > sourcegrandaverage: > > > > > > stat: [3297x1 double] > > df: 134 > > critval: [-1.9778 1.9778] > > prob: [3297x1 double] > > mask: [3297x1 logical] > > dim: [17 21 18] > > inside: [1x3297 double] > > outside: [1x3129 double] > > pos: [6426x3 double] > > cfg: [1x1 struct] > > xgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 > > 70 80] > > ygrid: [-120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 > > 10 20 30 40 50 60 70 80] > > zgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 > > 70 80 90] > > > > Information of the template: > > xgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80] > > ygrid: [-120 -110 -100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 > > 10 20 30 40 50 60 70 80] > > zgrid: [-80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 > > 70 80 90] > > dim: [17 21 18] > > pos: [6426x3 double] > > inside: [1x3297 double] > > outside: [1x3129 double] > > > > The onlz thing that I see varying fron dataset to dataset is the df > > field. > > > > Any help appreciated, > > Michael > > > > > >> -----Ursprüngliche Nachricht----- > >> Von: "Ingrid Nieuwenhuis" > >> Gesendet: 05.11.08 14:02:04 > >> An: FIELDTRIP at NIC.SURFNET.NL > >> Betreff: Re: [FIELDTRIP] Problem running source grand average and > >> source statistics > > > > > >> Dear Michael and Jan-Mathijs, > >> > >> If the same procedure is followed as on the wiki, the inside of > >> the template > >> grid is copied to the single subjects, so by definition also the > >> 'sparsified' single subjects sources should all have the same > >> amount of > >> (inside) voxels. So point 2 J-M raised can't be it, point 1 could > >> well be: > >> Because in line 115 dat's size is defined as (Nvoxels, Nsubj) and > >> Nvoxels is > >> the product of the dim. > >> > >> Best Ingrid > >> > >> -----Original Message----- > >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > >> On Behalf > >> Of jan-mathijs schoffelen > >> Sent: Wednesday, November 05, 2008 10:20 AM > >> To: FIELDTRIP at NIC.SURFNET.NL > >> Subject: Re: [FIELDTRIP] Problem running source grand average and > >> source > >> statistics > >> > >> Dear Michael, > >> > >> I agree with you that a likely cause is that the Nvoxel (which is > >> based on the dimensionality of the first singlesubject-source in the > >> input) varies across subjects. However, this would be strange, > >> because you use the same dipole grid for all subjects. On the other > >> hand: could it be that you 'sparsified' the single subjects? Each > >> subject could have a slightly different number of 'inside' positions. > >> This obviously leads to problems: > >> 1 because the Nvoxel is incorrect in the first place (it's the > >> product of the dim, so the input is assumed to be full 3D, or a > >> linear array with all outside voxels present (either as nans or zeros > >> or whichever number you fancy). > >> 2 because the length of the array per subject varies. > >> > >> Hope this helps, > >> > >> Jan-M > >> > >> > >> > >> On Nov 4, 2008, at 5:35 PM, Michael Wibral wrote: > >> > >>> Dear list users, > >>> > >>> I am having a problem running, source grandaverage and source > >>> statistics (over multiple subjects) on the output of > >>> soucrestatistictics (from multiple trials in single subjects). > >>> > >>> I ran first sourceanalysis supplying the backwads warped grids (as > >>> described in the wiki) to compute filters. Then I ran source > >>> analysis again to extract the single trial source images and the > >>> ran sourcestatistitics on this to get the single subject > >>> statistical images - all this runs fine. I then supply the pos (and > >>> dim) data of the template grid to each structure, replacing the > >>> original pos data (that do not match and of course prohibit using > >>> sourceststatistics and sourcegrandaverage). When trying to do > >>> either a source grand average or a sourcestatistics at the > >>> multisubject level I get the same error: > >>> > >>> subscripted assignment dimension mismatch > >>> dat(:,i) = tmp(:); > >>> > >>> Error in ==> sourcegrandaverage at 173 > >>> > >>> > >>> The corresponding lines of code in sourcegrandaverage are: > >>> > >>> % get the source parameter from each input source reconstruction > >>> % get the inside parameter from each input source reconstruction > >>> for i=1:Nsubject > >>> % TODO this function should use parameterselection > >>> if issubfield(varargin{i}, ['avg.' cfg.parameter]) > >>> tmp = getsubfield(varargin{i}, ['avg.' cfg.parameter]); > >>> else > >>> tmp = getsubfield(varargin{i}, cfg.parameter); > >>> end > >>> dat(:,i) = tmp(:); > >>> tmp = getsubfield(varargin{i}, 'inside'); > >>> inside(tmp,i) = 1; > >>> end > >>> > >>> I get an identical error when using sourcestatistics at the > >>> multisubject level. > >>> The variable dat(:,i) is created like this: > >>> dat = zeros(Nvoxel, Nsubject) > >>> > >>> > >>> I suspect that somehow trying to use the 'stat' instead of the > >>> power parameter is a problem (TODO?) or that Nvoxel somehow differs > >>> over the various subjects ?? > >>> > >>> Any advice on what to try and test further would very much > >>> appreciated. > >>> > >>> Thanks in advance, > >>> Michael > >>> > >>> > >>> ---------------------------------- > >>> The aim of this list is to facilitate the discussion between users > >>> of the FieldTrip toolbox, to share experiences and to discuss new > >>> ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > >>> archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > >>> fieldtrip. > >> > >> ---------------------------------- > >> The aim of this list is to facilitate the discussion between users > >> of the > >> FieldTrip toolbox, to share experiences and to discuss new ideas > >> for MEG > >> and EEG analysis. See also > >> http://listserv.surfnet.nl/archives/fieldtrip.html and > >> http://www.ru.nl/fcdonders/fieldtrip. > >> > >> ---------------------------------- > >> The aim of this list is to facilitate the discussion between users > >> of the FieldTrip toolbox, to share experiences and to discuss new > >> ideas for MEG and EEG analysis. See also http:// > >> listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/ > >> fcdonders/fieldtrip. > >> > > > > > > > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > > of the FieldTrip toolbox, to share experiences and to discuss new > > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/ > > archives/fieldtrip.html and http://www.ru.nl/fcdonders/ > > fieldtrip. > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Thu Dec 11 17:02:14 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 11 Dec 2008 17:02:14 +0100 Subject: bug in freqanalysis_mtmfft in case of non-dpss tapers and variable trial length Message-ID: Dear all, I just identified and fixed a bug in freqanalysis_mtmfft. The bug caused an incorrect scaling of non-dpss tapers in case of variable trial length. Multitapers (cfg.taper=dpss) are not affected, and data in which all trials are of equal length are also not affected. The bug became apparent to me when I compared hanning-tapered power estimates in which some trials were missing some samples versus the same data in which all trials were of exactly equal length. The power difference between those two was a factor ~100x, whereas the difference was that in one condition the data of a few trials was one sample too short. The consequence of the taper not being scaled/normalized correctly is that all frequencies are multiplied by a fixed amount. The overall shape of the power spectrum will not look different, it is just multiplied with a fixed amount. Comparing two datasets with variable trial length for both conditions is also not affected (the absolute power values will both be off with a similar factor). There are cases thinkeable in which the bug will have caused problems in the subsequent analysis, e.g. in the data that I was analyzing. The problem was quite obvious: a factor ~100 difference between the power spectra in the two conditions, where that factor 100 was frequency aspecific. Sorry for the inconvenience that it may have caused. best regards, Robert PS for the external users: the fixed version will be uploaded to the ftp server this evening around 22h CET. ----------------------------------------------------------- Robert Oostenveld Senior Researcher Donders Institute for Brain, Cognition and Behaviour Centre for Cognitive Neuroimaging Radboud University Nijmegen tel.: +31 (0)24 3619695 e-mail: r.oostenveld at donders.ru.nl web: http://www.ru.nl/neuroimaging ----------------------------------------------------------- ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From amano at BRAIN.K.U-TOKYO.AC.JP Fri Dec 12 07:02:25 2008 From: amano at BRAIN.K.U-TOKYO.AC.JP (Kaoru Amano) Date: Fri, 12 Dec 2008 15:02:25 +0900 Subject: Transformation from head to MEG coordinate In-Reply-To: <91FE2963-4911-4996-B0AD-0B8909BE6DA6@fcdonders.ru.nl> Message-ID: Dear all We are using Yokogawa's MEG system and are trying to do source localization using fieldtrip. In "prepare_leadfield.m", dipole grid is supposed to be provided in head coordinate, while sensor location is defined in MEG coordinate. For the registration between head and MEG coordinates, we need to specify the information of head positioning, in which we get MEG coordinates of three markers. Could you tell me how we can specify the information of head positioning? Best, Kaoru -- Kaoru Amano email: amano at brain.k.u-tokyo.ac.jp URL: http://www.brain.k.u-tokyo.ac.jp/~amano/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From v.litvak at ION.UCL.AC.UK Fri Dec 12 07:41:12 2008 From: v.litvak at ION.UCL.AC.UK (Vladimir Litvak) Date: Fri, 12 Dec 2008 06:41:12 +0000 Subject: Transformation from head to MEG coordinate In-Reply-To: <4941FE71.1060501@brain.k.u-tokyo.ac.jp> Message-ID: Dear Kaoru, 1) There is no requirement to provide the grid in head coordinates. vol, grid and sensors can be in any coordinate system as long as it is the same system. 2) What do you use to read sensor positions and fiducials for Yokogawa? The code available in Fieldtrip at the moment is incomplete and would not allow you to use the beamformer. If you have something better, we'd be very interested in integrating your code. 3) There are some functions in Fieldtrip to do coregistration. Look at electroderealign and interactiverealign. 4) SPM8b (http://www.fil.ion.ucl.ac.uk/spm/software/spm8b/) which is very well integrated with Fieldtrip has some facilities for coregistering sensors and head models using GUI. The resulting coregistered volume in sensors can be used for beamforming in Fieldtrip. But this wil only work with proper Yokogawa support which we lack at the moment. Best, Vladimir On Fri, Dec 12, 2008 at 6:02 AM, Kaoru Amano wrote: > Dear all > > We are using Yokogawa's MEG system and are trying to do source localization > using fieldtrip. > > In "prepare_leadfield.m", dipole grid is supposed to be provided in head > coordinate, while sensor location is defined in MEG coordinate. For the > registration between head and MEG coordinates, we need to specify the > information of head positioning, in which we get MEG coordinates of three > markers. > > Could you tell me how we can specify the information of head positioning? > > > Best, > Kaoru > > > > -- > Kaoru Amano > email: amano at brain.k.u-tokyo.ac.jp > URL: http://www.brain.k.u-tokyo.ac.jp/~amano/ > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the > FieldTrip toolbox, to share experiences and to discuss new ideas for MEG > and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. > > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marco.sperduti at UPMC.FR Fri Dec 12 12:20:31 2008 From: marco.sperduti at UPMC.FR (Marco SPERDUTI) Date: Fri, 12 Dec 2008 12:20:31 +0100 Subject: group sources statistics Message-ID: Dear users, once i've done sources statistics for a single subject, is there a way to do it on the group keeping subjects informations? thank you, 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/fcdonders/fieldtrip. From wibral at BIC.UNI-FRANKFURT.DE Fri Dec 12 17:37:12 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Fri, 12 Dec 2008 17:37:12 +0100 Subject: Problems with second level source statistics for multi plew subjects and firsty level stats - solved :-) Message-ID: Dear listusers, in several previous mails I have reported about problems occuring when: 1) doing single subjects source analysis using reverse-normalized grids (thanks to Ingrid's tutorial), common filters for the two conditions and generating single trial source data 2) then performing single subject sourcestatistics (getting a sparse data representation with a stat field) 3) then doing second level sourcestatistics (which didn't work) I am happy to report these problems are solved :-). I actually just overlooked a WARNING:... when doing single subject sourceanalysis and sourcestatistics (1st level) is says that you yourself have to add a dim field by hand, when trying to use clusterrandanalysis/sourcestatistics later. I now simply added a dim field to both, to the data and to the cfg for the second level source statistics. The correct choice for this dim field are the dimension of the original, orthogonal, regular grid in MNI space and everything works now. I just didn't realize that dim can't be all that easily generated automatically by fieldtrip for sparse data and *warped* grids. This is because the warping could - in principle - be such that dim doesn't make any sense anymore, e.g. because points (almost) switch places along a certain dimension (if they differ in the other coordinates). So neighborhood relations are not well defined a priori in sparse data. Hence, the need for a manual addition of dim in this case (please correct me me if any of the above is wrong). The version I used and that I can confirm to work was 20081208. Many thanks for all your support, Michael ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From mhamidi at WISC.EDU Sat Dec 13 00:56:53 2008 From: mhamidi at WISC.EDU (Massih Hamidi) Date: Sat, 13 Dec 2008 00:56:53 +0100 Subject: error with sourceanalysis Message-ID: I am running the "localizing oscillatory sources using beamformer techniques" tutorial on my EEG data (imported from EEGlab) using the mnc t1 template MRI (as described in the "Create BEM headmodel for EEG" tutorial). However, I get an error when running sourceinterpolate (?? Attempted to access sel(1); index out of bounds because numel(sel)=0.) When I plotted the output of sourceanalysis (without the anatomical mri), I get a strange pattern (attached). I then tried to run prepare_leadfield with cfg.mri (create the dipole grid based on segmented mri) and I was able to successfully run sourceanalysis and sourceitnerpolate, but the map of power estimates look nothing like what is shown in the tutorial (also attached). Plotting the data and time-frequency analysis results seem fine, so I don't think it's an import or freqanalysis problem. Any ideas on what's wrong? Thanks. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: sourcepost.jpg Type: image/jpeg Size: 25321 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sourcepostwithMRIbasedgrid.jpg Type: image/jpeg Size: 61407 bytes Desc: not available URL: From nathanweisz at MAC.COM Sat Dec 13 18:15:16 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Sat, 13 Dec 2008 18:15:16 +0100 Subject: problems while calculating leadfield Message-ID: hi, i have a problem while performing prepare_leadfield. the data is some old CTF data i collected ~2 years ago. i calculated a multisphere model in fieldtrip using prepare_localspheres. this step works (i.e. i get a vol structure that looks ok in my opinion). however when continuing with prepare_leadfield the the program crashes. here's the code: cfg=[]; cfg.grid.xgrid='auto'; cfg.grid.ygrid='auto'; cfg.grid.zgrid='auto'; cfg.vol=vol; cfg.channel='MEG'; cfg.grad=dataCLeConI.grad; cfg.inwardshift=0; cfg.grid.resolution=1; cfg.reducerank=2; lf=prepare_leadfield(cfg); i get this error message: ??? Error using ==> prepare_headmodel at 301 synthetic gradients not supported during volume conductor setup Error in ==> prepare_leadfield at 223 [vol, sens, cfg] = prepare_headmodel(cfg, data); Error in ==> newcat_calcgrid at 52 lf=prepare_leadfield(cfg); i messed around with different headmodels just to see how prepare_leadfield behaves: *when the headmodel is a single sphere (cfg.singlesphere='yes') prepare_leadfield works fine *when using the nolte headmodel (via prepare_singleshell), prepare_leadfield does not crash, but the leadfields contain only NaN ... is that perhaps related to the issue above? again, any help is greatly appreciated. best, nathan -------------------------------------------- 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/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Mon Dec 15 11:36:54 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Dec 2008 11:36:54 +0100 Subject: error with sourceanalysis In-Reply-To: Message-ID: My first suspicion is that there there is a problem with the coordinate system, e.g. that you express one geometrical object (the mri) in mm and the other geometrical object (the volume conduction model, the eelctrode positions or the source positions) in cm. Please use the headmodelplot function to check that the electrodes, volume conduction model and sources are appropriately aligned to each other. Plotting those together with the MRI is difficult, but you can look at the positions as numbers and check that those are epressed in mm. best regards Robert On 13 Dec 2008, at 0:56, Massih Hamidi wrote: > I am running the "localizing oscillatory sources using beamformer > techniques" tutorial on my EEG data (imported from EEGlab) using the > mnc t1 > template MRI (as described in the "Create BEM headmodel for EEG" > tutorial). > > However, I get an error when running sourceinterpolate (?? Attempted > to > access sel(1); index out of bounds because numel(sel)=0.) > When I plotted the output of sourceanalysis (without the anatomical > mri), I > get a strange pattern (attached). > > I then tried to run prepare_leadfield with cfg.mri (create the > dipole grid > based on segmented mri) and I was able to successfully run > sourceanalysis > and sourceitnerpolate, but the map of power estimates look nothing > like what > is shown in the tutorial (also attached). > > Plotting the data and time-frequency analysis results seem fine, so > I don't > think it's an import or freqanalysis problem. Any ideas on what's > wrong? > Thanks. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marco.sperduti at UPMC.FR Mon Dec 15 11:42:06 2008 From: marco.sperduti at UPMC.FR (Marco SPERDUTI) Date: Mon, 15 Dec 2008 11:42:06 +0100 Subject: regions of interest for source statistics Message-ID: Dear all, I would like to define regions of interest for sources statistics. I found on the sourcestatics tutorial that i have to define these parameters: cfg.atlas = filename of the atlas cfg.roi = cell-array with labels according to the atlas cfg.avgoverroi = 'yes' or 'no' (default = 'no') cfg.hemisphere = 'left', 'right', 'both', 'combined', cfg.inputcoord = 'mni' or 'tal' what can I use as atlas? Do you have an example script for doing that? thank you all, 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/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Dec 15 13:39:22 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Dec 2008 13:39:22 +0100 Subject: problems while calculating leadfield In-Reply-To: <75FE5F2D-C449-4E04-8553-AA2266DEC889@mac.com> Message-ID: Hi Nathan Each MEG channel consists of two coils, one with a weight of +1 and the other with a weight of -1. For a synthetic 3rd order gradiometer system, also the reference coils are weighted and part of the signal picked up at the reference channels is subtracted from the normal MEG channels. That means that the reference coils also get a weight in the output of a MEG channel. For setting up the volume conduction model in case of a multi-sphere model, for each _coil_ the corresponding sphere has to be determined. For the bottom and top coil (with the +1 and -1 weight) the two spheres are the same and correspond to the sphere fitted to the scalp under that channel. In case of the 3rd order synthetic gradiometer data, the reference coils also have a (small) weight, which means that also for those coils a "local" sphere has to be identified. At the moment assigning local spheres to the reference coils is not yet supported in the code. Probably the best would be to use the local spheres for the 2 meg coils and to use a single sphere that is fitted to the complete headshape (i.e. the "single sphere") for the reference coils. It requires some work though to get the bookkeeping of all coils and all spheres correct. A better solution (and the one we use here at the FCDC) might be to use prepare_singleshell instead of prepare_localspheres. The singleshell volume conduction model also approximates the geometry with a realistic shape, but is better for the lower part of the brain. In short, there are no disadvantages(*) in the singleshell model compared to the localspheres model, but only advantages. best regards, Robert *) expect perhaps that it is computationally slightly slower, and that the localspheres can also be constructed with a polhemus measured head surface, whereas the singleshell requires a segmented anatomical MRI. On 13 Dec 2008, at 18:15, Nathan Weisz wrote: > i have a problem while performing prepare_leadfield. > the data is some old CTF data i collected ~2 years ago. i calculated > a multisphere model in fieldtrip using prepare_localspheres. this > step works (i.e. i get a vol structure that looks ok in my opinion). > however when continuing with prepare_leadfield the the program > crashes. > > here's the code: > cfg=[]; > cfg.grid.xgrid='auto'; > cfg.grid.ygrid='auto'; > cfg.grid.zgrid='auto'; > cfg.vol=vol; > cfg.channel='MEG'; > cfg.grad=dataCLeConI.grad; > cfg.inwardshift=0; > cfg.grid.resolution=1; > cfg.reducerank=2; > > lf=prepare_leadfield(cfg); > > i get this error message: > ??? Error using ==> prepare_headmodel at 301 > synthetic gradients not supported during volume conductor setup > > Error in ==> prepare_leadfield at 223 > [vol, sens, cfg] = prepare_headmodel(cfg, data); > > Error in ==> newcat_calcgrid at 52 > lf=prepare_leadfield(cfg); > > i messed around with different headmodels just to see how > prepare_leadfield behaves: > *when the headmodel is a single sphere (cfg.singlesphere='yes') > prepare_leadfield works fine > *when using the nolte headmodel (via prepare_singleshell), > prepare_leadfield does not crash, but the leadfields contain only > NaN ... is that perhaps related to the issue above? > > again, any help is greatly appreciated. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From nathanweisz at MAC.COM Mon Dec 15 14:25:39 2008 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Mon, 15 Dec 2008 14:25:39 +0100 Subject: problems while calculating leadfield In-Reply-To: <8D72E95C-87AF-4873-85CE-79BF2690562F@fcdonders.ru.nl> Message-ID: hi robert, thanks for your help. i tried the singleshell option, but calculating the leadfield still makes problems. here some code: cfg=[]; %cfg.grad=dataCLeConI.grad; %cfg.grad.pnt=dataCLeConI.grad.pnt; cfg.headshape=hs; %hs nx3 in cm vol=prepare_singleshell(cfg); This seems to work fine: K>> vol vol = bnd: [1x1 struct] type: 'nolte' K>> vol.bnd.pnt(1:3,:) ans = -3.2750 -4.6410 -0.8710 -3.2750 -4.6410 -0.8710 -0.8710 -5.8870 -0.9760 K>> vol.bnd.tri(1:3,:) ans = 935 843 936 912 1007 911 1803 1802 1692 However when I attempt to calculate the leadfield: cfg=[]; cfg.grid.xgrid=[-20:1:20]; cfg.grid.ygrid=[-20:1:20]; cfg.grid.zgrid=[0:1:20]; cfg.vol=vol; cfg.channel={'MEG'}; cfg.grad=dataCLeConI.grad; cfg.reducerank=2; lf=prepare_leadfield(cfg); I get following error: using headmodel specified in the configuration using gradiometers specified in the configuration computing surface normals Warning: Divide by zero. > In normals at 60 In prepare_headmodel at 323 In prepare_leadfield at 223 In newcat_calcgrid at 39 Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In meg_ini>getcoeffs at 94 In meg_ini at 36 In prepare_headmodel at 329 In prepare_leadfield at 223 In newcat_calcgrid at 39 creating dipole grid based on user specified 3D grid 2256 dipoles inside, 33045 dipoles outside brain computing leadfield computing leadfield 1/2256 ??? Error using ==> svd Input to SVD must not contain NaN or Inf. Error in ==> compute_leadfield at 484 [u, s, v] = svd(lf); Error in ==> prepare_leadfield at 242 grid.leadfield{dipindx} = compute_leadfield(grid.pos(dipindx,:), sens, vol, 'reducerank', cfg.reducerank, 'normalize', cfg.normalize, 'normalizeparam', cfg.normalizeparam); Is there something special in the function call I have to consider when calculating leadfields using singleshell? Cheers, nathan On 15.12.2008, at 13:39, Robert Oostenveld wrote: > Hi Nathan > > Each MEG channel consists of two coils, one with a weight of +1 and > the other with a weight of -1. For a synthetic 3rd order gradiometer > system, also the reference coils are weighted and part of the signal > picked up at the reference channels is subtracted from the normal > MEG channels. That means that the reference coils also get a weight > in the output of a MEG channel. > > For setting up the volume conduction model in case of a multi-sphere > model, for each _coil_ the corresponding sphere has to be > determined. For the bottom and top coil (with the +1 and -1 weight) > the two spheres are the same and correspond to the sphere fitted to > the scalp under that channel. In case of the 3rd order synthetic > gradiometer data, the reference coils also have a (small) weight, > which means that also for those coils a "local" sphere has to be > identified. At the moment assigning local spheres to the reference > coils is not yet supported in the code. > > Probably the best would be to use the local spheres for the 2 meg > coils and to use a single sphere that is fitted to the complete > headshape (i.e. the "single sphere") for the reference coils. It > requires some work though to get the bookkeeping of all coils and > all spheres correct. > > A better solution (and the one we use here at the FCDC) might be to > use prepare_singleshell instead of prepare_localspheres. The > singleshell volume conduction model also approximates the geometry > with a realistic shape, but is better for the lower part of the > brain. In short, there are no disadvantages(*) in the singleshell > model compared to the localspheres model, but only advantages. > > best regards, > Robert > > *) expect perhaps that it is computationally slightly slower, and > that the localspheres can also be constructed with a polhemus > measured head surface, whereas the singleshell requires a segmented > anatomical MRI. > > > > On 13 Dec 2008, at 18:15, Nathan Weisz wrote: > >> i have a problem while performing prepare_leadfield. >> the data is some old CTF data i collected ~2 years ago. i >> calculated a multisphere model in fieldtrip using >> prepare_localspheres. this step works (i.e. i get a vol structure >> that looks ok in my opinion). however when continuing with >> prepare_leadfield the the program crashes. >> >> here's the code: >> cfg=[]; >> cfg.grid.xgrid='auto'; >> cfg.grid.ygrid='auto'; >> cfg.grid.zgrid='auto'; >> cfg.vol=vol; >> cfg.channel='MEG'; >> cfg.grad=dataCLeConI.grad; >> cfg.inwardshift=0; >> cfg.grid.resolution=1; >> cfg.reducerank=2; >> >> lf=prepare_leadfield(cfg); >> >> i get this error message: >> ??? Error using ==> prepare_headmodel at 301 >> synthetic gradients not supported during volume conductor setup >> >> Error in ==> prepare_leadfield at 223 >> [vol, sens, cfg] = prepare_headmodel(cfg, data); >> >> Error in ==> newcat_calcgrid at 52 >> lf=prepare_leadfield(cfg); >> >> i messed around with different headmodels just to see how >> prepare_leadfield behaves: >> *when the headmodel is a single sphere (cfg.singlesphere='yes') >> prepare_leadfield works fine >> *when using the nolte headmodel (via prepare_singleshell), >> prepare_leadfield does not crash, but the leadfields contain only >> NaN ... is that perhaps related to the issue above? >> >> again, any help is greatly appreciated. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html > and http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From r.oostenveld at FCDONDERS.RU.NL Mon Dec 15 15:51:19 2008 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Dec 2008 15:51:19 +0100 Subject: scaling plexon *.nex data changed Message-ID: Dear plexon nex users I have modified the scaling of the data from plexon nex files in the corresponding low-level functions by a factor of 1000x. It turned out that this data was scaled as milivolt/mV, whereas for allmost all other formats fieldtrip uses microvolt/uV scaling for the data. To ensure consistency, I have changed the scaling for reading and writing plexon nex files to now also use microvolts. Please be aware of this when you compare computations done with different versions of fieldtrip, and when interpreting your figures. best regards, Robert ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From marco.sperduti at UPMC.FR Mon Dec 15 18:33:03 2008 From: marco.sperduti at UPMC.FR (Marco SPERDUTI) Date: Mon, 15 Dec 2008 18:33:03 +0100 Subject: regions of interest for source statistics 2 Message-ID: Hi all, i'm trying to define ROI for sourcestatistic using wfu_pickatlas (i've also tried with AFNI) but i always have this error: ??? Error using ==> read_fcdc_mri unrecognized filetype of 'wfu_pickatlas' Error in ==> atlas_init at 536 atlas = read_fcdc_mri(filename); % /home/... works, ~/.... does not work Error in ==> statistics_wrapper at 217 atlas = atlas_init(cfg.atlas); Error in ==> sourcestatistics at 152 stat = statistics_wrapper(cfg, varargin{:}); that's my code: cfg.atlas = 'wfu_pickatlas'; cfg.roi = {'Inferior Parietal Lobule' ; 'Superior Temporal Gyrus'}; cfg.hemisphere = 'both'; cfg.inputcoord = 'mni'; any idea? thank you, 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/fcdonders/fieldtrip. From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Dec 16 22:23:46 2008 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 16 Dec 2008 22:23:46 +0100 Subject: regions of interest for source statistics In-Reply-To: <20081215114206.hpr3cztnw4s4888k@courriel.upmc.fr> Message-ID: Dear Marco, You can use the AFNI brik file that is available from http://afni.nimh.nih.gov/afni/doc/misc/ttatlas_tlrc , or use one of the WFU atlases available from http://fmri.wfubmc.edu For cfg.atlas you then specify the whole path to the atlas for instance: cfg.atlas = /matlab/wfu_pickatlas/MNI_atlas_templates/aal_MNI_V4.img'; cfg.roi should be the name (or names) of the ROIs. You can use prepare_atlas to see the precise names of the atlas you're using. Note: The data on which you want to do sourcestatistics has to be normalized to the MNI or Talairach coordinate system. All the best, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Marco SPERDUTI Sent: Monday, December 15, 2008 11:42 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] regions of interest for source statistics Dear all, I would like to define regions of interest for sources statistics. I found on the sourcestatics tutorial that i have to define these parameters: cfg.atlas = filename of the atlas cfg.roi = cell-array with labels according to the atlas cfg.avgoverroi = 'yes' or 'no' (default = 'no') cfg.hemisphere = 'left', 'right', 'both', 'combined', cfg.inputcoord = 'mni' or 'tal' what can I use as atlas? Do you have an example script for doing that? thank you all, 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/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jackm_ustc at YAHOO.COM.CN Thu Dec 18 21:47:35 2008 From: jackm_ustc at YAHOO.COM.CN (SUBSCRIBE FIELDTRIP Jack M.) Date: Thu, 18 Dec 2008 21:47:35 +0100 Subject: Trouble in recompiling the Fieldtrip Message-ID: Hello, I met exactly the same problem as listed on the Fieldtrip wiki under the FAQ section "Matlab complains about a missing or invalid MEX file, what should I do?" So I followed the instruction on that wiki and tried to recompile the binaries. I am using an iMac (OS X 10.5.5) and Matlab2007b. When I tried mex meg_leadfield1.c , the error message said, " /Applications/MATLAB_R2007b/bin/mex: line 1025: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 1004: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 930: gcc-4.0: command not found mex: compile of 'meg_leadfield1.c' failed. ??? Error using ==> mex at 208 Unable to complete successfully. " I am a newbie. Could anyone please give me a solution? Thanks a lot! ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jackm_ustc at YAHOO.COM.CN Thu Dec 18 21:55:03 2008 From: jackm_ustc at YAHOO.COM.CN (Alan Yi) Date: Fri, 19 Dec 2008 04:55:03 +0800 Subject: Trouble in recompiling the fieldtrip Message-ID: Hello, I met exactly the same problem as listed on the Fieldtrip wiki under the FAQ section "Matlab complains about a missing or invalid MEX file, what should I do?" So I followed the instruction and tried to recompile the fieldtrip binaries. However, an error message appeared: >> mex meg_leadfield1.c /Applications/MATLAB_R2007b/bin/mex: line 1025: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 1004: gcc-4.0: command not found /Applications/MATLAB_R2007b/bin/mex: line 930: gcc-4.0: command not found     mex: compile of 'meg_leadfield1.c' failed. ??? Error using ==> mex at 208 Unable to complete successfully. I am a newbie. Could anyone please tell me how to do? I am using Matlab2007b on my iMac (OS X 10.5.5). Thanks a lot! ___________________________________________________________ 好玩贺卡等你发,邮箱贺卡全新上线! http://card.mail.cn.yahoo.com/ ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jedmeltzer at YAHOO.COM Fri Dec 19 21:36:44 2008 From: jedmeltzer at YAHOO.COM (Jed Meltzer) Date: Fri, 19 Dec 2008 12:36:44 -0800 Subject: dealing with missing channels in group cluster analysis Message-ID: Hi, I'm interested in using the cluster-based randomization statistical functions in fieldtrip, on EEG data that I've already mostly processed using other software. I have power spectra from multiple conditions, already averaged within subjects, and I want to do cross-subject comparisons, i.e. a paired t-test with two conditions in each subject. I think for this I could use "timelockstatistics" and just trick the software into thinking that the input is timepoints rather than frequency components (this is from windowed fourier spectra, with no time dimension). If anyone sees any problem with that, please let me know, but otherwise I'll move on to my problem... So I'm trying to put my data into the same format as that used in the tutorial example. I have 24 subjects, 34 electrodes, and 257 frequency points, so it looks like I need to contstruct for each condition a data structure with a field like: data.individual: 24x34x257 Now, my problem is that in a few subjects there are some missing channels. Some channels in the course of the experiment are deemed unacceptably noisy and excluded from analysis. This is all kept track of in my processing schemes, but how can I deal with it here, when I need to fill in the full array? Normally I would fill in the missing space with NaN, but I'm not sure that the cluster analysis programs in field trip can deal with NaN. Maybe it wouldn't be such a big deal to change them? I've thought about doing it myself, but I'm afraid I would miss something due to unfamiliarity with the code. But it seems like functions such as statfun_depsamplesT.m (which I'm using) call matlab functions like mean() and var(), when they could easily call nanmean() and nanvar() (from the statistics toolbox) instead. One would have to check for NaN data and adjust the degrees of freedom as well. Do you think there's any hope for this? Or would you suggest a different approach? Just please don't say "interpolate the missing channels" or I will have to bang my head against the wall... -Jed Jed A. Meltzer, Ph.D. Postdoctoral Fellow, Language Section, Voice, Speech, and Language Branch National Institute on Deafness and Other Communication Disorders, National Institutes of Health 10 Center Drive, Building 10, Rm 5C410, Bethesda, MD 20892-1065 301-435-5144 meltzerj at nidcd.nih.gov ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jrkerlin at UCDAVIS.EDU Fri Dec 19 22:41:53 2008 From: jrkerlin at UCDAVIS.EDU (Jess R. Kerlin) Date: Fri, 19 Dec 2008 13:41:53 -0800 Subject: Problems with second level source statistics for multi plew subjects and firsty level stats - solved :-) In-Reply-To: <853421468@web.de> Message-ID: Dear FTrippers, I've been replicating the beamformer tutorial to the letter, and arrived at problem which may be related to the one described below. Running : stat = sourcestatistics(cfg, sourceSTAT); Gives the error: ??? Index of element to remove exceeds matrix dimensions. Error in ==> /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m (get_source_trial) On line 443 ==> dat((j-1).*dim(1) + varargin{1}.outside, :) = []; Error in ==> /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m On line 179 ==> [dat, cfg] = get_source_trial(cfg, varargin{:}); Error in ==> /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/sourcestatistics.m On line 127 ==> stat = statistics_wrapper(cfg, varargin{:}); My sourceSTAT.trial(1).pow is a 1 by 2652 double array (so the dim in get_source_trial is the same) , which may or may not be the proper dimensions for pow (sourceSTAT.dim = [17 13 12] ). If not, exactly how/where would I add the proper dim field? I've also tried running freqanalysis and sourcestatistics with a recent release (20081218), with the same results. Any advice would be greatly appreciated. Thanks, Jess Michael Wibral wrote: > Dear listusers, > > in several previous mails I have reported about problems occuring when: > > 1) doing single subjects source analysis using reverse-normalized grids (thanks to Ingrid's tutorial), common filters for the two conditions and generating single trial source data > 2) then performing single subject sourcestatistics (getting a sparse data representation with a stat field) > 3) then doing second level sourcestatistics (which didn't work) > > I am happy to report these problems are solved :-). I actually just overlooked a WARNING:... when doing single subject sourceanalysis and sourcestatistics (1st level) is says that you yourself have to add a dim field by hand, when trying to use clusterrandanalysis/sourcestatistics later. I now simply added a dim field to both, to the data and to the cfg for the second level source statistics. The correct choice for this dim field are the dimension of the original, orthogonal, regular grid in MNI space and everything works now. > > I just didn't realize that dim can't be all that easily generated automatically by fieldtrip for sparse data and *warped* grids. This is because the warping could - in principle - be such that dim doesn't make any sense anymore, e.g. because points (almost) switch places along a certain dimension (if they differ in the other coordinates). So neighborhood relations are not well defined a priori in sparse data. Hence, the need for a manual addition of dim in this case (please correct me me if any of the above is wrong). > > The version I used and that I can confirm to work was 20081208. > > Many thanks for all your support, > Michael > > > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From jrkerlin at UCDAVIS.EDU Sat Dec 20 01:14:05 2008 From: jrkerlin at UCDAVIS.EDU (Jess R. Kerlin) Date: Fri, 19 Dec 2008 16:14:05 -0800 Subject: Problems with second level source statistics for multi plew subjects and firsty level stats - solved :-) In-Reply-To: <494C1521.6070805@ucdavis.edu> Message-ID: Regarding my previous email: I got the tutorial code to move forward by editing source_wrapper. I don't know if this is a bug or something else is wrong which will nail me later. Editing get_source_trial in source_wrapper : if isfield(varargin{1}, 'inside') fprintf('only selecting voxels inside the brain for statistics (%.1f%%)\n', 100*length(varargin{1}.inside)/prod(varargin{1}.dim)); % for j=prod(dim(2:end)):-1:1 comment out; jk % dat((j-1).*dim(1) + varargin{1}.outside, :) = []; jk dat(varargin{1}.outside, :) = 0; % replaced formula jk % end comment out; jk end Cheers, Jess Jess R. Kerlin wrote: > Dear FTrippers, > > I've been replicating the beamformer tutorial to the letter, and > arrived at problem which may be related to the one described below. > > Running : > stat = sourcestatistics(cfg, sourceSTAT); > > Gives the error: > > ??? Index of element to remove exceeds matrix dimensions. > > Error in ==> > /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m > (get_source_trial) > On line 443 ==> dat((j-1).*dim(1) + varargin{1}.outside, :) = []; > > Error in ==> > /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/private/statistics_wrapper.m > On line 179 ==> [dat, cfg] = get_source_trial(cfg, varargin{:}); > > Error in ==> > /home/jrkerlin/matlab/EEGLAB/fieldtrip-0.9.8/sourcestatistics.m > On line 127 ==> stat = statistics_wrapper(cfg, varargin{:}); > > My sourceSTAT.trial(1).pow is a 1 by 2652 double array (so the dim in > get_source_trial is the same) , which may or may not be the proper > dimensions for pow (sourceSTAT.dim = [17 13 12] ). If not, exactly > how/where would I add the proper dim field? > > I've also tried running freqanalysis and sourcestatistics with a > recent release (20081218), with the same results. > > Any advice would be greatly appreciated. > > Thanks, > Jess > > Michael Wibral wrote: >> Dear listusers, >> >> in several previous mails I have reported about problems occuring when: >> >> 1) doing single subjects source analysis using reverse-normalized >> grids (thanks to Ingrid's tutorial), common filters for the two >> conditions and generating single trial source data 2) then performing >> single subject sourcestatistics (getting a sparse data representation >> with a stat field) >> 3) then doing second level sourcestatistics (which didn't work) >> >> I am happy to report these problems are solved :-). I actually just >> overlooked a WARNING:... when doing single subject sourceanalysis and >> sourcestatistics (1st level) is says that you yourself have to add a >> dim field by hand, when trying to use >> clusterrandanalysis/sourcestatistics later. I now simply added a dim >> field to both, to the data and to the cfg for the second level source >> statistics. The correct choice for this dim field are the dimension >> of the original, orthogonal, regular grid in MNI space and everything >> works now. >> >> I just didn't realize that dim can't be all that easily generated >> automatically by fieldtrip for sparse data and *warped* grids. This >> is because the warping could - in principle - be such that dim >> doesn't make any sense anymore, e.g. because points (almost) switch >> places along a certain dimension (if they differ in the other >> coordinates). So neighborhood relations are not well defined a priori >> in sparse data. Hence, the need for a manual addition of dim in this >> case (please correct me me if any of the above is wrong). >> >> The version I used and that I can confirm to work was 20081208. >> >> Many thanks for all your support, >> Michael >> >> >> >> ---------------------------------- >> The aim of this list is to facilitate the discussion between users of >> the FieldTrip toolbox, to share experiences and to discuss new ideas >> for MEG and EEG analysis. See also >> http://listserv.surfnet.nl/archives/fieldtrip.html and >> http://www.ru.nl/fcdonders/fieldtrip. >> > > ---------------------------------- > The aim of this list is to facilitate the discussion between users of > the FieldTrip toolbox, to share experiences and to discuss new ideas > for MEG and EEG analysis. See also > http://listserv.surfnet.nl/archives/fieldtrip.html and > http://www.ru.nl/fcdonders/fieldtrip. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. From lmoranr at GMAIL.COM Sat Dec 27 13:35:31 2008 From: lmoranr at GMAIL.COM (=?ISO-8859-1?Q?Luis_Mor=E1n?=) Date: Sat, 27 Dec 2008 13:35:31 +0100 Subject: Problem with DipoleSimulation Message-ID: Dear collegues! I'm new on fieldtrip so I'd be very pleased if someone could help me. I have a problem while using dipolesimulation. I'm trying to make a simulation with 2 dipoles. I introduce the position as a 2-by-3 matrix, and the moment as a 3-by-2. My problem comes when the leadfield is calculated. lf is m-by-n matrix where m is the number of channels and n is 2*number of dipoles. Then, in the script this lf is multiplied by dipmom (a 3-by-Ndipoles matrix) and by dippos (a N-dipoles -by- 3). So this operation only works when we have only one dipole. Thanks in advance -- Luis Morán Rodríguez Altentic lmoran at altentic.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/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.schoffelen at PSY.GLA.AC.UK Mon Dec 29 10:36:50 2008 From: j.schoffelen at PSY.GLA.AC.UK (jan-mathijs schoffelen) Date: Mon, 29 Dec 2008 09:36:50 +0000 Subject: Problem with DipoleSimulation Message-ID: > From: jan-mathijs schoffelen > Date: December 29, 2008 9:22:40 AM BST > To: FieldTrip discussion list > Subject: Re: [FIELDTRIP] Problem with DipoleSimulation > > > Dear Luis, > > The trick is to define the moment-matrix as 6-by-2, i.e. nx3-by-n. > It should look like this: > > [Mx 0 > My 0 > Mz 0 > 0 Mx2 > 0 My2 > 0 Mz2] > > In this case the matrix-multiplication should work out fine. > > Best, > > Jan-Mathijs > > > On Dec 27, 2008, at 12:35 PM, Luis Morán wrote: > >> Dear collegues! >> >> I'm new on fieldtrip so I'd be very pleased if someone could help me. >> >> I have a problem while using dipolesimulation. I'm trying to make >> a simulation with 2 dipoles. I introduce the position as a 2-by-3 >> matrix, and the moment as a 3-by-2. >> >> My problem comes when the leadfield is calculated. lf is m-by-n >> matrix where m is the number of channels and n is 2*number of >> dipoles. Then, in the script this lf is multiplied by dipmom (a 3- >> by-Ndipoles matrix) and by dippos (a N-dipoles -by- 3). So this >> operation only works when we have only one dipole. >> >> Thanks in advance >> >> -- >> Luis Morán Rodríguez >> >> Altentic >> >> lmoran at altentic.com >> ---------------------------------- >> >> The aim of this list is to facilitate the discussion between users >> of the FieldTrip toolbox, to share experiences and to discuss new >> ideas for MEG and EEG analysis. >> >> http://listserv.surfnet.nl/archives/fieldtrip.html >> >> http://www.ru.nl/fcdonders/fieldtrip/ >> > > ---------------------------------- > > The aim of this list is to facilitate the discussion between users > of the FieldTrip toolbox, to share experiences and to discuss new > ideas for MEG and EEG analysis. > > http://listserv.surfnet.nl/archives/fieldtrip.html > > http://www.ru.nl/fcdonders/fieldtrip/ > ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wibral at BIC.UNI-FRANKFURT.DE Tue Dec 30 15:49:31 2008 From: wibral at BIC.UNI-FRANKFURT.DE (Michael Wibral) Date: Tue, 30 Dec 2008 15:49:31 +0100 Subject: Job Offer in Frankfurt / Germany Message-ID: Dear colleagues, please find attached below an offer for a position in EEG analysis in Frankfurt/Germany: The research center IDeA (Individual Development and Adaptive Education) in collaboration with the Brain Imaging Center Frankfurt (BIC) offers a position with focus on analysis of EEG data collected longitudinally from children at the age of 6 - 12 years. These data should be combined with fMRI as well as DTI data collected from the same participants. Candidates should have a solid expertise in EEG data analysis. Experience in one or more relevant domains will be considered an advantage: - source analysis - connectivity analysis - time-frequency analysis - combination of EEG and fMRI/DTI data - programming skills (Matlab, C++) The contract will run until June 2011 (renewable). Salary (BAT IIa or BAT IIa/2) depends on qualification and years of working experience. Qualified scientists are encouraged to apply by submitting a motivation letter and a CV to Prof. Dr. Marcus Hasselhorn - Scientific Coordinator IDeA Schloßstraße 29 60486 Frankfurt am Main Phone: +49 69 24708 214 Fax: +49 69 24708 216 Email : hasselhorndipf.de as well as to: Michael Wibral, PhD - Lab Manager MEG Unit Core Structure Brain Imaging Center Frankfurt J.W. Goethe University Heinrich Hoffmann Strasse 10 60528 Frankfurt am Main Phone: +49 69 6301 83193 +49 69 6301 83192 Fax: +49 69 6301 83231 email: wibralbic.uni-frankfurt.de ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip. -------------- next part -------------- A non-text attachment was scrubbed... Name: Michael Wibral.vcf Type: text/x-vcard Size: 344 bytes Desc: not available URL: From susannah.murphy at PSYCH.OX.AC.UK Tue Dec 30 15:49:59 2008 From: susannah.murphy at PSYCH.OX.AC.UK (Susannah Murphy) Date: Tue, 30 Dec 2008 14:49:59 +0000 Subject: Job Offer in Frankfurt / Germany In-Reply-To: <866243563@web.de> Message-ID: Thanks for your message. I am away until Monday 12th January. ---------------------------------- The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.