From cgra05 at HST.AUC.DK Thu Jun 1 12:34:31 2006 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 1 Jun 2006 12:34:31 +0200 Subject: SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? In-Reply-To: <003e01c68493$c1b918f0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid, OH - sorry, I didn't notice the question had already been asked on the webpage. However, I still couldn't find the answer on how to create the values for column 2 and 3, since it says at the webpage "The 2nd and 3rd are the X-position and Y-position". However, when I generate the layout file from Neuroscan I get some values for the X and Y coordinates, that are very different from yours, and the plot ends up in a big mess (see the attached file). So I was wondering if you have any idea of how to generate the X- and Y-positions from Neuroscan ??? (I have attached the generated layout-file from Neuroscan, in case that helps you. This one is named test128_neuroscan.lay) We were also wondering about the figure you e-mailed from our data, all channels appeared to be blue with a green cone (and then some frequency contributions in some channels). Is it because of some settings not edited correct, because we would have expected something like in the documentation - like figure 2 at the "Time-frequency Analysis Using Multitapers and Wavelets" page. >>From the test128_neuroscan.lay I tried to create the layout file test128_fieldtrip.lay, and got the plot shown in figure test128_fieldtrip.png Best regards, Carina Graversen -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 31. maj 2006 10:23 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, If you look at the FieldTrip page -> documentation -> frequently asked questions you can find the question (and answer): What is the format of the layout file, which is used for plotting? ...The 4th and 5th column specify the with and height of the subplot that will be made in multiplotER and multiplotTFR.... So the two columns with the same value for all channels are those columns. Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Wednesday, May 31, 2006 10:58 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Ingrid. Thanks a lot. I have tried to generate my own layout file in Neuroscan, but unfortunately it doesn't work. So I was wondering if you can tell me the format of the layout-file, because when I look at your file, 2 of the columns contain the same value for all channels. I have tried to generate for both cartesian and polor, but none of them matches. In the generated file I get the format: Can I change my input configuration to either use this format, or how should I change the format of the layout file ??? Thanks in advance :o) /Carina -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 26. maj 2006 13:29 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, Thanks for sending me the data. Indeed the biosemi 128ch layout doesn't correspond to your layout. You have 128 channels labeled from 1 to 128. If you open biosemi128.lay in a text-editor you can see that this layout file has 150 channels labeled from A1 to P7. The labels in your data (TFRmult.label) and the labels in the layout file don't match, that's why you got an empty figure (I'll add an error in the plot function, so that when no labels match you'll get an error message in the future). So what you have to do now is to make your own layout file that matches the data; with the correct x and y coordinates of the 128 channels and the same label names as in your data. Just as an illustration I attached an adapted version of the biosemi128.lay file, with only the first 128 channels, and labels 1 to 128, just as in your data. With the following configuration: cfg8 = []; cfg8.baseline = [0 0.1]; cfg8.xlim = [0 0.3] cfg8.ylim = [15 29]; cfg8.zlim = [-100 100]; cfg8.showlabels = 'yes'; cfg8.layout = 'testlay128.lay'; I got the attached figure from your data. Good luck, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: Wednesday, May 24, 2006 8:57 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina Are you sure that the biosemi 128ch layout corresponds with your electrode layout? Open the layout file in a tetx editor and look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#what_is_the_format _of_the_layout_file_which_is_used_for_plotting I suggest that you try the elec1010.lay or elec1005.lay, or even better, that you construct your own layout file corresponding with your own electrode locations. Robert On 24 May 2006, at 12:29, Carina Graversen wrote: > Hi. > > I'm trying to use the Fieldtrip program to create a wavelet plot of > my EEG > data. > > I have used it previously for 64 channel recordings, but now I'm > working > with 128 channels of data, which is causing me some problems. The > only thing > I have changed is the command: > cfg8.layout = 'biosemi128.lay'; > > But now the figure only outputs a grey page with no Time-Frequency > distributions at all. > > Can anyone tell me what I'm doing wrong - below is a complete list > of all > the commands I use :o). > > Best Regards, > Carina Graversen > > > > > % > ********************************************************************** > *** > % EVENTRELATEDAVERAGING > % > ********************************************************************** > *** > cfg1 = []; % empty > configuration > cfg1.datafile = 'test128.eeg'; % > 128 channel > Neuroscan eeg file > cfg1.headerfile = 'test128.eeg'; > cfg1.channel = 'all'; > > dataFIC = preprocessing(cfg1); % > Preprocess! > > cfg2 = []; % empty > configuration > > avgFIC = timelockanalysis(cfg2, dataFIC); > > > % % > ********************************************************************** > *** > % % WAVELET > % % > ********************************************************************** > *** > cfg7 = []; > cfg7.output = 'pow'; > cfg7.method = 'wltconvol' > cfg7.foi = 1:2:30; > cfg7.t_ftimwin = 5./cfg7.foi; > cfg7.tapsmofrq = 0.4 *cfg7.foi; > cfg7.toi = 0:0.01:0.5; > > TFRmult = freqanalysis(cfg7, avgFIC); > > cfg8 = []; > cfg8.baseline = [-0.5 0.5]; > cfg8.xlim = [0 0.5] > cfg8.zlim = [-3e-27 0.2]; > cfg8.showlabels = 'yes'; > cfg8.layout = 'biosemi128.lay'; > > multiplotTFR(cfg8, TFRmult); > -------------- next part -------------- A non-text attachment was scrubbed... Name: test128_neuroscan.lay Type: application/octet-stream Size: 7368 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test128_fieldtrip.png Type: image/png Size: 4916 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testlay128_fieldtrip.lay Type: application/octet-stream Size: 5173 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Thu Jun 1 12:35:43 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 1 Jun 2006 12:35:43 +0200 Subject: Filtering In-Reply-To: <000001c683f3$4e30cb30$90514484@dellgx240> Message-ID: Hi Vladimir On 30 May 2006, at 16:14, Vladimir Litvak wrote: > As I understand, when I do filtering in preprocessing the filter is > applied before the data is cut to epochs. Not completely: a segment of data is read from file that contains the trial (trl) plus the optional padding. That segment is filtered and then the padding is thrown away. Eventual filter atrifacts at the boundaries of the data segment that was read are in the padding and thus would not affect the data of interest itself. If you apply padding, the effect is the same as if you would have filtered the complete data continuously. > I now want to do some analysis where I want to filter after the > epochs are cut out (because there are TMS deltas there and I don't > want them to affect everything around them). Is there a simple way > to filter epoched data in FT (other than by my own code)? You can specify cfg.padding=0 in preprocessing and ensure that the TMS pulse is not inside the trial definition. You can do preprocessing without any options and then use timelockanalysis (with keeptrials) on it. Timelockanalysis supports almost all options that preprocessing has, i.e. all filtering and baselinecorection options, but of course cannot do the padding. Those additional options are not documented in timelockanalysis, but look in the code and you will see them. Doing it in timelockanalysis has the advantage that it is easier to play around with filter settings (i.e. it is faster not having to read the data every time). Also interesting to know perhaps is that you can also apply timelockanalysis and its filtering to an average, i.e. timelockanalysis will accept a timelock-structure as input. So you can average in the first call to timelockanalysis, and then throw that average into timelockanalysis a second time to see the effect of the filter. In the latter case only the average is filtered, i.e. it is very fast. best Robert From ingrid.nieuwenhuis at FCDONDERS.RU.NL Thu Jun 1 13:21:11 2006 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 1 Jun 2006 13:21:11 +0200 Subject: SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? In-Reply-To: Message-ID: Hi Carina, The problem is that the width and height of the boxes (column 4 and 5) are too big compared to your x and y coordinates. What multiplotTFR does is that it plots the TFR boxes at the specified coordinates. The x and y coordinates are between +/- 0 and 0.7 and the box width/height is 0.18 and 1.14, so all the plots are plotted on top of each other. That's why it is a mess. So you could use the x and y coordinates, but the boxes should be smaller, or you can scale it al up. What comes out of the plots is just what the data is. Probably depends on your settings during the TFR analysis. The dark blue at the edges and bottom are NaN's in the data. Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Thursday, June 01, 2006 12:35 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Ingrid, OH - sorry, I didn't notice the question had already been asked on the webpage. However, I still couldn't find the answer on how to create the values for column 2 and 3, since it says at the webpage "The 2nd and 3rd are the X-position and Y-position". However, when I generate the layout file from Neuroscan I get some values for the X and Y coordinates, that are very different from yours, and the plot ends up in a big mess (see the attached file). So I was wondering if you have any idea of how to generate the X- and Y-positions from Neuroscan ??? (I have attached the generated layout-file from Neuroscan, in case that helps you. This one is named test128_neuroscan.lay) We were also wondering about the figure you e-mailed from our data, all channels appeared to be blue with a green cone (and then some frequency contributions in some channels). Is it because of some settings not edited correct, because we would have expected something like in the documentation - like figure 2 at the "Time-frequency Analysis Using Multitapers and Wavelets" page. >>From the test128_neuroscan.lay I tried to create the layout file test128_fieldtrip.lay, and got the plot shown in figure test128_fieldtrip.png Best regards, Carina Graversen -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 31. maj 2006 10:23 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, If you look at the FieldTrip page -> documentation -> frequently asked questions you can find the question (and answer): What is the format of the layout file, which is used for plotting? ...The 4th and 5th column specify the with and height of the subplot that will be made in multiplotER and multiplotTFR.... So the two columns with the same value for all channels are those columns. Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Wednesday, May 31, 2006 10:58 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Ingrid. Thanks a lot. I have tried to generate my own layout file in Neuroscan, but unfortunately it doesn't work. So I was wondering if you can tell me the format of the layout-file, because when I look at your file, 2 of the columns contain the same value for all channels. I have tried to generate for both cartesian and polor, but none of them matches. In the generated file I get the format: Can I change my input configuration to either use this format, or how should I change the format of the layout file ??? Thanks in advance :o) /Carina -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 26. maj 2006 13:29 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, Thanks for sending me the data. Indeed the biosemi 128ch layout doesn't correspond to your layout. You have 128 channels labeled from 1 to 128. If you open biosemi128.lay in a text-editor you can see that this layout file has 150 channels labeled from A1 to P7. The labels in your data (TFRmult.label) and the labels in the layout file don't match, that's why you got an empty figure (I'll add an error in the plot function, so that when no labels match you'll get an error message in the future). So what you have to do now is to make your own layout file that matches the data; with the correct x and y coordinates of the 128 channels and the same label names as in your data. Just as an illustration I attached an adapted version of the biosemi128.lay file, with only the first 128 channels, and labels 1 to 128, just as in your data. With the following configuration: cfg8 = []; cfg8.baseline = [0 0.1]; cfg8.xlim = [0 0.3] cfg8.ylim = [15 29]; cfg8.zlim = [-100 100]; cfg8.showlabels = 'yes'; cfg8.layout = 'testlay128.lay'; I got the attached figure from your data. Good luck, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: Wednesday, May 24, 2006 8:57 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina Are you sure that the biosemi 128ch layout corresponds with your electrode layout? Open the layout file in a tetx editor and look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#what_is_the_format _of_the_layout_file_which_is_used_for_plotting I suggest that you try the elec1010.lay or elec1005.lay, or even better, that you construct your own layout file corresponding with your own electrode locations. Robert On 24 May 2006, at 12:29, Carina Graversen wrote: > Hi. > > I'm trying to use the Fieldtrip program to create a wavelet plot of > my EEG > data. > > I have used it previously for 64 channel recordings, but now I'm > working > with 128 channels of data, which is causing me some problems. The > only thing > I have changed is the command: > cfg8.layout = 'biosemi128.lay'; > > But now the figure only outputs a grey page with no Time-Frequency > distributions at all. > > Can anyone tell me what I'm doing wrong - below is a complete list > of all > the commands I use :o). > > Best Regards, > Carina Graversen > > > > > % > ********************************************************************** > *** > % EVENTRELATEDAVERAGING > % > ********************************************************************** > *** > cfg1 = []; % empty > configuration > cfg1.datafile = 'test128.eeg'; % > 128 channel > Neuroscan eeg file > cfg1.headerfile = 'test128.eeg'; > cfg1.channel = 'all'; > > dataFIC = preprocessing(cfg1); % > Preprocess! > > cfg2 = []; % empty > configuration > > avgFIC = timelockanalysis(cfg2, dataFIC); > > > % % > ********************************************************************** > *** > % % WAVELET > % % > ********************************************************************** > *** > cfg7 = []; > cfg7.output = 'pow'; > cfg7.method = 'wltconvol' > cfg7.foi = 1:2:30; > cfg7.t_ftimwin = 5./cfg7.foi; > cfg7.tapsmofrq = 0.4 *cfg7.foi; > cfg7.toi = 0:0.01:0.5; > > TFRmult = freqanalysis(cfg7, avgFIC); > > cfg8 = []; > cfg8.baseline = [-0.5 0.5]; > cfg8.xlim = [0 0.5] > cfg8.zlim = [-3e-27 0.2]; > cfg8.showlabels = 'yes'; > cfg8.layout = 'biosemi128.lay'; > > multiplotTFR(cfg8, TFRmult); > From r.oostenveld at FCDONDERS.RU.NL Thu Jun 1 13:51:02 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 1 Jun 2006 13:51:02 +0200 Subject: SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? In-Reply-To: Message-ID: Hi Carina, Please take attached "layoutplot" function and copy it into the fieldtrip directory. Then do >> cfg.layout = 'CTF151.lay' cfg = layout: 'CTF151.lay' >> layoutplot(cfg) reading layout from file CTF151.lay and you will get the attached figure for the 151 channel CTF system. Then try plotting the other layouts (the *.lay files) and your own layout, and modify the values in your own layout file (in a text editor) untill you like what you see. Robert PS when I was looking at the other layouts, I noticed that the elec1020, elec1010 and elec1005 layouts supplied with fieldtrip are not optimal, since they also have overlapping boxes. -------------- next part -------------- A non-text attachment was scrubbed... Name: layoutplot.m Type: application/octet-stream Size: 998 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 1.png Type: image/png Size: 27957 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Thu Jun 1 13:58:48 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 1 Jun 2006 13:58:48 +0200 Subject: query on coherence source analysis In-Reply-To: Message-ID: Dear Muthuraman I have not been able to reproduce your error. I suggest that you get the latest version of FieldTrip from our FTP server and try again. best egards, Robert PS this is the test script I used. It uses some simulated data, which again uses a MEG gradiometer definition and a head model from the tutorial data. ----------------- % read some data that is required to simulate MEG data, i.e. volume model, % sensor positions and MRI (optional, only for plotting) vol = read_ctf_hdm('Subject01.hdm'); hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); grad = hdr.grad; % construct the simulated MEG data for condition A ("active") cfg = []; cfg.vol = vol; cfg.grad = grad; cfg.fsample = 300; cfg.ntrials = 2; cfg.triallength = 1; cfg.dip.pos = [0 7 8]; cfg.dip.mom = [1 0 0]; cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); cfg.absnoise = 1e-8; data = dipolesimulation(cfg); % add the source signal as fake EMG channel for i=1:cfg.ntrials data.trial{i}(end+1,:) = cfg.dip.signal + randn(size (cfg.dip.signal)); end data.label{end+1} = 'EMG'; cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'MEG' 'EMG'},data.label); cfg.channelcmb={'MEG' 'EMG'}; freq=freqanalysis(cfg,data); From olga at GRAPHICMIND.INFO Sat Jun 3 12:45:41 2006 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Sat, 3 Jun 2006 14:45:41 +0400 Subject: deleting two EOG channale from data-stucture Message-ID: Dear list members, I would like to delete two channels from my data. How is it better to do this? Best Regards, Olga -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga at GRAPHICMIND.INFO Sat Jun 3 14:16:57 2006 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Sat, 3 Jun 2006 16:16:57 +0400 Subject: and clusterrandomization Message-ID: Thank you very much, Eric! That was an inconsistency in the loci of EOG channels between subjects. Now I corrected it: HEOG and VEOG data are still presented in the data structure, but do not have the location (pnt 0 0 0). Is it OK? The results looks as what I excpected. Best Regards, Olga. ----- Original Message ----- From: "Eric Maris" To: Sent: Friday, May 26, 2006 5:35 PM Subject: Re: [FIELDTRIP] and clusterrandomization > Dear Olga, > > > But the problems is still in my clusterrandomization. > Could the fact that the order of the channel in the file (C_vc11.label) is > not the same as in the C_vc11.elec.label influences the result of > clusterrandomization (I do not have my neigbouring channel file)? > > > That should not matter. However, the labels in your data structure (.label > in the output of timelockgrandaverage) should exactly match the labels in > the elec-structure. If that is OK, then something might have gone wrong > with the combination of the data of the different subjects. Do they all > have the same elec-structure? If the same physical channel has different > labels for different subjects, then this may create inconsistencies > between EEGlab and Fieldtrip. For Fieldtrip, channels that have the same > label are assumed to be physically identical, even if they are in > different positions in the data structure. This is only a guess, of > course. > > > kind regards, > > Eric Maris > > > > > > > > > > Best Regards, > Olga. > ----- Original Message ----- > From: Ingrid Nieuwenhuis > To: FIELDTRIP at NIC.SURFNET.NL > Sent: Wednesday, May 24, 2006 8:45 PM > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > Hi Olga, > > > > About the z-param: > > This is the field that contains the data to be plotted; for instance > 'avg', 'powspctrm' or 'cohspctrm'. Normally the function looks in your > data.dimord to find out which z-param to use. To make the function work > you could give cfg.zparam = 'avg' (for instance if you want to plot an > ERF/ERP). But if you could send me what the dimord field of the data that > you want to plot is, I could look why the plot functions don't extract the > correct zparam themselves. > > > > About the timelockgranaveraging: I also think it should be the same. I > have no idea what it could be. > > > > Good luck, > > Ingrid Nieuwenhuis > > > > > ------------------------------------------------------------------------------ > > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Olga Sysoeva > Sent: Wednesday, May 24, 2006 5:44 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > > Dear List member, > > > > Sorry for such dull questions but, > > I am again facing the new problems with Fieldtrip, although did not solve > some previous one (still can not singleplot and multiplot anything 'cause > of "unknown zparam field". > > > > OK, about new one :-) > > > > It seems that I did not use write the timelockgranaveraging. > > > > The problem must be here, when I made grand averaging of all my 11 > subject > data > > cfg =[]; > cfg.keepindividual = 'yes' > C_vc11 = > > timelockgrandaverage(cfg,vc_c_avg1,vc_c_avg2,vc_c_avg3,vc_c_avg4,vc_c_avg5, > vc_c_avg6,vc_c_avg7,vc_c_avg8,vc_c_avg9,vc_c_avg10,vc_c_avg11 ); > > As I understand the > > vc_c_avg11.avg([9],[43]) should be similar with C_vc11.individual ([11], > [9], [43]) > But it is not. > What can it be? > > Best Regards, > > Olga. > > > > > > ----- Original Message ----- > > From: Olga Sysoeva > > To: FIELDTRIP at NIC.SURFNET.NL > > Sent: Saturday, May 13, 2006 4:34 PM > > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > > Thank you very much, Lilla! > > Now I knwo what to do but faced the problem with " unknown zparam > field" when ploting the results. Unfortunatly cfg.zparam does not > discribed in help file... > > Best Regards, Olga > > ----- Original Message ----- > > From: Lilla Magyari > > To: FIELDTRIP at NIC.SURFNET.NL > > Sent: Saturday, May 13, 2006 3:11 PM > > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data > within-subject > > > > Dear Olga, > > > > I am just studying time-frequency analysis but I have done already on > my data, so perhaps I can help you. > > First, yes, you have to do freqanalysis on the preprocessed data of > the individual subjects for all conditions that you want to compare (i.e. > the input for this function contains all trials from one subject in one > condition.) And it is also important that the other input for this > function is the cfg where for example, in the cfg.method you have to > specify what kind of time-frequency analysis you want to use. (You have to > write 'wltconvol' for wavelet transformation and 'mltconvol' for > multitaper analysis.) > > When you use freqanalysis as output you can get TFR for one subject > in one condition (but it is also possible to keep the information for the > individual trials of the condition by specifying cfg.keeptrials = 'yes'). > When you have the TFRs for each subject you can grandaverage them with > freqgrandaverage where the input is the TFRs of all subjects (and before > averaging you can use also freqbaseline for giving a baseline for your > TFRs). > > > > I hope it helps. > > > > Best regards, > > Lilla Magyari > > > > > > > > > -------------------------------------------------------------------------- > > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Olga Sysoeva > Sent: Saturday, May 13, 2006 9:28 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > > Dear list members, > > > > Thank you everybody for your help! I've already got interesting > results using clusterrandomization on my data! Thanks a lot! > > > > Now I have a question about using the clusterrandomization on 3-D > data (channel-time-frequency) in within-subject analysis. > > As I understand it is possible with Fieldtrip, but I really newby in > time-frequency anlysis, therefore wanted your comments, > > as far as I didn't find the example of the application of > clusteranalysis on this set of the data in tuturial. > > > > I successfully conduct the within-subject clusterrandomization on my > grand-average data, which does not have the third, frequency demintion. > > Now I want to add it. But I could not apply freqanalyisis on > grandavarage data, could I? Should I made the TFR of individual data and > than grand-avarage the result? > > Which function should I use? > > > > Best Regards, > > Olga. From olga at GRAPHICMIND.INFO Sat Jun 3 14:26:35 2006 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Sat, 3 Jun 2006 16:26:35 +0400 Subject: clusrand: 19 channels 0 minnbchan Message-ID: Dear experts, Does it make sense to make clusterrandomization if I put "0" in the min number of neibouring channels if I have only 19 of them (10-20 system)? As I understand in this case just the time is considered when clustering. How many consequent time point is requiered to build a cluster? Best Regards, Olga. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Sat Jun 3 18:47:21 2006 From: maris at NICI.RU.NL (Eric Maris) Date: Sat, 3 Jun 2006 18:47:21 +0200 Subject: deleting two EOG channale from data-stucture Message-ID: Dear Olga, I would like to delete two channels from my data. How is it better to do this? Type "help channelselection" at the Matlab command line. This will give you information on how the Fieldtrip functions perform channelselection on the basis of the input in cfg.channel. I don't have Matlab running now, but I think that '-EOG' in cfg.channel will do the job you request. greetings, Eric From maris at NICI.RU.NL Sat Jun 3 18:50:06 2006 From: maris at NICI.RU.NL (Eric Maris) Date: Sat, 3 Jun 2006 18:50:06 +0200 Subject: and clusterrandomization Message-ID: Dear Olga, > That was an inconsistency in the loci of EOG channels between subjects. > Now I corrected it: HEOG and VEOG data are still presented in the data > structure, but do not have the location (pnt 0 0 0). Is it OK? The results > looks as what I excpected. Because you never will include the EOG-channels in an analysis of the EEG-channels, the location of the EOG is not required by clusterrandanalysis. greetings, Eric Maris > Best Regards, > Olga. > > ----- Original Message ----- > From: "Eric Maris" > To: > Sent: Friday, May 26, 2006 5:35 PM > Subject: Re: [FIELDTRIP] and clusterrandomization > > >> Dear Olga, >> >> >> But the problems is still in my clusterrandomization. >> Could the fact that the order of the channel in the file (C_vc11.label) >> is not the same as in the C_vc11.elec.label influences the result of >> clusterrandomization (I do not have my neigbouring channel file)? >> >> >> That should not matter. However, the labels in your data structure >> (.label in the output of timelockgrandaverage) should exactly match the >> labels in the elec-structure. If that is OK, then something might have >> gone wrong with the combination of the data of the different subjects. Do >> they all have the same elec-structure? If the same physical channel has >> different labels for different subjects, then this may create >> inconsistencies between EEGlab and Fieldtrip. For Fieldtrip, channels >> that have the same label are assumed to be physically identical, even if >> they are in different positions in the data structure. This is only a >> guess, of course. >> >> >> kind regards, >> >> Eric Maris >> >> >> >> >> >> >> >> >> >> Best Regards, >> Olga. >> ----- Original Message ----- >> From: Ingrid Nieuwenhuis >> To: FIELDTRIP at NIC.SURFNET.NL >> Sent: Wednesday, May 24, 2006 8:45 PM >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject >> >> >> Hi Olga, >> >> >> >> About the z-param: >> >> This is the field that contains the data to be plotted; for instance >> 'avg', 'powspctrm' or 'cohspctrm'. Normally the function looks in your >> data.dimord to find out which z-param to use. To make the function work >> you could give cfg.zparam = 'avg' (for instance if you want to plot an >> ERF/ERP). But if you could send me what the dimord field of the data that >> you want to plot is, I could look why the plot functions don't extract >> the correct zparam themselves. >> >> >> >> About the timelockgranaveraging: I also think it should be the same. I >> have no idea what it could be. >> >> >> >> Good luck, >> >> Ingrid Nieuwenhuis >> >> >> >> >> ------------------------------------------------------------------------------ >> >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >> Behalf Of Olga Sysoeva >> Sent: Wednesday, May 24, 2006 5:44 PM >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject >> >> >> >> Dear List member, >> >> >> >> Sorry for such dull questions but, >> >> I am again facing the new problems with Fieldtrip, although did not >> solve some previous one (still can not singleplot and multiplot anything >> 'cause of "unknown zparam field". >> >> >> >> OK, about new one :-) >> >> >> >> It seems that I did not use write the timelockgranaveraging. >> >> >> >> The problem must be here, when I made grand averaging of all my 11 >> subject >> data >> >> cfg =[]; >> cfg.keepindividual = 'yes' >> C_vc11 = >> >> timelockgrandaverage(cfg,vc_c_avg1,vc_c_avg2,vc_c_avg3,vc_c_avg4,vc_c_avg5, >> vc_c_avg6,vc_c_avg7,vc_c_avg8,vc_c_avg9,vc_c_avg10,vc_c_avg11 ); >> >> As I understand the >> >> vc_c_avg11.avg([9],[43]) should be similar with C_vc11.individual ([11], >> [9], [43]) >> But it is not. >> What can it be? >> >> Best Regards, >> >> Olga. >> >> >> >> >> >> ----- Original Message ----- >> >> From: Olga Sysoeva >> >> To: FIELDTRIP at NIC.SURFNET.NL >> >> Sent: Saturday, May 13, 2006 4:34 PM >> >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data >> within-subject >> >> >> >> Thank you very much, Lilla! >> >> Now I knwo what to do but faced the problem with " unknown zparam >> field" when ploting the results. Unfortunatly cfg.zparam does not >> discribed in help file... >> >> Best Regards, Olga >> >> ----- Original Message ----- >> >> From: Lilla Magyari >> >> To: FIELDTRIP at NIC.SURFNET.NL >> >> Sent: Saturday, May 13, 2006 3:11 PM >> >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data >> within-subject >> >> >> >> Dear Olga, >> >> >> >> I am just studying time-frequency analysis but I have done already >> on my data, so perhaps I can help you. >> >> First, yes, you have to do freqanalysis on the preprocessed data of >> the individual subjects for all conditions that you want to compare (i.e. >> the input for this function contains all trials from one subject in one >> condition.) And it is also important that the other input for this >> function is the cfg where for example, in the cfg.method you have to >> specify what kind of time-frequency analysis you want to use. (You have >> to write 'wltconvol' for wavelet transformation and 'mltconvol' for >> multitaper analysis.) >> >> When you use freqanalysis as output you can get TFR for one subject >> in one condition (but it is also possible to keep the information for the >> individual trials of the condition by specifying cfg.keeptrials = 'yes'). >> When you have the TFRs for each subject you can grandaverage them with >> freqgrandaverage where the input is the TFRs of all subjects (and before >> averaging you can use also freqbaseline for giving a baseline for your >> TFRs). >> >> >> >> I hope it helps. >> >> >> >> Best regards, >> >> Lilla Magyari >> >> >> >> >> >> >> >> >> -------------------------------------------------------------------------- >> >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >> Behalf Of Olga Sysoeva >> Sent: Saturday, May 13, 2006 9:28 AM >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: [FIELDTRIP] clusterrandomization on 3D-data within-subject >> >> >> >> Dear list members, >> >> >> >> Thank you everybody for your help! I've already got interesting >> results using clusterrandomization on my data! Thanks a lot! >> >> >> >> Now I have a question about using the clusterrandomization on 3-D >> data (channel-time-frequency) in within-subject analysis. >> >> As I understand it is possible with Fieldtrip, but I really newby in >> time-frequency anlysis, therefore wanted your comments, >> >> as far as I didn't find the example of the application of >> clusteranalysis on this set of the data in tuturial. >> >> >> >> I successfully conduct the within-subject clusterrandomization on my >> grand-average data, which does not have the third, frequency demintion. >> >> Now I want to add it. But I could not apply freqanalyisis on >> grandavarage data, could I? Should I made the TFR of individual data and >> than grand-avarage the result? >> >> Which function should I use? >> >> >> >> Best Regards, >> >> Olga. From maris at NICI.RU.NL Sat Jun 3 18:53:19 2006 From: maris at NICI.RU.NL (Eric Maris) Date: Sat, 3 Jun 2006 18:53:19 +0200 Subject: clusrand: 19 channels 0 minnbchan Message-ID: Dear Olga, Does it make sense to make clusterrandomization if I put "0" in the min number of neibouring channels if I have only 19 of them (10-20 system)? As I understand in this case just the time is considered when clustering. How many consequent time point is requiered to build a cluster? Yes, it makes sense. The cfg.minnbchan-field is a way to suppress the tendency of the cluster-growing algorithm to connect everything with everything, even on the basis of noise. The FA-rate is not affect by the value of cfg.minnbchan. greetings, Eric Maris From pchris at UNC.EDU Mon Jun 5 19:05:30 2006 From: pchris at UNC.EDU (Punita Christopher) Date: Mon, 5 Jun 2006 19:05:30 +0200 Subject: dipole model Message-ID: Has anyone seen any literature that deals with a spherical multiple layer head model in which the dipole spans across layers i.e. the source and sink of the dipole are in separate layers. Thanks, Punita From r.oostenveld at FCDONDERS.RU.NL Tue Jun 6 10:50:02 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 Jun 2006 10:50:02 +0200 Subject: dipole model In-Reply-To: Message-ID: Hi Punita, On 5 Jun 2006, at 19:05, Punita Christopher wrote: > Has anyone seen any literature that deals with a spherical multiple > layer > head model in which the dipole spans across layers i.e. the source and > sink of the dipole are in separate layers. In the dipole model the source and sink are infintely close together. The difference on the scalp between a dipole and a source+sink model with only a few mm in between will be negligible. A source+sink model with more distance between them can be modelled as such, it requires the solution of the monopole in a sphere (i.e. the desired source +sink consists of the superposition of two monopoles). I am not sure whether an analytical solution for that exsists in a 3- or 4-shell model, but I would would guess that it does (*). For a BEM model it is trivial to replace the dipole infinite medium potential with a monopole infinite medium potential, i.e the BEM formulation (separation of source and volume conduction) allows the specification of arbitrary sources. best Robert *) I don't know literature for a monopole in a multi-shell sphere, but I would expect it to be in either textbooks as a didactical example or in older articles (70s or 80s). You may want to search for multipole expansions, which are described in more recent literature, the monopole is the first term (0th order) of that, the dipole the second term. Perhaps "Phys Med Biol. 2001 Aug;46(8):2255-66. A study of equivalent source techniques for high-resolution EEG imaging. Yao D, Zhou Y, Zeng M, Fan S, Lian J, Wu D, Ao X, Chen L, He B." could provide more insight. From muthuraman10 at HOTMAIL.COM Tue Jun 6 11:19:56 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Tue, 6 Jun 2006 09:19:56 +0000 Subject: query on coherence analysis In-Reply-To: Message-ID: Hello Thanks for the comments, i have downloaded the latest version and now i am able to calculate using mtmwelch but i get a error when i am plotting i will included the matlab commands >>cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); >>fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='foi'; cfg.yparam='cohspctrm'; cfg.xlim=[0 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG26'; singleplotER(cfg,fd); ??? Reference to non-existent field 'foi'. Error in ==> singleplotER at 272 plot(varargin{k-1}.(cfg.xparam), P, style); with regards muthu >From: Robert Oostenveld >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence source analysis >Date: Thu, 1 Jun 2006 13:58:48 +0200 > >Dear Muthuraman > >I have not been able to reproduce your error. I suggest that you get the >latest version of FieldTrip from our FTP server and try again. > >best egards, >Robert > >PS this is the test script I used. It uses some simulated data, which >again uses a MEG gradiometer definition and a head model from the tutorial >data. > > >----------------- >% read some data that is required to simulate MEG data, i.e. volume model, >% sensor positions and MRI (optional, only for plotting) >vol = read_ctf_hdm('Subject01.hdm'); >hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); >grad = hdr.grad; > >% construct the simulated MEG data for condition A ("active") >cfg = []; >cfg.vol = vol; >cfg.grad = grad; >cfg.fsample = 300; >cfg.ntrials = 2; >cfg.triallength = 1; >cfg.dip.pos = [0 7 8]; >cfg.dip.mom = [1 0 0]; >cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); >cfg.absnoise = 1e-8; >data = dipolesimulation(cfg); > >% add the source signal as fake EMG channel >for i=1:cfg.ntrials > data.trial{i}(end+1,:) = cfg.dip.signal + randn(size (cfg.dip.signal)); >end >data.label{end+1} = 'EMG'; > >cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'MEG' 'EMG'},data.label); >cfg.channelcmb={'MEG' 'EMG'}; >freq=freqanalysis(cfg,data); > > > From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Jun 6 13:33:28 2006 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 6 Jun 2006 13:33:28 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: Dear Muthuraman, cfg.xparam should not be 'foi', but 'freq' (see help singleplotER) Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Tuesday, June 06, 2006 11:20 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] query on coherence analysis Hello Thanks for the comments, i have downloaded the latest version and now i am able to calculate using mtmwelch but i get a error when i am plotting i will included the matlab commands >>cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); >>fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='foi'; cfg.yparam='cohspctrm'; cfg.xlim=[0 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG26'; singleplotER(cfg,fd); ??? Reference to non-existent field 'foi'. Error in ==> singleplotER at 272 plot(varargin{k-1}.(cfg.xparam), P, style); with regards muthu >From: Robert Oostenveld >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence source analysis >Date: Thu, 1 Jun 2006 13:58:48 +0200 > >Dear Muthuraman > >I have not been able to reproduce your error. I suggest that you get the >latest version of FieldTrip from our FTP server and try again. > >best egards, >Robert > >PS this is the test script I used. It uses some simulated data, which >again uses a MEG gradiometer definition and a head model from the tutorial >data. > > >----------------- >% read some data that is required to simulate MEG data, i.e. volume model, >% sensor positions and MRI (optional, only for plotting) >vol = read_ctf_hdm('Subject01.hdm'); >hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); >grad = hdr.grad; > >% construct the simulated MEG data for condition A ("active") >cfg = []; >cfg.vol = vol; >cfg.grad = grad; >cfg.fsample = 300; >cfg.ntrials = 2; >cfg.triallength = 1; >cfg.dip.pos = [0 7 8]; >cfg.dip.mom = [1 0 0]; >cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); >cfg.absnoise = 1e-8; >data = dipolesimulation(cfg); > >% add the source signal as fake EMG channel >for i=1:cfg.ntrials > data.trial{i}(end+1,:) = cfg.dip.signal + randn(size (cfg.dip.signal)); >end >data.label{end+1} = 'EMG'; > >cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'MEG' 'EMG'},data.label); >cfg.channelcmb={'MEG' 'EMG'}; >freq=freqanalysis(cfg,data); > > > From ingrid.nieuwenhuis at FCDONDERS.RU.NL Wed Jun 14 11:55:53 2006 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Wed, 14 Jun 2006 11:55:53 +0200 Subject: missing cumtapcnt field Message-ID: I'm (trying to) beamform, but I get the following error: reference to non-existent field 'cumtapcnt' In prepare_freq_matrices line 124. Ntrials = length(freq.cumtapcnt) I used freqanalysis method 'mtmconvol' to do make the freq, and it indeed doesn't contain a 'cumtapcnt' cfg = []; cfg.method = 'mtmconvol'; cfg.output = 'powandcsd'; cfg.foi = 90; cfg.t_ftimwin = 0.5; cfg.tapsmofrq = 30; cfg.pad = 'maxperlen'; cfg.taper = 'dpss'; cfg.keeptrials = 'yes'; cfg.keeptapers = 'no'; cfg.toi = 0.75 freq_BF = freqanalysis(cfg, data); So my questions: - Why doesn't my freq contain a cumtapcnt field. Should I have kept my tapers (cfg.keeptapers = 'yes')? - Can I solve this without having to freqanalysis my data all over again, I can see in my freq.crsspctrm = [76 x 11476 double] that I have 76 trials. Can I for instance just make a vector of ones with length 76 and put that in my freq, or will that create problems? Thanks a lot, Ingrid From Jan.Schoffelen at FCDONDERS.RU.NL Wed Jun 14 12:42:08 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Wed, 14 Jun 2006 12:42:08 +0200 Subject: missing cumtapcnt field In-Reply-To: Message-ID: Hi Ingrid, >Can I for instance just make a vector of ones with length 76 and put that >in my freq, or will that create problems? The answer to this question is yes. Indeed, no cumtapcnt is passed back when using freqanalysis_mtmconvol. Should be fixed, though. In your case I think it is sufficient just to provide a vector which has a dimensionality of Nx1, N being the number of epoch. The content of this vector will not be used later on in this case. On the other hand, the cumtapcnt-vector, as outputted by for example freqanalysis_mtmfft contains for each epoch the number of tapers which have been used for the estimation of the spectra for that particular epoch. Please note that if you set the option cfg.keeptapers = 'yes', the vector consists only of ones (or if you use e.g. a single hanning-taper, or such a low amount of smoothing, that you only need one 'dpss'-taper, in which case by the way it does not make sense to use the 'dpss'). In any other case, the cumtapcnt-vector contains a number, which can be different for each epoch (when you have trials of different lengths). You can easily compute the number of tapers, this will be: 2xNxK-1, with N being the length of your data segment (in seconds), and K being the taper-smoothing you specified in cfg.tapsmofrq. Yours, JM From nathanweisz at MAC.COM Thu Jun 15 11:42:43 2006 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Thu, 15 Jun 2006 11:42:43 +0200 Subject: source positions - brain regions Message-ID: dear help-list, sorry for what appears to be a very basic question. i'm just starting to explore the source analysis possibilities that fieldtrip offers. for this i downloaded a EEG tutorial dataset from eeglab, did eeglab2fieldtrip, and the timelockanalysis. now i wanted to estimate the source waveforms of the erp. %this is my input: vol = []; vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 cm vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; tmp=data.elec; tmp.pnt=tmp.pnt*12; cfg=[]; cfg.method='lcmv'; cfg.vol=vol; cfg.elec=tmp; cfg.resolution=1; datamn=sourceanalysis(cfg,dataav); %this is the output datamn = xgrid: [-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10] ygrid: [-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10] zgrid: [-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10] dim: [21 21 19] vol: [1x1 struct] time: [1x256 double] pos: [8379x3 double] inside: [1x4811 double] outside: [1x3568 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] there were no error or warning messages, so from the basic structure things seem to be ok. the time courses of my source activity appears to be saved in datamn.avg.mom. >> size(datamn.avg.mom{datamn.inside(1)}) ans = 3 256 however now i'm a little bit stuck. from here, what is the best method of finding out which dipoles correspond (very roughly) to which brain regions, so i can extract specifically those to look at the sourcewaveforms? unfortunatley no mri. I am aware of the sourceplot function, but was uncapable of producing a meaningful output. thanks in advance for any hints & best wishes, nathan -------------------------------- Dr. Nathan Weisz Dept. of Psychology University of Konstanz P.O. Box D25 78457 Konstanz, Germany Tel: ++49-7531-884612 Email & Chat-AV: nathanweisz at mac.com Homepage: http://homepage.mac.com/nathanweisz/start/research.html From muthuraman10 at HOTMAIL.COM Thu Jun 15 15:59:54 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Thu, 15 Jun 2006 13:59:54 +0000 Subject: query on coherence analysis In-Reply-To: <002201c6895d$07c0d680$642dae83@fcdonders.nl> Message-ID: Hello Thankyou for the previous help it works now i am able to proceed further to calculate the coherence The problem now the coherence obtained using the mtmwelch when i plot the coherence figures for the channels all the coherence figures for the different channel looks the same is there is a bug in how i am calculating the coherence These are the steps i carried out in calculating the coherence headerfile='pd_mof_tr0_c_0306.cnt'; hdr = read_fcdc_header(headerfile); cfg.trl = []; for i=1:floor(hdr.nSamples/hdr.Fs) cfg.trl(i,1) = (i-1)*hdr.Fs + 1; cfg.trl(i,2) = (i )*hdr.Fs; cfg.trl(i,3) = 0; end cfg.headerfile=headerfile; >>cfg.datafile=headerfile; >>[data] = preprocessing(cfg); -and after the data is preprocessed i change the channel labels from actual cz to eeg26 and so on cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); -when i calculate using freqanalysis i get these warnings 1.000 Hz : WARNING - using only one taper for specified smoothing Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 360 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 and so on till 30.000 hz -and while processing processing trial 2: 1000 samples Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 398 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='freq'; cfg.yparam='cohspctrm'; cfg.xlim=[3 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG27'; singleplotER(cfg,fd); -when i try to plot i get this error ??? Error using ==> char Cell elements must be character arrays. Error in ==> singleplotER at 326 t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; please , look at it and help me in this regard thanking you with regards muthuraman >From: Ingrid Nieuwenhuis >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis >Date: Tue, 6 Jun 2006 13:33:28 +0200 > >Dear Muthuraman, > >cfg.xparam should not be 'foi', but 'freq' (see help singleplotER) > >Bests, >Ingrid > > >-----Original Message----- >From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf >Of Muthuraman Muthuraman >Sent: Tuesday, June 06, 2006 11:20 AM >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis > >Hello > >Thanks for the comments, i have downloaded the latest version >and now i am able to calculate using mtmwelch > >but i get a error when i am plotting >i will included the matlab commands > > >>cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'EEG' 'EMG2'},data.label); >cfg.channelcmb={'EEG' 'EMG2'}; >freq=freqanalysis(cfg,data); > > >>fd=freqdescriptives([],freq); > >cfg=[]; >cfg.xparam='foi'; >cfg.yparam='cohspctrm'; >cfg.xlim=[0 30]; >cfg.cohrefchannel='EMG2'; >cfg.box='yes'; >cfg.showlabels='yes'; >cfg.channelname='EEG26'; >singleplotER(cfg,fd); > >??? Reference to non-existent field 'foi'. > >Error in ==> singleplotER at 272 > plot(varargin{k-1}.(cfg.xparam), P, style); > >with regards >muthu > > > >From: Robert Oostenveld > >Reply-To: FieldTrip discussion list > >To: FIELDTRIP at NIC.SURFNET.NL > >Subject: Re: [FIELDTRIP] query on coherence source analysis > >Date: Thu, 1 Jun 2006 13:58:48 +0200 > > > >Dear Muthuraman > > > >I have not been able to reproduce your error. I suggest that you get the > >latest version of FieldTrip from our FTP server and try again. > > > >best egards, > >Robert > > > >PS this is the test script I used. It uses some simulated data, which > >again uses a MEG gradiometer definition and a head model from the >tutorial > > >data. > > > > > >----------------- > >% read some data that is required to simulate MEG data, i.e. volume >model, > >% sensor positions and MRI (optional, only for plotting) > >vol = read_ctf_hdm('Subject01.hdm'); > >hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); > >grad = hdr.grad; > > > >% construct the simulated MEG data for condition A ("active") > >cfg = []; > >cfg.vol = vol; > >cfg.grad = grad; > >cfg.fsample = 300; > >cfg.ntrials = 2; > >cfg.triallength = 1; > >cfg.dip.pos = [0 7 8]; > >cfg.dip.mom = [1 0 0]; > >cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); > >cfg.absnoise = 1e-8; > >data = dipolesimulation(cfg); > > > >% add the source signal as fake EMG channel > >for i=1:cfg.ntrials > > data.trial{i}(end+1,:) = cfg.dip.signal + randn(size >(cfg.dip.signal)); > >end > >data.label{end+1} = 'EMG'; > > > >cfg=[]; > >cfg.output='powandcsd'; > >cfg.method='mtmwelch'; > >cfg.foi=1:2:30; > >numfoi = length(cfg.foi); > >cfg.taper='hanning'; > >cfg.t_ftimwin=zeros(1,numfoi); > >cfg.t_ftimwin(:)=0.5; > >cfg.channel=channelselection({'MEG' 'EMG'},data.label); > >cfg.channelcmb={'MEG' 'EMG'}; > >freq=freqanalysis(cfg,data); > > > > > > From linpe at NINDS.NIH.GOV Thu Jun 15 22:08:19 2006 From: linpe at NINDS.NIH.GOV (Lin, Peter (NIH/NINDS) [E]) Date: Thu, 15 Jun 2006 16:08:19 -0400 Subject: No subject Message-ID: I am trying to import neuroscan data into fieldtrip for analysis. I tried using eeglab to load my epoch's neuroscan file and then used the eeglab2fieldtrip command on the EEG structure to generate a new data file. My question is how to process the data further using the frequencyanalysis method. >>[data]=eeglab2fieldtrip(EEG,'preprocessing') data = label: {1x64 cell} fsample: 1000 elec: [1x1 struct] trial: {1x224 cell} time: {1x224 cell} cfg: [1x1 struct] I'm wondering if my created data file is not correct. Any help on how to proceed would be great. Thanks, Peter Peter Lin, MD Clinical Fellow, Human Motor Control Section Phone: 301-402-0703 email: linpe at ninds.nih.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Fri Jun 16 09:05:50 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 16 Jun 2006 09:05:50 +0200 Subject: No subject In-Reply-To: Message-ID: Dear Peter, As far as I can see, the data looks OK. At least it contains the fields subsequent analysis steps need to know. However, I cannot judge the content of these fields, but there's no reason to assume that's not fine. To proceed, I would first advice you to have a look at the fieldtrip website. If you follow the link documentation, and then tutorial-documentation, there's already some stuff regarding frequency analysis. Moreover, the website also contains the documentation of all fieldtrip functions, which you can also access from the matlab command line, by typing help functionname. For example, try help freqanalysis, or help freqanalysis_mtmconvol. There's already quite some information in there, as well as all the options you can play with. Good luck Jan-mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Lin, Peter (NIH/NINDS) [E] Sent: Thursday, June 15, 2006 10:08 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] I am trying to import neuroscan data into fieldtrip for analysis. I tried using eeglab to load my epoch's neuroscan file and then used the eeglab2fieldtrip command on the EEG structure to generate a new data file. My question is how to process the data further using the frequencyanalysis method. >>[data]=eeglab2fieldtrip(EEG,'preprocessing') data = label: {1x64 cell} fsample: 1000 elec: [1x1 struct] trial: {1x224 cell} time: {1x224 cell} cfg: [1x1 struct] I'm wondering if my created data file is not correct. Any help on how to proceed would be great. Thanks, Peter Peter Lin, MD Clinical Fellow, Human Motor Control Section Phone: 301-402-0703 email: linpe at ninds.nih.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Fri Jun 16 09:15:15 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 16 Jun 2006 09:15:15 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: Dear Muthuraman, At first glance I don't have a clue what's going on. Did you have a look into fd.powspctrm, and fd.cohspctrm? Does it contain normal numbers, zeros, or nan? It might be a bug in freqanalysis_mtmwelch. Did you try out other methods, to be specified in cfg.method? If yes, did this also give strange results? If no, could you try out cfg.method = 'mtmconvol' instead of 'mtmwelch'? Please have a look at the documentation which additional options you have to specify. What matlab-version do you use? Do you use the latest fieldtrip-version? One additional thing: please note that you specified the odd frequencies 1:2:29, whereas your time-window is half a second wide. These are not optimal settings, since the frequency-resolution of your time-window is 2 Hz. This means that your time-window never contains an integer amount of cycles of the frequency you want to estimate. This might lead to strange results, though I don't think it has anything to do with your present problem. However, I would use cfg.freq = 2:2:30 in combination with a time-window of 0.5 s Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Thursday, June 15, 2006 4:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] query on coherence analysis Hello Thankyou for the previous help it works now i am able to proceed further to calculate the coherence The problem now the coherence obtained using the mtmwelch when i plot the coherence figures for the channels all the coherence figures for the different channel looks the same is there is a bug in how i am calculating the coherence These are the steps i carried out in calculating the coherence headerfile='pd_mof_tr0_c_0306.cnt'; hdr = read_fcdc_header(headerfile); cfg.trl = []; for i=1:floor(hdr.nSamples/hdr.Fs) cfg.trl(i,1) = (i-1)*hdr.Fs + 1; cfg.trl(i,2) = (i )*hdr.Fs; cfg.trl(i,3) = 0; end cfg.headerfile=headerfile; >>cfg.datafile=headerfile; >>[data] = preprocessing(cfg); -and after the data is preprocessed i change the channel labels from actual cz to eeg26 and so on cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); -when i calculate using freqanalysis i get these warnings 1.000 Hz : WARNING - using only one taper for specified smoothing Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 360 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 and so on till 30.000 hz -and while processing processing trial 2: 1000 samples Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 398 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='freq'; cfg.yparam='cohspctrm'; cfg.xlim=[3 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG27'; singleplotER(cfg,fd); -when i try to plot i get this error ??? Error using ==> char Cell elements must be character arrays. Error in ==> singleplotER at 326 t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; please , look at it and help me in this regard thanking you with regards muthuraman From r.oostenveld at FCDONDERS.RU.NL Fri Jun 16 10:39:48 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 16 Jun 2006 10:39:48 +0200 Subject: source positions - brain regions In-Reply-To: <5E221385-C805-4FFA-BE76-F2C0DF9BEE72@mac.com> Message-ID: hi Nathan On 15 Jun 2006, at 11:42, Nathan Weisz wrote: > however now i'm a little bit stuck. from here, what is the best > method of finding out which dipoles correspond (very roughly) to > which brain regions, so i can extract specifically those to look at > the sourcewaveforms? unfortunatley no mri. > I am aware of the sourceplot function, but was uncapable of > producing a meaningful output. So far it seems ok. The headmodel is in cm, the electrodes as well (I presume, otherwise it would have given warnings and/or errors), so the source locations are also expressed in cm, since they are expresed in the same coordinate system. I suggest that you have a look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_are_the_differ ent_head_and_mri_coordinate_systems_defined to get a better understanding in general. What we normally do in such a case is to use an indivudual headmodel, and what we thus subsequently would do is to take an anatomical MRI of the same subject, in which the MRI is aligned to the same head/ model coordinate system (using the ears and nose fiducials). Since you do not have a MRI, you could take a standard MRI (i.e. the MNI template in single_subj_T1 from SPM). Some time ago I (or Arno) posted a homogenous transformation matrix "besa2spm" on the eeglab mailing list (*). That homogenous transformation matrix transforms from besa coordinates for a spherical model to MNI coordinates. besa2spm = [ 0.0101 -0.9400 0 0.5588 1.1889 0.0080 0.0530 -18.0041 -0.0005 -0.0000 1.1268 1.8045 0 0 0 1.0000 ]; spm2besa = inv(besa2spm); The transformation matrix is for the "besa" spherical model in EEGLAB, which has different sphere radii (85mm outer sphere) than you have used. So you should add a scaling from the besa radii to yours. your2besa = eye(4); your2besa(1,1) = 8.5/12; your2besa(2,2) = 8.5/12; your2besa(3,3) = 8.5/12; then your2spm = besa2spm * your2besa spm2your = inv(your2spm); It is most convenient to apply the inverse transformation to the MRI corodinate system. I.e. do mri = read_fcdc_mri('single_subj_T1.mnc') then mri.transform describes the voxels in SPM/MNI coordinates, so mri.transform = spm2your * mri.transform; changes the anatomical MRI into your headmodel coordinates. Subsequently you can interpolate the functional values onto the anaomtical voxel locations with SOURCEINTERPOLATE, and plot the functional values overlaid over the anatomical with SOURCEPLLOT or SLICEINTERP. best regards, Robert PS (*) the besa2spm coordinate transformation matrix was constructed using ELECTORDENORMAMALIZE, which warps electrodes. In this case the spherical 1020 electrodes were warped to the corresponding electrodes in the MNI template. The homogenous transformation matrix describes the warp/deformation and can be used as well for the dipoles inside the head. From jurij.dreo at GUEST.ARNES.SI Sat Jun 17 12:18:26 2006 From: jurij.dreo at GUEST.ARNES.SI (Jurij Dreo) Date: Sat, 17 Jun 2006 11:18:26 +0100 Subject: Statistics for coherence in a within-subject experiment Message-ID: Hello, I am using BESA to perform coherence and source coherence calculations for a multiple-subject/multiple-condition experiment. In the experiment I have 11 subjects, 6 conditions and around 30 sets per condition per subject. In BESA the data was preprocessed and the coherence values in the Time-Frequency domain were calculated for each person. As BESA has no capabilities to calculate statistics in a multiple- subject study, their support personnel directed me towards FieldTrip. I´ve been looking over the documentation and tutorials on your web page and also downloaded the scrip and ran it in matlab. The tutorial on Cluster-Lever randomization Tests for the Time- Frequency domain is quite straight-forward. I am however not quite sure which statistic to use for the cfg.statistic variable to analyze coherence in a within-subject study such as the one I have. The documentation on the cfg.statistic variable says it can have these values: 1. indepsamplesT' (independent samples T-statistic) 2. 'indepsamplesregrT' (independent samples regression coefficient T- statistic) 3. 'indepsamplesZcoh' (independent samples Z-statistic for coherence) 4. 'indepsamplesTsqcrs' (independent samples T-square-statistic for the cross-spectrum) 5. 'depsamplesT' (dependent samples T-statistic) 6. 'actvsblT' (activation versus baseline T-statistic) 7. 'depsamplesregrT' (dependent samples regression coefficient T- statistic) 8. 'indepsamplesF' (independent samples F-statistic) 9. 'depsamplesF' (dependent samples F-statistic) I am not sure if any of these options are compatible with a within- subject multiple condition coherence statistical analysis. option 3. - indepsamplesZcoh is obviously only suitable for a between- trial, two-condition experiment and there are no other options that explicitally say they are used for coherence. So how can one compare 6 conditions for 11 subjects with regards to coherence if one imports the Time-Frequency domain data for each person into FieldTrip? Thank you for your help! Regards, Jurij Dreo From r.oostenveld at FCDONDERS.RU.NL Mon Jun 19 16:18:55 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Jun 2006 16:18:55 +0200 Subject: Statistics for coherence in a within-subject experiment In-Reply-To: <20060617_091826_063328.jurij.dreo@guest.arnes.si> Message-ID: Hi Jurij > option 3. - indepsamplesZcoh is obviously only suitable for a between- > trial, two-condition experiment Yes, that is for testing coherence differences between two conditions within one subject. > and there are no other options that explicitally say they are used > for coherence. > > So how can one compare 6 conditions for 11 subjects with regards to > coherence if one imports the Time-Frequency domain data for each > person into FieldTrip? In your case you have observed a "value" in 11 subjects, over 6 conditions. That value happens to be coherence, but could as well have been something else. Since you have manipulated the conditions with each subject, you can use a dependent-samples test: the observed values depend on the subject (an example of a dependent-samples test is a paired-t test). If the number of trials varies between subjects and/or sessions, it will be preferable to transform your coherence values to z-scores manually prior to submitting the values to clusterrandanalysis. Now about the 6 conditions, am I right that you have a 1x6 factorial design, or is there more strucure in the design? Do you have a specific hypothesis about the different conditions? If you only want to reject the null-hypothesis "the observed value (coherence) is the same (more accurately: stems from the same distribution) in all my 6 conditions", you would use an omnibus F-statistic, i.e. 'depsamplesF'. It might be that your hypothesis is more specific, or also in case you find an omnibus effect, then you would probably want to perform explicit tests between two subsets of your 6 conditions using a 'depsamplesT' test. best regards, Robert From jurij.dreo at GUEST.ARNES.SI Mon Jun 19 17:31:46 2006 From: jurij.dreo at GUEST.ARNES.SI (Jurij Dreo) Date: Mon, 19 Jun 2006 17:31:46 +0200 Subject: Statistics for coherence in a within-subject experiment Message-ID: Hello! Thank you for your answers. Here are my replies to them: To avoid any misunderstandings here is again a summary of my study design - I have 11 subjects. - Each of them performed 6 tasks related to working memory. - Each subject performed anywehere from 25 to 60 repeats (trial) of each condition (the standard number of trials per task was 30 - but some subjects performed the entire experiment twice (ergo 60 potential trials) .... and in some some of their trials are unusable - artifacts ... ergo 25 min number of possible trials) Given my study design I thought something like a one-way ANOVA for correlated samples would be in order. (as I am comparing 6 conditions within-subjects as every subject performed all sets) ----------------- > In your case you have observed a "value" in 11 subjects, over 6 > conditions. That value happens to be coherence, but could as well > have been something else. Since you have manipulated the conditions > with each subject, you can use a dependent-samples test: the observed > values depend on the subject (an example of a dependent-samples test > is a paired-t test). ------------------- I´m not sure what you are saying here.... I agree with the dependent samples idea... but I cannot preform a t-test ... ie. more of them as that would inflate my p-rate overall. I thought that I would first do an ANOVA and then something like the Tukey HSD Test to cimpare individual conditions -------------------- > If the number of trials varies between subjects and/or sessions, it > will be preferable to transform your coherence values to z-scores > manually prior to submitting the values to clusterrandanalysis. -------------------- Yes I agree that would need to be done manually. ----------- > Now about the 6 conditions, am I right that you have a 1x6 factorial > design, or is there more strucure in the design? Do you have a > specific hypothesis about the different conditions? If you only want > to reject the null-hypothesis "the observed value (coherence) is the > same (more accurately: stems from the same distribution) in all my 6 > conditions", you would use an omnibus F-statistic, i.e. > 'depsamplesF'. It might be that your hypothesis is more specific, or > also in case you find an omnibus effect, then you would probably want > to perform explicit tests between two subsets of your 6 conditions > using a 'depsamplesT' test. > ---------- I want to contrast all conditions at once (f -test anova) AND also each combination of conditions (say a post- ANOVA Q-test) But Im still not sure which statistic to use and even if the one I use will be able to deal with the fact that I have a different number of conditions per condition per subject As far as I understand it... we must use some kind of ANOVA here... A simple "paired" t-test will not do... as we are comparing more than 2 conditions at once and I do not want to inflate my p-rate. Thank you for your help! Regards, Jurij Dreo -------------- next part -------------- An HTML attachment was scrubbed... URL: From muthuraman10 at HOTMAIL.COM Tue Jun 20 10:40:17 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Tue, 20 Jun 2006 08:40:17 +0000 Subject: query on coherence analysis Message-ID: Hello Jan The answers for the questions you have asked and also i have attached some figures with this mail 1-using welch periodogram method 2-using fieldtrip 'mtmfft' 3-using fieldtrip 'mtmwelch' Did you have a look into fd.powspctrm, and fd.cohspctrm? -yes,both look the same so something is surely going wrong Does it contain normal numbers, zeros, or nan? -yes, it has normal numbers but the vlaues are from 1.0 to 10.0 not as normal in the case of 0.1 to 1 in coherence spectrum Did you try out other methods, to be specified in cfg.method? -yes using 'mtmfft' i have attached the figure in the mail in which i dont get the correct frequency content and the values are less -In the 'mtmwelch' method i get a error when i am plotting, even then i am able to see the figure ??? Error using ==> char Cell elements must be character arrays. Error in ==> singleplotER at 326 t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; -In the 'mtmconvol' i am not able to plot i get a error selected 60 channels for coherence ??? Error using ==> plot Vectors must be the same lengths. Error in ==> singleplotER at 272 plot(varargin{k-1}.(cfg.xparam), P, style); please go through it and give your comments and one more question for the source analysis what are the values we need,when i open the elec1010 there are four values x,y,z values and what is the fourth value with regards muthu >From: Jan Mathijs Schoffelen >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis >Date: Fri, 16 Jun 2006 09:15:15 +0200 > >Dear Muthuraman, > >At first glance I don't have a clue what's going on. >Did you have a look into fd.powspctrm, and fd.cohspctrm? >Does it contain normal numbers, zeros, or nan? >It might be a bug in freqanalysis_mtmwelch. >Did you try out other methods, to be specified in cfg.method? >If yes, did this also give strange results? If no, could you try out >cfg.method = 'mtmconvol' instead of 'mtmwelch'? Please have a look at the >documentation which additional options you have to specify. >What matlab-version do you use? Do you use the latest fieldtrip-version? > >One additional thing: please note that you specified the odd frequencies >1:2:29, whereas your time-window is half a second wide. These are not >optimal settings, since the frequency-resolution of your time-window is 2 >Hz. This means that your time-window never contains an integer amount of >cycles of the frequency you want to estimate. This might lead to strange >results, though I don't think it has anything to do with your present >problem. However, I would use cfg.freq = 2:2:30 in combination with a >time-window of 0.5 s > >Yours, > >Jan-Mathijs > >-----Original Message----- >From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf >Of Muthuraman Muthuraman >Sent: Thursday, June 15, 2006 4:00 PM >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis > >Hello > >Thankyou for the previous help it works now >i am able to proceed further to calculate the coherence > >The problem now the coherence obtained using the mtmwelch >when i plot the coherence figures for the channels >all the coherence figures for the different channel looks the same >is there is a bug in how i am calculating the coherence > >These are the steps i carried out in calculating the coherence > >headerfile='pd_mof_tr0_c_0306.cnt'; >hdr = read_fcdc_header(headerfile); >cfg.trl = []; >for i=1:floor(hdr.nSamples/hdr.Fs) > cfg.trl(i,1) = (i-1)*hdr.Fs + 1; > cfg.trl(i,2) = (i )*hdr.Fs; > cfg.trl(i,3) = 0; >end > >cfg.headerfile=headerfile; > >>cfg.datafile=headerfile; > >>[data] = preprocessing(cfg); > >-and after the data is preprocessed i change the channel labels from actual >cz to eeg26 and so on > > > >cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'EEG' 'EMG2'},data.label); >cfg.channelcmb={'EEG' 'EMG2'}; >freq=freqanalysis(cfg,data); > > >-when i calculate using freqanalysis i get these warnings > >1.000 Hz : WARNING - using only one taper for specified smoothing >Warning: Size vector should be a row vector with integer elements. > >In freqanalysis_mtmconvol at 360 > In freqanalysis at 182 > In freqanalysis_mtmwelch at 67 > In freqanalysis at 182 >and so on till 30.000 hz > >-and while processing > >processing trial 2: 1000 samples >Warning: Size vector should be a row vector with integer elements. > >In freqanalysis_mtmconvol at 398 > In freqanalysis at 182 > In freqanalysis_mtmwelch at 67 > In freqanalysis at 182 > > > >fd=freqdescriptives([],freq); > > >cfg=[]; >cfg.xparam='freq'; >cfg.yparam='cohspctrm'; >cfg.xlim=[3 30]; >cfg.cohrefchannel='EMG2'; >cfg.box='yes'; >cfg.showlabels='yes'; > >cfg.channelname='EEG27'; >singleplotER(cfg,fd); >-when i try to plot i get this error >??? Error using ==> char >Cell elements must be character arrays. > >Error in ==> singleplotER at 326 > t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; > > >please , look at it and help me in this regard > >thanking you >with regards >muthuraman -------------- next part -------------- A non-text attachment was scrubbed... Name: Welch Periodogram Method.fig Type: application/octet-stream Size: 20550 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Fieldtrip-'mtmfft'.fig Type: application/octet-stream Size: 21189 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Fieltrip-'mtmwelch'.fig Type: application/octet-stream Size: 3635 bytes Desc: not available URL: From Jan.Schoffelen at FCDONDERS.RU.NL Wed Jun 21 11:31:07 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Wed, 21 Jun 2006 11:31:07 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: >the other question i have asked in the previous mail >i would like to do the source analysis >and the values specified in for ex:elec1010 >it has four values and the channel label >the first three values are x,y,z position values >what is the fourth value? Dear Muthuraman, Please have a look at the FAQ-section of the fieldtrip-website. It is explained what is specified in the layout-files. Yours, Jan-M From Jan.Schoffelen at FCDONDERS.RU.NL Wed Jun 21 12:32:15 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Wed, 21 Jun 2006 12:32:15 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: Dear Muthuraman, Please find attached a script and a figure. I compared the 'mtmfft' with 'mtmwelch', and the results look very similar. I did not test the 'mtmconvol' method, since this function is called when you specify 'mtmwelch'. I guess you have to check your configuration in that respect. I would say that the code is doing what it should do. Please make sure that you use the latest fieldtrip-version. Yours, Jan-Mathijs -----Original Message----- From: Muthuraman Muthuraman [mailto:muthuraman10 at hotmail.com] Sent: Wednesday, June 21, 2006 11:05 AM To: Jan.Schoffelen at fcdonders.ru.nl Subject: RE: [FIELDTRIP] query on coherence analysis Hello Jan Thanks for the suggestions I have tried 'mtmconvol' and also plotting using singleplotTFR the figure looks totally blue i have attached the figure with this mail for the same channel combination Figure-mtmconvol and also i have uploaded two files one is the CNT file of a patient and the other file is data structure after preprocessing and changing the channel label If u have any different results from the data please let me know my aim is to do the coherence analysis followed by the source analysis using 'DICS' the other question i have asked in the previous mail i would like to do the source analysis and the values specified in for ex:elec1010 it has four values and the channel label the first three values are x,y,z position values what is the fourth value? thanking you with regards muthu -------------- next part -------------- A non-text attachment was scrubbed... Name: muthu.fig Type: application/octet-stream Size: 1881 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: muthu.m Type: application/octet-stream Size: 1772 bytes Desc: not available URL: From srampp at TISCALI.DE Wed Jun 21 23:07:50 2006 From: srampp at TISCALI.DE (Stefan Rampp) Date: Wed, 21 Jun 2006 23:07:50 +0200 Subject: Missing minimumnormestimate etc Message-ID: Hi everyone, I was just trying to do source localization of epilepsy MEG data using mne, however, it appears that some functions are missing: minimumnormestimate, music, loreta and rv are used in sourceanalysis.m, but I can't find the implementations (and neither can matlab). Do I need to download additional libraries/toolboxes? Thank you, Stefan Rampp. Epilepsycenter Erlangen Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.montez at VUMC.NL Thu Jun 22 01:27:29 2006 From: t.montez at VUMC.NL (Montez, T.) Date: Thu, 22 Jun 2006 01:27:29 +0200 Subject: channel location file to import planar to EEGLAB Message-ID: Dear Fieldtripers, I am using EEGLAB to compute ICA of CTF 151 channels data. I used to read the data in EEGLAB directly from the CTF format, but some components are affected by the bad channels. Since removing the bad channels will reduce the number of components and will give problems later at the planar transformation; I tried using megrepair first and then importing the matlab array of data.trial{1}. I use the channel locations of a previous dataset opened from the CTF format. - I still get some components reflecting the bad channels, should I increase the cfg.neighbourdist? (I was using the default of 4 cm). - To import the data after the planar transformation I need a channel location file for the dH and dV pairs, can you help me with that? Thanks in advance, Teresa Montez -------------- next part -------------- An HTML attachment was scrubbed... URL: From srampp at TISCALI.DE Thu Jun 22 01:51:25 2006 From: srampp at TISCALI.DE (Stefan Rampp) Date: Thu, 22 Jun 2006 01:51:25 +0200 Subject: channel location file to import planar to EEGLAB Message-ID: channel location file to import planar to EEGLABDear Teresa, I can't really provide much info regarding your first question, however, I might be able to help you with the second: Have you applied 'combineplanar' after the planar transformation? This will combine the dH and dV pairs into one channel per pair, e.g. cfg = []; combplan = combineplanar(cfg, plan); were plan is the planar transformed data set. combineplanar allows to choose the method for combination of the pairs. For further details, you might want to have a look at the tutorial about event related averaging: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:eventrelatedaveraging Sincerely, Stefan Rampp Epilepsycenter Erlangen Germany. ----- Original Message ----- From: Montez, T. To: FIELDTRIP at NIC.SURFNET.NL Sent: Thursday, June 22, 2006 1:27 AM Subject: [FIELDTRIP] channel location file to import planar to EEGLAB Dear Fieldtripers, I am using EEGLAB to compute ICA of CTF 151 channels data. I used to read the data in EEGLAB directly from the CTF format, but some components are affected by the bad channels. Since removing the bad channels will reduce the number of components and will give problems later at the planar transformation; I tried using megrepair first and then importing the matlab array of data.trial{1}. I use the channel locations of a previous dataset opened from the CTF format. - I still get some components reflecting the bad channels, should I increase the cfg.neighbourdist? (I was using the default of 4 cm). - To import the data after the planar transformation I need a channel location file for the dH and dV pairs, can you help me with that? Thanks in advance, Teresa Montez -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Jun 22 09:25:56 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Jun 2006 09:25:56 +0200 Subject: Statistics for coherence in a within-subject experiment In-Reply-To: <000901c693b5$79d47c10$0200a8c0@laptop> Message-ID: Hi Jurij The parametric tests that you suggest are not implemented in FieldTrip. In the clusterrandanalysis function we use a randomization approach for statistical testing. It is a non-parametrical approach, and the test statistic consists of a parametrtical statistic per time- frequency-channel, which is clustered and summed over neighbouring timepoints/frequencies/channels. Not the single-sample statistic, but the clustersum is used for the statistical test, thereby increasing sensitivity and controlling for multiple comparisons. The single sample (time-frequency-channel) statistic has to be chosen to match with the experimental design (e.g. F or F) and the randomization/ permutation of the data between the subjects and conditions has to be adequate (in your case you want to shuffle data between conditions but only within each subject). That determines the statistic to use. I suggest that you go over the clusterrandanalysis tutorial at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:clusterrandanalysis best regards, Robert On 19 Jun 2006, at 17:31, Jurij Dreo wrote: > Hello! > > Thank you for your answers. Here are my replies to them: > > To avoid any misunderstandings here is again a summary of my study > design > - I have 11 subjects. > - Each of them performed 6 tasks related to working memory. > - Each subject performed anywehere from 25 to 60 repeats (trial) of > each condition (the standard number of trials per task was 30 - but > some subjects performed the entire experiment twice (ergo 60 > potential trials) .... and in some some of their trials are > unusable - artifacts ... ergo 25 min number of possible trials) > > Given my study design I thought something like a one-way ANOVA for > correlated samples would be in order. > (as I am comparing 6 conditions within-subjects as every subject > performed all sets) > > > ----------------- > > In your case you have observed a "value" in 11 subjects, over 6 > > conditions. That value happens to be coherence, but could as well > > have been something else. Since you have manipulated the conditions > > with each subject, you can use a dependent-samples test: the > observed > > values depend on the subject (an example of a dependent-samples test > > is a paired-t test). > ------------------- > > I´m not sure what you are saying here.... I agree with the > dependent samples idea... but I cannot preform a t-test ... ie. > more of them as that would inflate my p-rate overall. > > I thought that I would first do an ANOVA and then something like > the Tukey HSD Test to cimpare individual conditions > > -------------------- > > If the number of trials varies between subjects and/or sessions, it > > will be preferable to transform your coherence values to z-scores > > manually prior to submitting the values to clusterrandanalysis. > -------------------- > Yes I agree that would need to be done manually. > > ----------- > > Now about the 6 conditions, am I right that you have a 1x6 factorial > > design, or is there more strucure in the design? Do you have a > > specific hypothesis about the different conditions? If you only want > > to reject the null-hypothesis "the observed value (coherence) is the > > same (more accurately: stems from the same distribution) in all my 6 > > conditions", you would use an omnibus F-statistic, i.e. > > 'depsamplesF'. It might be that your hypothesis is more specific, or > > also in case you find an omnibus effect, then you would probably > want > > to perform explicit tests between two subsets of your 6 conditions > > using a 'depsamplesT' test. > > > ---------- > > I want to contrast all conditions at once (f -test anova) AND also > each combination of conditions (say a post- ANOVA Q-test) > > But Im still not sure which statistic to use and even if the one I > use will be able to deal with the fact that I have a different > number of conditions per condition per subject > > As far as I understand it... we must use some kind of ANOVA here... > A simple "paired" t-test will not do... as we are comparing more > than 2 conditions at once and I do not want to inflate my p-rate. > > Thank you for your help! > > Regards, > Jurij Dreo > From r.oostenveld at FCDONDERS.RU.NL Thu Jun 22 09:31:10 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Jun 2006 09:31:10 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <006c01c69576$c1d13270$14b2a8c0@mirandola> Message-ID: Dear Stefan, The SOURCEANALYSIS function is used as wrapper for various distributed or scanning inverse approaches, and DIPOLEFITTING is used for underdetermined model fitting to the data. The only underlying functions for SOURCEANALYSIS that are released on the ftp server are the lcmv and the dics beamformer methods. The functions that you refer to are implemented in our in-house version of FieldTrip but have not been tested thouroughly. I can give you a pre-release if you are willing to aid in the testing of those functions. best regards, Robert On 21 Jun 2006, at 23:07, Stefan Rampp wrote: > Hi everyone, > > I was just trying to do source localization of epilepsy MEG data > using mne, however, it appears that some functions are missing: > minimumnormestimate, music, loreta and rv are used in > sourceanalysis.m, but I can't find the implementations (and neither > can matlab). Do I need to download additional libraries/toolboxes? > > Thank you, > Stefan Rampp. > Epilepsycenter Erlangen > Germany > From r.oostenveld at FCDONDERS.RU.NL Thu Jun 22 09:40:31 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Jun 2006 09:40:31 +0200 Subject: channel location file to import planar to EEGLAB In-Reply-To: <28FF6B8D22C94B44A55E4E1325A94AF2348059@vumc-mb02.vumc.nl> Message-ID: Hi Theresa On 22 Jun 2006, at 1:27, Montez, T. wrote: > I am using EEGLAB to compute ICA of CTF 151 channels data. > > I used to read the data in EEGLAB directly from the CTF format, > but some components are affected by the bad channels. The bad channels do not reflect a linear mixture of underlying sources, therefore you should remove them prior to ICA. You should also remove all trials containing anomalous artifacts. > Since removing the bad channels will reduce the number of components > and will give problems later at the planar transformation; > I tried using megrepair first and then importing the matlab array > of data.trial{1}. I use the channel locations of a previous > dataset opened from the CTF format. MEGREPAIR uses a nearest-neighbour approach for fixing the missing channels. The "repaired" channels are linear combinations (i.e. a linear mixture) of the neighbours and hence do not add any information (i.e. components) to the data, doing ICA on the repaired dataset does not give you all 151 components. > - I still get some components reflecting the bad channels, > should I increase the cfg.neighbourdist? > (I was using the default of 4 cm). > > - To import the data after the planar transformation I need > a channel location file for the dH and dV pairs, > can you help me with that? The planar transformation in MEGPLANAR also results in a linear estimation of the horizontal and vertical gradients, i.e. if you start with 151 axial channels and you do MEGPLANAR, you will have 302 planar channels, but the dimensionality of that data will still be 151. That means that ICA on the 302-channel planar data will result in a maximum of 151 components. I suggest to do the ICA on the axial data with the bad channels removed. Subsequently you can switch from EEGLAB to FieldTrip and compute the planar representation of the ICA components using the MEGPLANAR function (I am not sure whether megplanar knows how to deal with ICA data, but it is easy to convert the ICA data into something that resembles an average ERF or alternatively to add support for the ICA data in megplanar). best regards, Robert From srampp at TISCALI.DE Thu Jun 22 10:43:01 2006 From: srampp at TISCALI.DE (Stefan Rampp) Date: Thu, 22 Jun 2006 10:43:01 +0200 Subject: Missing minimumnormestimate etc Message-ID: Dear Robert, Thank you for the fast answer. Since I'm interested in comparing various methods, I'd greatly appreciate a pre-release version. And of course I could contribute to Fieldtrip as a betatester for these functions like that. Sincerely, Stefan Rampp Epilepsycenter Erlangen Germany ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Thursday, June 22, 2006 9:31 AM Subject: Re: [FIELDTRIP] Missing minimumnormestimate etc > Dear Stefan, > > The SOURCEANALYSIS function is used as wrapper for various distributed or > scanning inverse approaches, and DIPOLEFITTING is used for > underdetermined model fitting to the data. The only underlying functions > for SOURCEANALYSIS that are released on the ftp server are the lcmv and > the dics beamformer methods. The functions that you refer to are > implemented in our in-house version of FieldTrip but have not been tested > thouroughly. I can give you a pre-release if you are willing to aid in > the testing of those functions. > > best regards, > Robert > > > On 21 Jun 2006, at 23:07, Stefan Rampp wrote: > >> Hi everyone, >> >> I was just trying to do source localization of epilepsy MEG data using >> mne, however, it appears that some functions are missing: >> minimumnormestimate, music, loreta and rv are used in sourceanalysis.m, >> but I can't find the implementations (and neither can matlab). Do I need >> to download additional libraries/toolboxes? >> >> Thank you, >> Stefan Rampp. >> Epilepsycenter Erlangen >> Germany >> From MZvyagintsev at UKAACHEN.DE Thu Jun 22 18:08:43 2006 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Thu, 22 Jun 2006 18:08:43 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <21EE19CF-BE60-4719-BC9E-C1F3737F26B5@fcdonders.ru.nl> Message-ID: Dear Robert, Would be also nice to have an implementaion of LORETA approach for source analysis from your in-house software. I would appreciate if you could send it to me as well. Best regards, Mikhail Zvyagintsev MZvyagintsev at UKAachen.de Robert Oostenveld wrote: > Dear Stefan, > > The SOURCEANALYSIS function is used as wrapper for various > distributed or scanning inverse approaches, and DIPOLEFITTING is used > for underdetermined model fitting to the data. The only underlying > functions for SOURCEANALYSIS that are released on the ftp server are > the lcmv and the dics beamformer methods. The functions that you > refer to are implemented in our in-house version of FieldTrip but > have not been tested thouroughly. I can give you a pre-release if you > are willing to aid in the testing of those functions. > > best regards, > Robert From muthuraman10 at HOTMAIL.COM Fri Jun 23 12:54:57 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Fri, 23 Jun 2006 10:54:57 +0000 Subject: query on CTF software!!! Message-ID: Hello For the Beamformer source analysis, do we need the CTF software because when i am trying out the tutorial in beamforming Matlab >>freq=19.0; >>Ncycles=10; >>dTimeWin=Ncycles/freq; >>cfg=[]; >>cfg.dataset='Subject01.ds'; >>cfg.channel={'MEG' 'STIM'}; >>cfg.trialdef.excludeConditions={'BAD'}; >>cfg.trialdef.includeTrigger=3; >>cfg.trialdef.prestim=0.1+dTimeWin; >>cfg.trialdef.poststim=-0.1; >>datapre=preprocessing(cfg); CTF_READ_RES4 [v 1.12] ....done ( 0.67 sec) i get the error ??? Error using ==> read_fcdc_header could not read CTF res4 header file Error in ==> preprocessing at 263 hdr = read_fcdc_header(cfg.headerfile); with regards muthu From r.oostenveld at FCDONDERS.RU.NL Fri Jun 23 15:23:22 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 23 Jun 2006 15:23:22 +0200 Subject: query on CTF software!!! In-Reply-To: Message-ID: dear Muthuraman On 23 Jun 2006, at 12:54, Muthuraman Muthuraman wrote: > For the Beamformer source analysis, do we need the CTF software > because when i am trying out the tutorial in beamforming You do not need the ctf software to follow the tutorial. The tutorial is based however on a ctf MEG dataset. > CTF_READ_RES4 [v 1.12] > ....done ( 0.67 sec) > > i get the error > > ??? Error using ==> read_fcdc_header > could not read CTF res4 header file > > Error in ==> preprocessing at 263 > hdr = read_fcdc_header(cfg.headerfile); Based on your error I suspect that matlab/fieldtrip cannot find the dataset that you are trying to analyze, or that you matlab path is incorrect. The function "CTF_READ_RES4" is not supposed to be called (it is part of the NIH ctf import routines, e.g. used in EEGLAB), since the default private/read_ctf_res4.m function can deal with the tutorial dataset just fine. Please look into the code of read_fcdc_header (using the matlab debugger) to figure out what your exact problem is. best Robert From r.oostenveld at FCDONDERS.RU.NL Fri Jun 23 15:28:03 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 23 Jun 2006 15:28:03 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <449AC08B.4080202@UKAachen.de> Message-ID: Dear Mikhail My loreta implementation still has some problems and is not 100% correct. I first want to fix it before I release it. If you know how to work with KEY-LORETA (the software from Pasqual Marqui) and could compare the two implementations, you could get a pre-release version and help fix the bugs. Robert On 22 Jun 2006, at 18:08, Mikhail Zvyagintsev wrote: > Dear Robert, > > Would be also nice to have an implementaion of LORETA approach for > source analysis from your in-house software. I would appreciate if > you could send it to me as well. > > Best regards, > > Mikhail Zvyagintsev > > MZvyagintsev at UKAachen.de From MZvyagintsev at UKAACHEN.DE Mon Jun 26 13:15:34 2006 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Mon, 26 Jun 2006 13:15:34 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <29758FB9-8B0E-4C41-8067-BF39410560A0@fcdonders.ru.nl> Message-ID: Dear Robert, Thank you for this encouragement. I was working with LORETA from Pasqual Marqui only with EEG data. I hope it will help me to be useful with fixing bugs. Kindly, Mikhail. MZvyagintsev at UKAachen.de Robert Oostenveld wrote: > Dear Mikhail > > My loreta implementation still has some problems and is not 100% > correct. I first want to fix it before I release it. If you know how > to work with KEY-LORETA (the software from Pasqual Marqui) and could > compare the two implementations, you could get a pre-release version > and help fix the bugs. > > Robert From esther.meeuwissen at FCDONDERS.RU.NL Mon Jun 26 15:04:27 2006 From: esther.meeuwissen at FCDONDERS.RU.NL (Esther Meeuwissen) Date: Mon, 26 Jun 2006 15:04:27 +0200 Subject: artifact rejection Message-ID: Hi all, A few weeks ago I started to work with Fieldtrip. I would like use it to analyze EEG data. I have a question concerning preprocessing of EEG data. I would like to do a artifact rejection during preprocessing partly using the functions in fieldtrip (detection and rejection of muscle artifacts) and partly reading in artifact markers that are exported out of brain vision analyser (I used the raw data inspector to detect eye blinks). I used the following script: EEGchans = {'Fp2', 'F7', 'F3', 'Fz', 'F4', 'F8', 'FC5', 'FC1', 'FCz', 'FC2', 'FC6', 'T 7', 'C3', 'Cz', 'C4', 'T8', 'CP5', 'CP1', 'CP2', 'CP6', 'TP10', 'P7', 'P3', 'Pz', 'P4', 'P8', 'O1', 'O2'}; EOGchans = {'VB','HL', 'HR', 'VO'}; files = {'GOS10B'... 'GOS11C'}; for subject=1:2, % Parameters cfg = []; cfg.datafile = strcat('',files{subject},'.eeg'); cfg.headerfile = strcat('',files{subject},'.vhdr'); cfg.trialdef.trgfile = strcat('',files{subject},'.vmrk'); cfg.rejectfile = strcat('',files{subject},'_Reject.Marker'); cfg.icaresultfile = strcat('',files{subject},'.ica'); cfg.outdatafile = strcat('',files{subject},'.mat'); cfg.channel = {'all'}; cfg.padding = 1.5; cfg.bpfilter = 'yes'; cfg.bpfreq = [0.3 30]; cfg.blc = 'yes'; cfg.blcwindow = [-0.1 0.0]; % EEG options cfg.reref = 'no'; cfg.implicitref = []; cfg.refchannel = {}; % Trial definition cfg.trialdef.stim = [1 2 3 4]; cfg.trialdef.prestim = 0.200; cfg.trialdef.poststim = 1.000; % Artifact options (preprocessing) cfg.artfctdef.reject = 'complete'; cfg.artfctdef.muscle.sgn = EEGchans; cfg.artfctdef.muscle.feedback = 'no'; cfg.artfctdef.muscle.cutoff = 15; % Do preprocessing cfg = definetrial(cfg); cfg = artifact_muscle(cfg) cfg = rejectartifact(cfg); data = preprocessing(cfg); %Save intermediate result save(cfg.outdatafile,'data'); clear data; pack; end; and get the following error message: Error using ==> horzcat CAT arguments dimensions are not consistent. Error in ==> rejectartifact at 182 cfg.artfctdef.type = [{'file'} cfg.artfctdef.type]; Error in ==> preprocessing at 317 [cfg] = rejectartifact(cfg); Error in ==> preproesther1 at 45 data = preprocessing(cfg); By trying to make it work I figured out that it is possible to do both the artifact rejection parts separately using (parts of) the script above but (Fieldtrip wants to combine two matrices to 1 matrix and that is what goes wrong). Does anyone know how (/whether) it is possible to do a artifact detection/rejection in Fieldtrip partly using functions of Fieldtrip itself and partly read markers of EEG parts containing a artifact (the file made by brain vision analyzer)? Thanks in advance for the answer(s)! Esther Meeuwissen From r.oostenveld at FCDONDERS.RU.NL Mon Jun 26 17:17:49 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 26 Jun 2006 17:17:49 +0200 Subject: artifact rejection In-Reply-To: Message-ID: Hi Esther, On 26 Jun 2006, at 15:04, Esther Meeuwissen wrote: > and get the following error message: > > Error using ==> horzcat > CAT arguments dimensions are not consistent. > > Error in ==> rejectartifact at 182 > cfg.artfctdef.type = [{'file'} cfg.artfctdef.type]; I suspect here that cfg.artfctdef.type is a cell-array with strings represented as a vertical cell-vector, and that line 182 tries to combine it with something that Matlab treats as horizontal cell- vector. It is unclear to me why it does that, since the cfg.artfctdef.type is built up internally (you did not explicitely specify it). > Error in ==> preprocessing at 317 > [cfg] = rejectartifact(cfg); > > Error in ==> preproesther1 at 45 > data = preprocessing(cfg); > > By trying to make it work I figured out that it is possible to do > both the > artifact rejection parts separately using (parts of) the script > above but > (Fieldtrip wants to combine two matrices to 1 matrix and that is > what goes > wrong). Does anyone know how (/whether) it is possible to do a > artifact > detection/rejection in Fieldtrip partly using functions of Fieldtrip > itself and partly read markers of EEG parts containing a artifact (the > file made by brain vision analyzer)? I have tried replicating your problem (with the data that I found on / home/electromag/estmee/GOs/analyses/datagoed), but did not encounter any problems up to the definetrial, artifatc_muscle and rejectartifact. However, the problem comes only in when preprocessing is called. For backward compatibility with other peoples old scripts, preprocessing is also calling definetrial and rejhectartifact, and rejectartifact seems confused by being called twice. I made a small change to rejectartifact that hopefully fixes the problem. The updated version is on home/common now and will be on the ftp this evening. best regards, Robert From Esther.Meeuwissen at FCDONDERS.RU.NL Tue Jun 27 09:05:21 2006 From: Esther.Meeuwissen at FCDONDERS.RU.NL (Esther Meeuwissen) Date: Tue, 27 Jun 2006 09:05:21 +0200 Subject: artifact rejection In-Reply-To: <442FC113-07E9-4479-9237-6D20F1D026C8@fcdonders.ru.nl> Message-ID: Robert Oostenveld wrote: > Hi Esther, > > On 26 Jun 2006, at 15:04, Esther Meeuwissen wrote: >> and get the following error message: >> >> Error using ==> horzcat >> CAT arguments dimensions are not consistent. >> >> Error in ==> rejectartifact at 182 >> cfg.artfctdef.type = [{'file'} cfg.artfctdef.type]; > > I suspect here that cfg.artfctdef.type is a cell-array with strings > represented as a vertical cell-vector, and that line 182 tries to > combine it with something that Matlab treats as horizontal > cell-vector. It is unclear to me why it does that, since the > cfg.artfctdef.type is built up internally (you did not explicitely > specify it). > >> Error in ==> preprocessing at 317 >> [cfg] = rejectartifact(cfg); >> >> Error in ==> preproesther1 at 45 >> data = preprocessing(cfg); >> >> By trying to make it work I figured out that it is possible to do >> both the >> artifact rejection parts separately using (parts of) the script above >> but >> (Fieldtrip wants to combine two matrices to 1 matrix and that is what >> goes >> wrong). Does anyone know how (/whether) it is possible to do a artifact >> detection/rejection in Fieldtrip partly using functions of Fieldtrip >> itself and partly read markers of EEG parts containing a artifact (the >> file made by brain vision analyzer)? > > I have tried replicating your problem (with the data that I found on > /home/electromag/estmee/GOs/analyses/datagoed), but did not encounter > any problems up to the definetrial, artifatc_muscle and > rejectartifact. However, the problem comes only in when preprocessing > is called. For backward compatibility with other peoples old scripts, > preprocessing is also calling definetrial and rejhectartifact, and > rejectartifact seems confused by being called twice. > > I made a small change to rejectartifact that hopefully fixes the > problem. The updated version is on home/common now and will be on the > ftp this evening. > > best regards, > Robert > From cgra05 at HST.AUC.DK Thu Jun 1 12:34:31 2006 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 1 Jun 2006 12:34:31 +0200 Subject: SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? In-Reply-To: <003e01c68493$c1b918f0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid, OH - sorry, I didn't notice the question had already been asked on the webpage. However, I still couldn't find the answer on how to create the values for column 2 and 3, since it says at the webpage "The 2nd and 3rd are the X-position and Y-position". However, when I generate the layout file from Neuroscan I get some values for the X and Y coordinates, that are very different from yours, and the plot ends up in a big mess (see the attached file). So I was wondering if you have any idea of how to generate the X- and Y-positions from Neuroscan ??? (I have attached the generated layout-file from Neuroscan, in case that helps you. This one is named test128_neuroscan.lay) We were also wondering about the figure you e-mailed from our data, all channels appeared to be blue with a green cone (and then some frequency contributions in some channels). Is it because of some settings not edited correct, because we would have expected something like in the documentation - like figure 2 at the "Time-frequency Analysis Using Multitapers and Wavelets" page. >>From the test128_neuroscan.lay I tried to create the layout file test128_fieldtrip.lay, and got the plot shown in figure test128_fieldtrip.png Best regards, Carina Graversen -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 31. maj 2006 10:23 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, If you look at the FieldTrip page -> documentation -> frequently asked questions you can find the question (and answer): What is the format of the layout file, which is used for plotting? ...The 4th and 5th column specify the with and height of the subplot that will be made in multiplotER and multiplotTFR.... So the two columns with the same value for all channels are those columns. Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Wednesday, May 31, 2006 10:58 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Ingrid. Thanks a lot. I have tried to generate my own layout file in Neuroscan, but unfortunately it doesn't work. So I was wondering if you can tell me the format of the layout-file, because when I look at your file, 2 of the columns contain the same value for all channels. I have tried to generate for both cartesian and polor, but none of them matches. In the generated file I get the format: Can I change my input configuration to either use this format, or how should I change the format of the layout file ??? Thanks in advance :o) /Carina -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 26. maj 2006 13:29 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, Thanks for sending me the data. Indeed the biosemi 128ch layout doesn't correspond to your layout. You have 128 channels labeled from 1 to 128. If you open biosemi128.lay in a text-editor you can see that this layout file has 150 channels labeled from A1 to P7. The labels in your data (TFRmult.label) and the labels in the layout file don't match, that's why you got an empty figure (I'll add an error in the plot function, so that when no labels match you'll get an error message in the future). So what you have to do now is to make your own layout file that matches the data; with the correct x and y coordinates of the 128 channels and the same label names as in your data. Just as an illustration I attached an adapted version of the biosemi128.lay file, with only the first 128 channels, and labels 1 to 128, just as in your data. With the following configuration: cfg8 = []; cfg8.baseline = [0 0.1]; cfg8.xlim = [0 0.3] cfg8.ylim = [15 29]; cfg8.zlim = [-100 100]; cfg8.showlabels = 'yes'; cfg8.layout = 'testlay128.lay'; I got the attached figure from your data. Good luck, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: Wednesday, May 24, 2006 8:57 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina Are you sure that the biosemi 128ch layout corresponds with your electrode layout? Open the layout file in a tetx editor and look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#what_is_the_format _of_the_layout_file_which_is_used_for_plotting I suggest that you try the elec1010.lay or elec1005.lay, or even better, that you construct your own layout file corresponding with your own electrode locations. Robert On 24 May 2006, at 12:29, Carina Graversen wrote: > Hi. > > I'm trying to use the Fieldtrip program to create a wavelet plot of > my EEG > data. > > I have used it previously for 64 channel recordings, but now I'm > working > with 128 channels of data, which is causing me some problems. The > only thing > I have changed is the command: > cfg8.layout = 'biosemi128.lay'; > > But now the figure only outputs a grey page with no Time-Frequency > distributions at all. > > Can anyone tell me what I'm doing wrong - below is a complete list > of all > the commands I use :o). > > Best Regards, > Carina Graversen > > > > > % > ********************************************************************** > *** > % EVENTRELATEDAVERAGING > % > ********************************************************************** > *** > cfg1 = []; % empty > configuration > cfg1.datafile = 'test128.eeg'; % > 128 channel > Neuroscan eeg file > cfg1.headerfile = 'test128.eeg'; > cfg1.channel = 'all'; > > dataFIC = preprocessing(cfg1); % > Preprocess! > > cfg2 = []; % empty > configuration > > avgFIC = timelockanalysis(cfg2, dataFIC); > > > % % > ********************************************************************** > *** > % % WAVELET > % % > ********************************************************************** > *** > cfg7 = []; > cfg7.output = 'pow'; > cfg7.method = 'wltconvol' > cfg7.foi = 1:2:30; > cfg7.t_ftimwin = 5./cfg7.foi; > cfg7.tapsmofrq = 0.4 *cfg7.foi; > cfg7.toi = 0:0.01:0.5; > > TFRmult = freqanalysis(cfg7, avgFIC); > > cfg8 = []; > cfg8.baseline = [-0.5 0.5]; > cfg8.xlim = [0 0.5] > cfg8.zlim = [-3e-27 0.2]; > cfg8.showlabels = 'yes'; > cfg8.layout = 'biosemi128.lay'; > > multiplotTFR(cfg8, TFRmult); > -------------- next part -------------- A non-text attachment was scrubbed... Name: test128_neuroscan.lay Type: application/octet-stream Size: 7368 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test128_fieldtrip.png Type: image/png Size: 4916 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testlay128_fieldtrip.lay Type: application/octet-stream Size: 5173 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Thu Jun 1 12:35:43 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 1 Jun 2006 12:35:43 +0200 Subject: Filtering In-Reply-To: <000001c683f3$4e30cb30$90514484@dellgx240> Message-ID: Hi Vladimir On 30 May 2006, at 16:14, Vladimir Litvak wrote: > As I understand, when I do filtering in preprocessing the filter is > applied before the data is cut to epochs. Not completely: a segment of data is read from file that contains the trial (trl) plus the optional padding. That segment is filtered and then the padding is thrown away. Eventual filter atrifacts at the boundaries of the data segment that was read are in the padding and thus would not affect the data of interest itself. If you apply padding, the effect is the same as if you would have filtered the complete data continuously. > I now want to do some analysis where I want to filter after the > epochs are cut out (because there are TMS deltas there and I don't > want them to affect everything around them). Is there a simple way > to filter epoched data in FT (other than by my own code)? You can specify cfg.padding=0 in preprocessing and ensure that the TMS pulse is not inside the trial definition. You can do preprocessing without any options and then use timelockanalysis (with keeptrials) on it. Timelockanalysis supports almost all options that preprocessing has, i.e. all filtering and baselinecorection options, but of course cannot do the padding. Those additional options are not documented in timelockanalysis, but look in the code and you will see them. Doing it in timelockanalysis has the advantage that it is easier to play around with filter settings (i.e. it is faster not having to read the data every time). Also interesting to know perhaps is that you can also apply timelockanalysis and its filtering to an average, i.e. timelockanalysis will accept a timelock-structure as input. So you can average in the first call to timelockanalysis, and then throw that average into timelockanalysis a second time to see the effect of the filter. In the latter case only the average is filtered, i.e. it is very fast. best Robert From ingrid.nieuwenhuis at FCDONDERS.RU.NL Thu Jun 1 13:21:11 2006 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 1 Jun 2006 13:21:11 +0200 Subject: SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? In-Reply-To: Message-ID: Hi Carina, The problem is that the width and height of the boxes (column 4 and 5) are too big compared to your x and y coordinates. What multiplotTFR does is that it plots the TFR boxes at the specified coordinates. The x and y coordinates are between +/- 0 and 0.7 and the box width/height is 0.18 and 1.14, so all the plots are plotted on top of each other. That's why it is a mess. So you could use the x and y coordinates, but the boxes should be smaller, or you can scale it al up. What comes out of the plots is just what the data is. Probably depends on your settings during the TFR analysis. The dark blue at the edges and bottom are NaN's in the data. Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Thursday, June 01, 2006 12:35 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Ingrid, OH - sorry, I didn't notice the question had already been asked on the webpage. However, I still couldn't find the answer on how to create the values for column 2 and 3, since it says at the webpage "The 2nd and 3rd are the X-position and Y-position". However, when I generate the layout file from Neuroscan I get some values for the X and Y coordinates, that are very different from yours, and the plot ends up in a big mess (see the attached file). So I was wondering if you have any idea of how to generate the X- and Y-positions from Neuroscan ??? (I have attached the generated layout-file from Neuroscan, in case that helps you. This one is named test128_neuroscan.lay) We were also wondering about the figure you e-mailed from our data, all channels appeared to be blue with a green cone (and then some frequency contributions in some channels). Is it because of some settings not edited correct, because we would have expected something like in the documentation - like figure 2 at the "Time-frequency Analysis Using Multitapers and Wavelets" page. >>From the test128_neuroscan.lay I tried to create the layout file test128_fieldtrip.lay, and got the plot shown in figure test128_fieldtrip.png Best regards, Carina Graversen -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 31. maj 2006 10:23 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, If you look at the FieldTrip page -> documentation -> frequently asked questions you can find the question (and answer): What is the format of the layout file, which is used for plotting? ...The 4th and 5th column specify the with and height of the subplot that will be made in multiplotER and multiplotTFR.... So the two columns with the same value for all channels are those columns. Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Wednesday, May 31, 2006 10:58 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Ingrid. Thanks a lot. I have tried to generate my own layout file in Neuroscan, but unfortunately it doesn't work. So I was wondering if you can tell me the format of the layout-file, because when I look at your file, 2 of the columns contain the same value for all channels. I have tried to generate for both cartesian and polor, but none of them matches. In the generated file I get the format: Can I change my input configuration to either use this format, or how should I change the format of the layout file ??? Thanks in advance :o) /Carina -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 26. maj 2006 13:29 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, Thanks for sending me the data. Indeed the biosemi 128ch layout doesn't correspond to your layout. You have 128 channels labeled from 1 to 128. If you open biosemi128.lay in a text-editor you can see that this layout file has 150 channels labeled from A1 to P7. The labels in your data (TFRmult.label) and the labels in the layout file don't match, that's why you got an empty figure (I'll add an error in the plot function, so that when no labels match you'll get an error message in the future). So what you have to do now is to make your own layout file that matches the data; with the correct x and y coordinates of the 128 channels and the same label names as in your data. Just as an illustration I attached an adapted version of the biosemi128.lay file, with only the first 128 channels, and labels 1 to 128, just as in your data. With the following configuration: cfg8 = []; cfg8.baseline = [0 0.1]; cfg8.xlim = [0 0.3] cfg8.ylim = [15 29]; cfg8.zlim = [-100 100]; cfg8.showlabels = 'yes'; cfg8.layout = 'testlay128.lay'; I got the attached figure from your data. Good luck, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: Wednesday, May 24, 2006 8:57 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina Are you sure that the biosemi 128ch layout corresponds with your electrode layout? Open the layout file in a tetx editor and look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#what_is_the_format _of_the_layout_file_which_is_used_for_plotting I suggest that you try the elec1010.lay or elec1005.lay, or even better, that you construct your own layout file corresponding with your own electrode locations. Robert On 24 May 2006, at 12:29, Carina Graversen wrote: > Hi. > > I'm trying to use the Fieldtrip program to create a wavelet plot of > my EEG > data. > > I have used it previously for 64 channel recordings, but now I'm > working > with 128 channels of data, which is causing me some problems. The > only thing > I have changed is the command: > cfg8.layout = 'biosemi128.lay'; > > But now the figure only outputs a grey page with no Time-Frequency > distributions at all. > > Can anyone tell me what I'm doing wrong - below is a complete list > of all > the commands I use :o). > > Best Regards, > Carina Graversen > > > > > % > ********************************************************************** > *** > % EVENTRELATEDAVERAGING > % > ********************************************************************** > *** > cfg1 = []; % empty > configuration > cfg1.datafile = 'test128.eeg'; % > 128 channel > Neuroscan eeg file > cfg1.headerfile = 'test128.eeg'; > cfg1.channel = 'all'; > > dataFIC = preprocessing(cfg1); % > Preprocess! > > cfg2 = []; % empty > configuration > > avgFIC = timelockanalysis(cfg2, dataFIC); > > > % % > ********************************************************************** > *** > % % WAVELET > % % > ********************************************************************** > *** > cfg7 = []; > cfg7.output = 'pow'; > cfg7.method = 'wltconvol' > cfg7.foi = 1:2:30; > cfg7.t_ftimwin = 5./cfg7.foi; > cfg7.tapsmofrq = 0.4 *cfg7.foi; > cfg7.toi = 0:0.01:0.5; > > TFRmult = freqanalysis(cfg7, avgFIC); > > cfg8 = []; > cfg8.baseline = [-0.5 0.5]; > cfg8.xlim = [0 0.5] > cfg8.zlim = [-3e-27 0.2]; > cfg8.showlabels = 'yes'; > cfg8.layout = 'biosemi128.lay'; > > multiplotTFR(cfg8, TFRmult); > From r.oostenveld at FCDONDERS.RU.NL Thu Jun 1 13:51:02 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 1 Jun 2006 13:51:02 +0200 Subject: SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? In-Reply-To: Message-ID: Hi Carina, Please take attached "layoutplot" function and copy it into the fieldtrip directory. Then do >> cfg.layout = 'CTF151.lay' cfg = layout: 'CTF151.lay' >> layoutplot(cfg) reading layout from file CTF151.lay and you will get the attached figure for the 151 channel CTF system. Then try plotting the other layouts (the *.lay files) and your own layout, and modify the values in your own layout file (in a text editor) untill you like what you see. Robert PS when I was looking at the other layouts, I noticed that the elec1020, elec1010 and elec1005 layouts supplied with fieldtrip are not optimal, since they also have overlapping boxes. -------------- next part -------------- A non-text attachment was scrubbed... Name: layoutplot.m Type: application/octet-stream Size: 998 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 1.png Type: image/png Size: 27957 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Thu Jun 1 13:58:48 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 1 Jun 2006 13:58:48 +0200 Subject: query on coherence source analysis In-Reply-To: Message-ID: Dear Muthuraman I have not been able to reproduce your error. I suggest that you get the latest version of FieldTrip from our FTP server and try again. best egards, Robert PS this is the test script I used. It uses some simulated data, which again uses a MEG gradiometer definition and a head model from the tutorial data. ----------------- % read some data that is required to simulate MEG data, i.e. volume model, % sensor positions and MRI (optional, only for plotting) vol = read_ctf_hdm('Subject01.hdm'); hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); grad = hdr.grad; % construct the simulated MEG data for condition A ("active") cfg = []; cfg.vol = vol; cfg.grad = grad; cfg.fsample = 300; cfg.ntrials = 2; cfg.triallength = 1; cfg.dip.pos = [0 7 8]; cfg.dip.mom = [1 0 0]; cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); cfg.absnoise = 1e-8; data = dipolesimulation(cfg); % add the source signal as fake EMG channel for i=1:cfg.ntrials data.trial{i}(end+1,:) = cfg.dip.signal + randn(size (cfg.dip.signal)); end data.label{end+1} = 'EMG'; cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'MEG' 'EMG'},data.label); cfg.channelcmb={'MEG' 'EMG'}; freq=freqanalysis(cfg,data); From olga at GRAPHICMIND.INFO Sat Jun 3 12:45:41 2006 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Sat, 3 Jun 2006 14:45:41 +0400 Subject: deleting two EOG channale from data-stucture Message-ID: Dear list members, I would like to delete two channels from my data. How is it better to do this? Best Regards, Olga -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga at GRAPHICMIND.INFO Sat Jun 3 14:16:57 2006 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Sat, 3 Jun 2006 16:16:57 +0400 Subject: and clusterrandomization Message-ID: Thank you very much, Eric! That was an inconsistency in the loci of EOG channels between subjects. Now I corrected it: HEOG and VEOG data are still presented in the data structure, but do not have the location (pnt 0 0 0). Is it OK? The results looks as what I excpected. Best Regards, Olga. ----- Original Message ----- From: "Eric Maris" To: Sent: Friday, May 26, 2006 5:35 PM Subject: Re: [FIELDTRIP] and clusterrandomization > Dear Olga, > > > But the problems is still in my clusterrandomization. > Could the fact that the order of the channel in the file (C_vc11.label) is > not the same as in the C_vc11.elec.label influences the result of > clusterrandomization (I do not have my neigbouring channel file)? > > > That should not matter. However, the labels in your data structure (.label > in the output of timelockgrandaverage) should exactly match the labels in > the elec-structure. If that is OK, then something might have gone wrong > with the combination of the data of the different subjects. Do they all > have the same elec-structure? If the same physical channel has different > labels for different subjects, then this may create inconsistencies > between EEGlab and Fieldtrip. For Fieldtrip, channels that have the same > label are assumed to be physically identical, even if they are in > different positions in the data structure. This is only a guess, of > course. > > > kind regards, > > Eric Maris > > > > > > > > > > Best Regards, > Olga. > ----- Original Message ----- > From: Ingrid Nieuwenhuis > To: FIELDTRIP at NIC.SURFNET.NL > Sent: Wednesday, May 24, 2006 8:45 PM > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > Hi Olga, > > > > About the z-param: > > This is the field that contains the data to be plotted; for instance > 'avg', 'powspctrm' or 'cohspctrm'. Normally the function looks in your > data.dimord to find out which z-param to use. To make the function work > you could give cfg.zparam = 'avg' (for instance if you want to plot an > ERF/ERP). But if you could send me what the dimord field of the data that > you want to plot is, I could look why the plot functions don't extract the > correct zparam themselves. > > > > About the timelockgranaveraging: I also think it should be the same. I > have no idea what it could be. > > > > Good luck, > > Ingrid Nieuwenhuis > > > > > ------------------------------------------------------------------------------ > > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Olga Sysoeva > Sent: Wednesday, May 24, 2006 5:44 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > > Dear List member, > > > > Sorry for such dull questions but, > > I am again facing the new problems with Fieldtrip, although did not solve > some previous one (still can not singleplot and multiplot anything 'cause > of "unknown zparam field". > > > > OK, about new one :-) > > > > It seems that I did not use write the timelockgranaveraging. > > > > The problem must be here, when I made grand averaging of all my 11 > subject > data > > cfg =[]; > cfg.keepindividual = 'yes' > C_vc11 = > > timelockgrandaverage(cfg,vc_c_avg1,vc_c_avg2,vc_c_avg3,vc_c_avg4,vc_c_avg5, > vc_c_avg6,vc_c_avg7,vc_c_avg8,vc_c_avg9,vc_c_avg10,vc_c_avg11 ); > > As I understand the > > vc_c_avg11.avg([9],[43]) should be similar with C_vc11.individual ([11], > [9], [43]) > But it is not. > What can it be? > > Best Regards, > > Olga. > > > > > > ----- Original Message ----- > > From: Olga Sysoeva > > To: FIELDTRIP at NIC.SURFNET.NL > > Sent: Saturday, May 13, 2006 4:34 PM > > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > > Thank you very much, Lilla! > > Now I knwo what to do but faced the problem with " unknown zparam > field" when ploting the results. Unfortunatly cfg.zparam does not > discribed in help file... > > Best Regards, Olga > > ----- Original Message ----- > > From: Lilla Magyari > > To: FIELDTRIP at NIC.SURFNET.NL > > Sent: Saturday, May 13, 2006 3:11 PM > > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data > within-subject > > > > Dear Olga, > > > > I am just studying time-frequency analysis but I have done already on > my data, so perhaps I can help you. > > First, yes, you have to do freqanalysis on the preprocessed data of > the individual subjects for all conditions that you want to compare (i.e. > the input for this function contains all trials from one subject in one > condition.) And it is also important that the other input for this > function is the cfg where for example, in the cfg.method you have to > specify what kind of time-frequency analysis you want to use. (You have to > write 'wltconvol' for wavelet transformation and 'mltconvol' for > multitaper analysis.) > > When you use freqanalysis as output you can get TFR for one subject > in one condition (but it is also possible to keep the information for the > individual trials of the condition by specifying cfg.keeptrials = 'yes'). > When you have the TFRs for each subject you can grandaverage them with > freqgrandaverage where the input is the TFRs of all subjects (and before > averaging you can use also freqbaseline for giving a baseline for your > TFRs). > > > > I hope it helps. > > > > Best regards, > > Lilla Magyari > > > > > > > > > -------------------------------------------------------------------------- > > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Olga Sysoeva > Sent: Saturday, May 13, 2006 9:28 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > > Dear list members, > > > > Thank you everybody for your help! I've already got interesting > results using clusterrandomization on my data! Thanks a lot! > > > > Now I have a question about using the clusterrandomization on 3-D > data (channel-time-frequency) in within-subject analysis. > > As I understand it is possible with Fieldtrip, but I really newby in > time-frequency anlysis, therefore wanted your comments, > > as far as I didn't find the example of the application of > clusteranalysis on this set of the data in tuturial. > > > > I successfully conduct the within-subject clusterrandomization on my > grand-average data, which does not have the third, frequency demintion. > > Now I want to add it. But I could not apply freqanalyisis on > grandavarage data, could I? Should I made the TFR of individual data and > than grand-avarage the result? > > Which function should I use? > > > > Best Regards, > > Olga. From olga at GRAPHICMIND.INFO Sat Jun 3 14:26:35 2006 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Sat, 3 Jun 2006 16:26:35 +0400 Subject: clusrand: 19 channels 0 minnbchan Message-ID: Dear experts, Does it make sense to make clusterrandomization if I put "0" in the min number of neibouring channels if I have only 19 of them (10-20 system)? As I understand in this case just the time is considered when clustering. How many consequent time point is requiered to build a cluster? Best Regards, Olga. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Sat Jun 3 18:47:21 2006 From: maris at NICI.RU.NL (Eric Maris) Date: Sat, 3 Jun 2006 18:47:21 +0200 Subject: deleting two EOG channale from data-stucture Message-ID: Dear Olga, I would like to delete two channels from my data. How is it better to do this? Type "help channelselection" at the Matlab command line. This will give you information on how the Fieldtrip functions perform channelselection on the basis of the input in cfg.channel. I don't have Matlab running now, but I think that '-EOG' in cfg.channel will do the job you request. greetings, Eric From maris at NICI.RU.NL Sat Jun 3 18:50:06 2006 From: maris at NICI.RU.NL (Eric Maris) Date: Sat, 3 Jun 2006 18:50:06 +0200 Subject: and clusterrandomization Message-ID: Dear Olga, > That was an inconsistency in the loci of EOG channels between subjects. > Now I corrected it: HEOG and VEOG data are still presented in the data > structure, but do not have the location (pnt 0 0 0). Is it OK? The results > looks as what I excpected. Because you never will include the EOG-channels in an analysis of the EEG-channels, the location of the EOG is not required by clusterrandanalysis. greetings, Eric Maris > Best Regards, > Olga. > > ----- Original Message ----- > From: "Eric Maris" > To: > Sent: Friday, May 26, 2006 5:35 PM > Subject: Re: [FIELDTRIP] and clusterrandomization > > >> Dear Olga, >> >> >> But the problems is still in my clusterrandomization. >> Could the fact that the order of the channel in the file (C_vc11.label) >> is not the same as in the C_vc11.elec.label influences the result of >> clusterrandomization (I do not have my neigbouring channel file)? >> >> >> That should not matter. However, the labels in your data structure >> (.label in the output of timelockgrandaverage) should exactly match the >> labels in the elec-structure. If that is OK, then something might have >> gone wrong with the combination of the data of the different subjects. Do >> they all have the same elec-structure? If the same physical channel has >> different labels for different subjects, then this may create >> inconsistencies between EEGlab and Fieldtrip. For Fieldtrip, channels >> that have the same label are assumed to be physically identical, even if >> they are in different positions in the data structure. This is only a >> guess, of course. >> >> >> kind regards, >> >> Eric Maris >> >> >> >> >> >> >> >> >> >> Best Regards, >> Olga. >> ----- Original Message ----- >> From: Ingrid Nieuwenhuis >> To: FIELDTRIP at NIC.SURFNET.NL >> Sent: Wednesday, May 24, 2006 8:45 PM >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject >> >> >> Hi Olga, >> >> >> >> About the z-param: >> >> This is the field that contains the data to be plotted; for instance >> 'avg', 'powspctrm' or 'cohspctrm'. Normally the function looks in your >> data.dimord to find out which z-param to use. To make the function work >> you could give cfg.zparam = 'avg' (for instance if you want to plot an >> ERF/ERP). But if you could send me what the dimord field of the data that >> you want to plot is, I could look why the plot functions don't extract >> the correct zparam themselves. >> >> >> >> About the timelockgranaveraging: I also think it should be the same. I >> have no idea what it could be. >> >> >> >> Good luck, >> >> Ingrid Nieuwenhuis >> >> >> >> >> ------------------------------------------------------------------------------ >> >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >> Behalf Of Olga Sysoeva >> Sent: Wednesday, May 24, 2006 5:44 PM >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject >> >> >> >> Dear List member, >> >> >> >> Sorry for such dull questions but, >> >> I am again facing the new problems with Fieldtrip, although did not >> solve some previous one (still can not singleplot and multiplot anything >> 'cause of "unknown zparam field". >> >> >> >> OK, about new one :-) >> >> >> >> It seems that I did not use write the timelockgranaveraging. >> >> >> >> The problem must be here, when I made grand averaging of all my 11 >> subject >> data >> >> cfg =[]; >> cfg.keepindividual = 'yes' >> C_vc11 = >> >> timelockgrandaverage(cfg,vc_c_avg1,vc_c_avg2,vc_c_avg3,vc_c_avg4,vc_c_avg5, >> vc_c_avg6,vc_c_avg7,vc_c_avg8,vc_c_avg9,vc_c_avg10,vc_c_avg11 ); >> >> As I understand the >> >> vc_c_avg11.avg([9],[43]) should be similar with C_vc11.individual ([11], >> [9], [43]) >> But it is not. >> What can it be? >> >> Best Regards, >> >> Olga. >> >> >> >> >> >> ----- Original Message ----- >> >> From: Olga Sysoeva >> >> To: FIELDTRIP at NIC.SURFNET.NL >> >> Sent: Saturday, May 13, 2006 4:34 PM >> >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data >> within-subject >> >> >> >> Thank you very much, Lilla! >> >> Now I knwo what to do but faced the problem with " unknown zparam >> field" when ploting the results. Unfortunatly cfg.zparam does not >> discribed in help file... >> >> Best Regards, Olga >> >> ----- Original Message ----- >> >> From: Lilla Magyari >> >> To: FIELDTRIP at NIC.SURFNET.NL >> >> Sent: Saturday, May 13, 2006 3:11 PM >> >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data >> within-subject >> >> >> >> Dear Olga, >> >> >> >> I am just studying time-frequency analysis but I have done already >> on my data, so perhaps I can help you. >> >> First, yes, you have to do freqanalysis on the preprocessed data of >> the individual subjects for all conditions that you want to compare (i.e. >> the input for this function contains all trials from one subject in one >> condition.) And it is also important that the other input for this >> function is the cfg where for example, in the cfg.method you have to >> specify what kind of time-frequency analysis you want to use. (You have >> to write 'wltconvol' for wavelet transformation and 'mltconvol' for >> multitaper analysis.) >> >> When you use freqanalysis as output you can get TFR for one subject >> in one condition (but it is also possible to keep the information for the >> individual trials of the condition by specifying cfg.keeptrials = 'yes'). >> When you have the TFRs for each subject you can grandaverage them with >> freqgrandaverage where the input is the TFRs of all subjects (and before >> averaging you can use also freqbaseline for giving a baseline for your >> TFRs). >> >> >> >> I hope it helps. >> >> >> >> Best regards, >> >> Lilla Magyari >> >> >> >> >> >> >> >> >> -------------------------------------------------------------------------- >> >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >> Behalf Of Olga Sysoeva >> Sent: Saturday, May 13, 2006 9:28 AM >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: [FIELDTRIP] clusterrandomization on 3D-data within-subject >> >> >> >> Dear list members, >> >> >> >> Thank you everybody for your help! I've already got interesting >> results using clusterrandomization on my data! Thanks a lot! >> >> >> >> Now I have a question about using the clusterrandomization on 3-D >> data (channel-time-frequency) in within-subject analysis. >> >> As I understand it is possible with Fieldtrip, but I really newby in >> time-frequency anlysis, therefore wanted your comments, >> >> as far as I didn't find the example of the application of >> clusteranalysis on this set of the data in tuturial. >> >> >> >> I successfully conduct the within-subject clusterrandomization on my >> grand-average data, which does not have the third, frequency demintion. >> >> Now I want to add it. But I could not apply freqanalyisis on >> grandavarage data, could I? Should I made the TFR of individual data and >> than grand-avarage the result? >> >> Which function should I use? >> >> >> >> Best Regards, >> >> Olga. From maris at NICI.RU.NL Sat Jun 3 18:53:19 2006 From: maris at NICI.RU.NL (Eric Maris) Date: Sat, 3 Jun 2006 18:53:19 +0200 Subject: clusrand: 19 channels 0 minnbchan Message-ID: Dear Olga, Does it make sense to make clusterrandomization if I put "0" in the min number of neibouring channels if I have only 19 of them (10-20 system)? As I understand in this case just the time is considered when clustering. How many consequent time point is requiered to build a cluster? Yes, it makes sense. The cfg.minnbchan-field is a way to suppress the tendency of the cluster-growing algorithm to connect everything with everything, even on the basis of noise. The FA-rate is not affect by the value of cfg.minnbchan. greetings, Eric Maris From pchris at UNC.EDU Mon Jun 5 19:05:30 2006 From: pchris at UNC.EDU (Punita Christopher) Date: Mon, 5 Jun 2006 19:05:30 +0200 Subject: dipole model Message-ID: Has anyone seen any literature that deals with a spherical multiple layer head model in which the dipole spans across layers i.e. the source and sink of the dipole are in separate layers. Thanks, Punita From r.oostenveld at FCDONDERS.RU.NL Tue Jun 6 10:50:02 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 Jun 2006 10:50:02 +0200 Subject: dipole model In-Reply-To: Message-ID: Hi Punita, On 5 Jun 2006, at 19:05, Punita Christopher wrote: > Has anyone seen any literature that deals with a spherical multiple > layer > head model in which the dipole spans across layers i.e. the source and > sink of the dipole are in separate layers. In the dipole model the source and sink are infintely close together. The difference on the scalp between a dipole and a source+sink model with only a few mm in between will be negligible. A source+sink model with more distance between them can be modelled as such, it requires the solution of the monopole in a sphere (i.e. the desired source +sink consists of the superposition of two monopoles). I am not sure whether an analytical solution for that exsists in a 3- or 4-shell model, but I would would guess that it does (*). For a BEM model it is trivial to replace the dipole infinite medium potential with a monopole infinite medium potential, i.e the BEM formulation (separation of source and volume conduction) allows the specification of arbitrary sources. best Robert *) I don't know literature for a monopole in a multi-shell sphere, but I would expect it to be in either textbooks as a didactical example or in older articles (70s or 80s). You may want to search for multipole expansions, which are described in more recent literature, the monopole is the first term (0th order) of that, the dipole the second term. Perhaps "Phys Med Biol. 2001 Aug;46(8):2255-66. A study of equivalent source techniques for high-resolution EEG imaging. Yao D, Zhou Y, Zeng M, Fan S, Lian J, Wu D, Ao X, Chen L, He B." could provide more insight. From muthuraman10 at HOTMAIL.COM Tue Jun 6 11:19:56 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Tue, 6 Jun 2006 09:19:56 +0000 Subject: query on coherence analysis In-Reply-To: Message-ID: Hello Thanks for the comments, i have downloaded the latest version and now i am able to calculate using mtmwelch but i get a error when i am plotting i will included the matlab commands >>cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); >>fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='foi'; cfg.yparam='cohspctrm'; cfg.xlim=[0 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG26'; singleplotER(cfg,fd); ??? Reference to non-existent field 'foi'. Error in ==> singleplotER at 272 plot(varargin{k-1}.(cfg.xparam), P, style); with regards muthu >From: Robert Oostenveld >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence source analysis >Date: Thu, 1 Jun 2006 13:58:48 +0200 > >Dear Muthuraman > >I have not been able to reproduce your error. I suggest that you get the >latest version of FieldTrip from our FTP server and try again. > >best egards, >Robert > >PS this is the test script I used. It uses some simulated data, which >again uses a MEG gradiometer definition and a head model from the tutorial >data. > > >----------------- >% read some data that is required to simulate MEG data, i.e. volume model, >% sensor positions and MRI (optional, only for plotting) >vol = read_ctf_hdm('Subject01.hdm'); >hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); >grad = hdr.grad; > >% construct the simulated MEG data for condition A ("active") >cfg = []; >cfg.vol = vol; >cfg.grad = grad; >cfg.fsample = 300; >cfg.ntrials = 2; >cfg.triallength = 1; >cfg.dip.pos = [0 7 8]; >cfg.dip.mom = [1 0 0]; >cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); >cfg.absnoise = 1e-8; >data = dipolesimulation(cfg); > >% add the source signal as fake EMG channel >for i=1:cfg.ntrials > data.trial{i}(end+1,:) = cfg.dip.signal + randn(size (cfg.dip.signal)); >end >data.label{end+1} = 'EMG'; > >cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'MEG' 'EMG'},data.label); >cfg.channelcmb={'MEG' 'EMG'}; >freq=freqanalysis(cfg,data); > > > From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Jun 6 13:33:28 2006 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 6 Jun 2006 13:33:28 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: Dear Muthuraman, cfg.xparam should not be 'foi', but 'freq' (see help singleplotER) Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Tuesday, June 06, 2006 11:20 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] query on coherence analysis Hello Thanks for the comments, i have downloaded the latest version and now i am able to calculate using mtmwelch but i get a error when i am plotting i will included the matlab commands >>cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); >>fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='foi'; cfg.yparam='cohspctrm'; cfg.xlim=[0 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG26'; singleplotER(cfg,fd); ??? Reference to non-existent field 'foi'. Error in ==> singleplotER at 272 plot(varargin{k-1}.(cfg.xparam), P, style); with regards muthu >From: Robert Oostenveld >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence source analysis >Date: Thu, 1 Jun 2006 13:58:48 +0200 > >Dear Muthuraman > >I have not been able to reproduce your error. I suggest that you get the >latest version of FieldTrip from our FTP server and try again. > >best egards, >Robert > >PS this is the test script I used. It uses some simulated data, which >again uses a MEG gradiometer definition and a head model from the tutorial >data. > > >----------------- >% read some data that is required to simulate MEG data, i.e. volume model, >% sensor positions and MRI (optional, only for plotting) >vol = read_ctf_hdm('Subject01.hdm'); >hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); >grad = hdr.grad; > >% construct the simulated MEG data for condition A ("active") >cfg = []; >cfg.vol = vol; >cfg.grad = grad; >cfg.fsample = 300; >cfg.ntrials = 2; >cfg.triallength = 1; >cfg.dip.pos = [0 7 8]; >cfg.dip.mom = [1 0 0]; >cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); >cfg.absnoise = 1e-8; >data = dipolesimulation(cfg); > >% add the source signal as fake EMG channel >for i=1:cfg.ntrials > data.trial{i}(end+1,:) = cfg.dip.signal + randn(size (cfg.dip.signal)); >end >data.label{end+1} = 'EMG'; > >cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'MEG' 'EMG'},data.label); >cfg.channelcmb={'MEG' 'EMG'}; >freq=freqanalysis(cfg,data); > > > From ingrid.nieuwenhuis at FCDONDERS.RU.NL Wed Jun 14 11:55:53 2006 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Wed, 14 Jun 2006 11:55:53 +0200 Subject: missing cumtapcnt field Message-ID: I'm (trying to) beamform, but I get the following error: reference to non-existent field 'cumtapcnt' In prepare_freq_matrices line 124. Ntrials = length(freq.cumtapcnt) I used freqanalysis method 'mtmconvol' to do make the freq, and it indeed doesn't contain a 'cumtapcnt' cfg = []; cfg.method = 'mtmconvol'; cfg.output = 'powandcsd'; cfg.foi = 90; cfg.t_ftimwin = 0.5; cfg.tapsmofrq = 30; cfg.pad = 'maxperlen'; cfg.taper = 'dpss'; cfg.keeptrials = 'yes'; cfg.keeptapers = 'no'; cfg.toi = 0.75 freq_BF = freqanalysis(cfg, data); So my questions: - Why doesn't my freq contain a cumtapcnt field. Should I have kept my tapers (cfg.keeptapers = 'yes')? - Can I solve this without having to freqanalysis my data all over again, I can see in my freq.crsspctrm = [76 x 11476 double] that I have 76 trials. Can I for instance just make a vector of ones with length 76 and put that in my freq, or will that create problems? Thanks a lot, Ingrid From Jan.Schoffelen at FCDONDERS.RU.NL Wed Jun 14 12:42:08 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Wed, 14 Jun 2006 12:42:08 +0200 Subject: missing cumtapcnt field In-Reply-To: Message-ID: Hi Ingrid, >Can I for instance just make a vector of ones with length 76 and put that >in my freq, or will that create problems? The answer to this question is yes. Indeed, no cumtapcnt is passed back when using freqanalysis_mtmconvol. Should be fixed, though. In your case I think it is sufficient just to provide a vector which has a dimensionality of Nx1, N being the number of epoch. The content of this vector will not be used later on in this case. On the other hand, the cumtapcnt-vector, as outputted by for example freqanalysis_mtmfft contains for each epoch the number of tapers which have been used for the estimation of the spectra for that particular epoch. Please note that if you set the option cfg.keeptapers = 'yes', the vector consists only of ones (or if you use e.g. a single hanning-taper, or such a low amount of smoothing, that you only need one 'dpss'-taper, in which case by the way it does not make sense to use the 'dpss'). In any other case, the cumtapcnt-vector contains a number, which can be different for each epoch (when you have trials of different lengths). You can easily compute the number of tapers, this will be: 2xNxK-1, with N being the length of your data segment (in seconds), and K being the taper-smoothing you specified in cfg.tapsmofrq. Yours, JM From nathanweisz at MAC.COM Thu Jun 15 11:42:43 2006 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Thu, 15 Jun 2006 11:42:43 +0200 Subject: source positions - brain regions Message-ID: dear help-list, sorry for what appears to be a very basic question. i'm just starting to explore the source analysis possibilities that fieldtrip offers. for this i downloaded a EEG tutorial dataset from eeglab, did eeglab2fieldtrip, and the timelockanalysis. now i wanted to estimate the source waveforms of the erp. %this is my input: vol = []; vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 cm vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; tmp=data.elec; tmp.pnt=tmp.pnt*12; cfg=[]; cfg.method='lcmv'; cfg.vol=vol; cfg.elec=tmp; cfg.resolution=1; datamn=sourceanalysis(cfg,dataav); %this is the output datamn = xgrid: [-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10] ygrid: [-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10] zgrid: [-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10] dim: [21 21 19] vol: [1x1 struct] time: [1x256 double] pos: [8379x3 double] inside: [1x4811 double] outside: [1x3568 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] there were no error or warning messages, so from the basic structure things seem to be ok. the time courses of my source activity appears to be saved in datamn.avg.mom. >> size(datamn.avg.mom{datamn.inside(1)}) ans = 3 256 however now i'm a little bit stuck. from here, what is the best method of finding out which dipoles correspond (very roughly) to which brain regions, so i can extract specifically those to look at the sourcewaveforms? unfortunatley no mri. I am aware of the sourceplot function, but was uncapable of producing a meaningful output. thanks in advance for any hints & best wishes, nathan -------------------------------- Dr. Nathan Weisz Dept. of Psychology University of Konstanz P.O. Box D25 78457 Konstanz, Germany Tel: ++49-7531-884612 Email & Chat-AV: nathanweisz at mac.com Homepage: http://homepage.mac.com/nathanweisz/start/research.html From muthuraman10 at HOTMAIL.COM Thu Jun 15 15:59:54 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Thu, 15 Jun 2006 13:59:54 +0000 Subject: query on coherence analysis In-Reply-To: <002201c6895d$07c0d680$642dae83@fcdonders.nl> Message-ID: Hello Thankyou for the previous help it works now i am able to proceed further to calculate the coherence The problem now the coherence obtained using the mtmwelch when i plot the coherence figures for the channels all the coherence figures for the different channel looks the same is there is a bug in how i am calculating the coherence These are the steps i carried out in calculating the coherence headerfile='pd_mof_tr0_c_0306.cnt'; hdr = read_fcdc_header(headerfile); cfg.trl = []; for i=1:floor(hdr.nSamples/hdr.Fs) cfg.trl(i,1) = (i-1)*hdr.Fs + 1; cfg.trl(i,2) = (i )*hdr.Fs; cfg.trl(i,3) = 0; end cfg.headerfile=headerfile; >>cfg.datafile=headerfile; >>[data] = preprocessing(cfg); -and after the data is preprocessed i change the channel labels from actual cz to eeg26 and so on cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); -when i calculate using freqanalysis i get these warnings 1.000 Hz : WARNING - using only one taper for specified smoothing Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 360 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 and so on till 30.000 hz -and while processing processing trial 2: 1000 samples Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 398 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='freq'; cfg.yparam='cohspctrm'; cfg.xlim=[3 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG27'; singleplotER(cfg,fd); -when i try to plot i get this error ??? Error using ==> char Cell elements must be character arrays. Error in ==> singleplotER at 326 t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; please , look at it and help me in this regard thanking you with regards muthuraman >From: Ingrid Nieuwenhuis >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis >Date: Tue, 6 Jun 2006 13:33:28 +0200 > >Dear Muthuraman, > >cfg.xparam should not be 'foi', but 'freq' (see help singleplotER) > >Bests, >Ingrid > > >-----Original Message----- >From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf >Of Muthuraman Muthuraman >Sent: Tuesday, June 06, 2006 11:20 AM >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis > >Hello > >Thanks for the comments, i have downloaded the latest version >and now i am able to calculate using mtmwelch > >but i get a error when i am plotting >i will included the matlab commands > > >>cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'EEG' 'EMG2'},data.label); >cfg.channelcmb={'EEG' 'EMG2'}; >freq=freqanalysis(cfg,data); > > >>fd=freqdescriptives([],freq); > >cfg=[]; >cfg.xparam='foi'; >cfg.yparam='cohspctrm'; >cfg.xlim=[0 30]; >cfg.cohrefchannel='EMG2'; >cfg.box='yes'; >cfg.showlabels='yes'; >cfg.channelname='EEG26'; >singleplotER(cfg,fd); > >??? Reference to non-existent field 'foi'. > >Error in ==> singleplotER at 272 > plot(varargin{k-1}.(cfg.xparam), P, style); > >with regards >muthu > > > >From: Robert Oostenveld > >Reply-To: FieldTrip discussion list > >To: FIELDTRIP at NIC.SURFNET.NL > >Subject: Re: [FIELDTRIP] query on coherence source analysis > >Date: Thu, 1 Jun 2006 13:58:48 +0200 > > > >Dear Muthuraman > > > >I have not been able to reproduce your error. I suggest that you get the > >latest version of FieldTrip from our FTP server and try again. > > > >best egards, > >Robert > > > >PS this is the test script I used. It uses some simulated data, which > >again uses a MEG gradiometer definition and a head model from the >tutorial > > >data. > > > > > >----------------- > >% read some data that is required to simulate MEG data, i.e. volume >model, > >% sensor positions and MRI (optional, only for plotting) > >vol = read_ctf_hdm('Subject01.hdm'); > >hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); > >grad = hdr.grad; > > > >% construct the simulated MEG data for condition A ("active") > >cfg = []; > >cfg.vol = vol; > >cfg.grad = grad; > >cfg.fsample = 300; > >cfg.ntrials = 2; > >cfg.triallength = 1; > >cfg.dip.pos = [0 7 8]; > >cfg.dip.mom = [1 0 0]; > >cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); > >cfg.absnoise = 1e-8; > >data = dipolesimulation(cfg); > > > >% add the source signal as fake EMG channel > >for i=1:cfg.ntrials > > data.trial{i}(end+1,:) = cfg.dip.signal + randn(size >(cfg.dip.signal)); > >end > >data.label{end+1} = 'EMG'; > > > >cfg=[]; > >cfg.output='powandcsd'; > >cfg.method='mtmwelch'; > >cfg.foi=1:2:30; > >numfoi = length(cfg.foi); > >cfg.taper='hanning'; > >cfg.t_ftimwin=zeros(1,numfoi); > >cfg.t_ftimwin(:)=0.5; > >cfg.channel=channelselection({'MEG' 'EMG'},data.label); > >cfg.channelcmb={'MEG' 'EMG'}; > >freq=freqanalysis(cfg,data); > > > > > > From linpe at NINDS.NIH.GOV Thu Jun 15 22:08:19 2006 From: linpe at NINDS.NIH.GOV (Lin, Peter (NIH/NINDS) [E]) Date: Thu, 15 Jun 2006 16:08:19 -0400 Subject: No subject Message-ID: I am trying to import neuroscan data into fieldtrip for analysis. I tried using eeglab to load my epoch's neuroscan file and then used the eeglab2fieldtrip command on the EEG structure to generate a new data file. My question is how to process the data further using the frequencyanalysis method. >>[data]=eeglab2fieldtrip(EEG,'preprocessing') data = label: {1x64 cell} fsample: 1000 elec: [1x1 struct] trial: {1x224 cell} time: {1x224 cell} cfg: [1x1 struct] I'm wondering if my created data file is not correct. Any help on how to proceed would be great. Thanks, Peter Peter Lin, MD Clinical Fellow, Human Motor Control Section Phone: 301-402-0703 email: linpe at ninds.nih.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Fri Jun 16 09:05:50 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 16 Jun 2006 09:05:50 +0200 Subject: No subject In-Reply-To: Message-ID: Dear Peter, As far as I can see, the data looks OK. At least it contains the fields subsequent analysis steps need to know. However, I cannot judge the content of these fields, but there's no reason to assume that's not fine. To proceed, I would first advice you to have a look at the fieldtrip website. If you follow the link documentation, and then tutorial-documentation, there's already some stuff regarding frequency analysis. Moreover, the website also contains the documentation of all fieldtrip functions, which you can also access from the matlab command line, by typing help functionname. For example, try help freqanalysis, or help freqanalysis_mtmconvol. There's already quite some information in there, as well as all the options you can play with. Good luck Jan-mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Lin, Peter (NIH/NINDS) [E] Sent: Thursday, June 15, 2006 10:08 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] I am trying to import neuroscan data into fieldtrip for analysis. I tried using eeglab to load my epoch's neuroscan file and then used the eeglab2fieldtrip command on the EEG structure to generate a new data file. My question is how to process the data further using the frequencyanalysis method. >>[data]=eeglab2fieldtrip(EEG,'preprocessing') data = label: {1x64 cell} fsample: 1000 elec: [1x1 struct] trial: {1x224 cell} time: {1x224 cell} cfg: [1x1 struct] I'm wondering if my created data file is not correct. Any help on how to proceed would be great. Thanks, Peter Peter Lin, MD Clinical Fellow, Human Motor Control Section Phone: 301-402-0703 email: linpe at ninds.nih.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Fri Jun 16 09:15:15 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 16 Jun 2006 09:15:15 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: Dear Muthuraman, At first glance I don't have a clue what's going on. Did you have a look into fd.powspctrm, and fd.cohspctrm? Does it contain normal numbers, zeros, or nan? It might be a bug in freqanalysis_mtmwelch. Did you try out other methods, to be specified in cfg.method? If yes, did this also give strange results? If no, could you try out cfg.method = 'mtmconvol' instead of 'mtmwelch'? Please have a look at the documentation which additional options you have to specify. What matlab-version do you use? Do you use the latest fieldtrip-version? One additional thing: please note that you specified the odd frequencies 1:2:29, whereas your time-window is half a second wide. These are not optimal settings, since the frequency-resolution of your time-window is 2 Hz. This means that your time-window never contains an integer amount of cycles of the frequency you want to estimate. This might lead to strange results, though I don't think it has anything to do with your present problem. However, I would use cfg.freq = 2:2:30 in combination with a time-window of 0.5 s Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Thursday, June 15, 2006 4:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] query on coherence analysis Hello Thankyou for the previous help it works now i am able to proceed further to calculate the coherence The problem now the coherence obtained using the mtmwelch when i plot the coherence figures for the channels all the coherence figures for the different channel looks the same is there is a bug in how i am calculating the coherence These are the steps i carried out in calculating the coherence headerfile='pd_mof_tr0_c_0306.cnt'; hdr = read_fcdc_header(headerfile); cfg.trl = []; for i=1:floor(hdr.nSamples/hdr.Fs) cfg.trl(i,1) = (i-1)*hdr.Fs + 1; cfg.trl(i,2) = (i )*hdr.Fs; cfg.trl(i,3) = 0; end cfg.headerfile=headerfile; >>cfg.datafile=headerfile; >>[data] = preprocessing(cfg); -and after the data is preprocessed i change the channel labels from actual cz to eeg26 and so on cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); -when i calculate using freqanalysis i get these warnings 1.000 Hz : WARNING - using only one taper for specified smoothing Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 360 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 and so on till 30.000 hz -and while processing processing trial 2: 1000 samples Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 398 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='freq'; cfg.yparam='cohspctrm'; cfg.xlim=[3 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG27'; singleplotER(cfg,fd); -when i try to plot i get this error ??? Error using ==> char Cell elements must be character arrays. Error in ==> singleplotER at 326 t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; please , look at it and help me in this regard thanking you with regards muthuraman From r.oostenveld at FCDONDERS.RU.NL Fri Jun 16 10:39:48 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 16 Jun 2006 10:39:48 +0200 Subject: source positions - brain regions In-Reply-To: <5E221385-C805-4FFA-BE76-F2C0DF9BEE72@mac.com> Message-ID: hi Nathan On 15 Jun 2006, at 11:42, Nathan Weisz wrote: > however now i'm a little bit stuck. from here, what is the best > method of finding out which dipoles correspond (very roughly) to > which brain regions, so i can extract specifically those to look at > the sourcewaveforms? unfortunatley no mri. > I am aware of the sourceplot function, but was uncapable of > producing a meaningful output. So far it seems ok. The headmodel is in cm, the electrodes as well (I presume, otherwise it would have given warnings and/or errors), so the source locations are also expressed in cm, since they are expresed in the same coordinate system. I suggest that you have a look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_are_the_differ ent_head_and_mri_coordinate_systems_defined to get a better understanding in general. What we normally do in such a case is to use an indivudual headmodel, and what we thus subsequently would do is to take an anatomical MRI of the same subject, in which the MRI is aligned to the same head/ model coordinate system (using the ears and nose fiducials). Since you do not have a MRI, you could take a standard MRI (i.e. the MNI template in single_subj_T1 from SPM). Some time ago I (or Arno) posted a homogenous transformation matrix "besa2spm" on the eeglab mailing list (*). That homogenous transformation matrix transforms from besa coordinates for a spherical model to MNI coordinates. besa2spm = [ 0.0101 -0.9400 0 0.5588 1.1889 0.0080 0.0530 -18.0041 -0.0005 -0.0000 1.1268 1.8045 0 0 0 1.0000 ]; spm2besa = inv(besa2spm); The transformation matrix is for the "besa" spherical model in EEGLAB, which has different sphere radii (85mm outer sphere) than you have used. So you should add a scaling from the besa radii to yours. your2besa = eye(4); your2besa(1,1) = 8.5/12; your2besa(2,2) = 8.5/12; your2besa(3,3) = 8.5/12; then your2spm = besa2spm * your2besa spm2your = inv(your2spm); It is most convenient to apply the inverse transformation to the MRI corodinate system. I.e. do mri = read_fcdc_mri('single_subj_T1.mnc') then mri.transform describes the voxels in SPM/MNI coordinates, so mri.transform = spm2your * mri.transform; changes the anatomical MRI into your headmodel coordinates. Subsequently you can interpolate the functional values onto the anaomtical voxel locations with SOURCEINTERPOLATE, and plot the functional values overlaid over the anatomical with SOURCEPLLOT or SLICEINTERP. best regards, Robert PS (*) the besa2spm coordinate transformation matrix was constructed using ELECTORDENORMAMALIZE, which warps electrodes. In this case the spherical 1020 electrodes were warped to the corresponding electrodes in the MNI template. The homogenous transformation matrix describes the warp/deformation and can be used as well for the dipoles inside the head. From jurij.dreo at GUEST.ARNES.SI Sat Jun 17 12:18:26 2006 From: jurij.dreo at GUEST.ARNES.SI (Jurij Dreo) Date: Sat, 17 Jun 2006 11:18:26 +0100 Subject: Statistics for coherence in a within-subject experiment Message-ID: Hello, I am using BESA to perform coherence and source coherence calculations for a multiple-subject/multiple-condition experiment. In the experiment I have 11 subjects, 6 conditions and around 30 sets per condition per subject. In BESA the data was preprocessed and the coherence values in the Time-Frequency domain were calculated for each person. As BESA has no capabilities to calculate statistics in a multiple- subject study, their support personnel directed me towards FieldTrip. I´ve been looking over the documentation and tutorials on your web page and also downloaded the scrip and ran it in matlab. The tutorial on Cluster-Lever randomization Tests for the Time- Frequency domain is quite straight-forward. I am however not quite sure which statistic to use for the cfg.statistic variable to analyze coherence in a within-subject study such as the one I have. The documentation on the cfg.statistic variable says it can have these values: 1. indepsamplesT' (independent samples T-statistic) 2. 'indepsamplesregrT' (independent samples regression coefficient T- statistic) 3. 'indepsamplesZcoh' (independent samples Z-statistic for coherence) 4. 'indepsamplesTsqcrs' (independent samples T-square-statistic for the cross-spectrum) 5. 'depsamplesT' (dependent samples T-statistic) 6. 'actvsblT' (activation versus baseline T-statistic) 7. 'depsamplesregrT' (dependent samples regression coefficient T- statistic) 8. 'indepsamplesF' (independent samples F-statistic) 9. 'depsamplesF' (dependent samples F-statistic) I am not sure if any of these options are compatible with a within- subject multiple condition coherence statistical analysis. option 3. - indepsamplesZcoh is obviously only suitable for a between- trial, two-condition experiment and there are no other options that explicitally say they are used for coherence. So how can one compare 6 conditions for 11 subjects with regards to coherence if one imports the Time-Frequency domain data for each person into FieldTrip? Thank you for your help! Regards, Jurij Dreo From r.oostenveld at FCDONDERS.RU.NL Mon Jun 19 16:18:55 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Jun 2006 16:18:55 +0200 Subject: Statistics for coherence in a within-subject experiment In-Reply-To: <20060617_091826_063328.jurij.dreo@guest.arnes.si> Message-ID: Hi Jurij > option 3. - indepsamplesZcoh is obviously only suitable for a between- > trial, two-condition experiment Yes, that is for testing coherence differences between two conditions within one subject. > and there are no other options that explicitally say they are used > for coherence. > > So how can one compare 6 conditions for 11 subjects with regards to > coherence if one imports the Time-Frequency domain data for each > person into FieldTrip? In your case you have observed a "value" in 11 subjects, over 6 conditions. That value happens to be coherence, but could as well have been something else. Since you have manipulated the conditions with each subject, you can use a dependent-samples test: the observed values depend on the subject (an example of a dependent-samples test is a paired-t test). If the number of trials varies between subjects and/or sessions, it will be preferable to transform your coherence values to z-scores manually prior to submitting the values to clusterrandanalysis. Now about the 6 conditions, am I right that you have a 1x6 factorial design, or is there more strucure in the design? Do you have a specific hypothesis about the different conditions? If you only want to reject the null-hypothesis "the observed value (coherence) is the same (more accurately: stems from the same distribution) in all my 6 conditions", you would use an omnibus F-statistic, i.e. 'depsamplesF'. It might be that your hypothesis is more specific, or also in case you find an omnibus effect, then you would probably want to perform explicit tests between two subsets of your 6 conditions using a 'depsamplesT' test. best regards, Robert From jurij.dreo at GUEST.ARNES.SI Mon Jun 19 17:31:46 2006 From: jurij.dreo at GUEST.ARNES.SI (Jurij Dreo) Date: Mon, 19 Jun 2006 17:31:46 +0200 Subject: Statistics for coherence in a within-subject experiment Message-ID: Hello! Thank you for your answers. Here are my replies to them: To avoid any misunderstandings here is again a summary of my study design - I have 11 subjects. - Each of them performed 6 tasks related to working memory. - Each subject performed anywehere from 25 to 60 repeats (trial) of each condition (the standard number of trials per task was 30 - but some subjects performed the entire experiment twice (ergo 60 potential trials) .... and in some some of their trials are unusable - artifacts ... ergo 25 min number of possible trials) Given my study design I thought something like a one-way ANOVA for correlated samples would be in order. (as I am comparing 6 conditions within-subjects as every subject performed all sets) ----------------- > In your case you have observed a "value" in 11 subjects, over 6 > conditions. That value happens to be coherence, but could as well > have been something else. Since you have manipulated the conditions > with each subject, you can use a dependent-samples test: the observed > values depend on the subject (an example of a dependent-samples test > is a paired-t test). ------------------- I´m not sure what you are saying here.... I agree with the dependent samples idea... but I cannot preform a t-test ... ie. more of them as that would inflate my p-rate overall. I thought that I would first do an ANOVA and then something like the Tukey HSD Test to cimpare individual conditions -------------------- > If the number of trials varies between subjects and/or sessions, it > will be preferable to transform your coherence values to z-scores > manually prior to submitting the values to clusterrandanalysis. -------------------- Yes I agree that would need to be done manually. ----------- > Now about the 6 conditions, am I right that you have a 1x6 factorial > design, or is there more strucure in the design? Do you have a > specific hypothesis about the different conditions? If you only want > to reject the null-hypothesis "the observed value (coherence) is the > same (more accurately: stems from the same distribution) in all my 6 > conditions", you would use an omnibus F-statistic, i.e. > 'depsamplesF'. It might be that your hypothesis is more specific, or > also in case you find an omnibus effect, then you would probably want > to perform explicit tests between two subsets of your 6 conditions > using a 'depsamplesT' test. > ---------- I want to contrast all conditions at once (f -test anova) AND also each combination of conditions (say a post- ANOVA Q-test) But Im still not sure which statistic to use and even if the one I use will be able to deal with the fact that I have a different number of conditions per condition per subject As far as I understand it... we must use some kind of ANOVA here... A simple "paired" t-test will not do... as we are comparing more than 2 conditions at once and I do not want to inflate my p-rate. Thank you for your help! Regards, Jurij Dreo -------------- next part -------------- An HTML attachment was scrubbed... URL: From muthuraman10 at HOTMAIL.COM Tue Jun 20 10:40:17 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Tue, 20 Jun 2006 08:40:17 +0000 Subject: query on coherence analysis Message-ID: Hello Jan The answers for the questions you have asked and also i have attached some figures with this mail 1-using welch periodogram method 2-using fieldtrip 'mtmfft' 3-using fieldtrip 'mtmwelch' Did you have a look into fd.powspctrm, and fd.cohspctrm? -yes,both look the same so something is surely going wrong Does it contain normal numbers, zeros, or nan? -yes, it has normal numbers but the vlaues are from 1.0 to 10.0 not as normal in the case of 0.1 to 1 in coherence spectrum Did you try out other methods, to be specified in cfg.method? -yes using 'mtmfft' i have attached the figure in the mail in which i dont get the correct frequency content and the values are less -In the 'mtmwelch' method i get a error when i am plotting, even then i am able to see the figure ??? Error using ==> char Cell elements must be character arrays. Error in ==> singleplotER at 326 t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; -In the 'mtmconvol' i am not able to plot i get a error selected 60 channels for coherence ??? Error using ==> plot Vectors must be the same lengths. Error in ==> singleplotER at 272 plot(varargin{k-1}.(cfg.xparam), P, style); please go through it and give your comments and one more question for the source analysis what are the values we need,when i open the elec1010 there are four values x,y,z values and what is the fourth value with regards muthu >From: Jan Mathijs Schoffelen >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis >Date: Fri, 16 Jun 2006 09:15:15 +0200 > >Dear Muthuraman, > >At first glance I don't have a clue what's going on. >Did you have a look into fd.powspctrm, and fd.cohspctrm? >Does it contain normal numbers, zeros, or nan? >It might be a bug in freqanalysis_mtmwelch. >Did you try out other methods, to be specified in cfg.method? >If yes, did this also give strange results? If no, could you try out >cfg.method = 'mtmconvol' instead of 'mtmwelch'? Please have a look at the >documentation which additional options you have to specify. >What matlab-version do you use? Do you use the latest fieldtrip-version? > >One additional thing: please note that you specified the odd frequencies >1:2:29, whereas your time-window is half a second wide. These are not >optimal settings, since the frequency-resolution of your time-window is 2 >Hz. This means that your time-window never contains an integer amount of >cycles of the frequency you want to estimate. This might lead to strange >results, though I don't think it has anything to do with your present >problem. However, I would use cfg.freq = 2:2:30 in combination with a >time-window of 0.5 s > >Yours, > >Jan-Mathijs > >-----Original Message----- >From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf >Of Muthuraman Muthuraman >Sent: Thursday, June 15, 2006 4:00 PM >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis > >Hello > >Thankyou for the previous help it works now >i am able to proceed further to calculate the coherence > >The problem now the coherence obtained using the mtmwelch >when i plot the coherence figures for the channels >all the coherence figures for the different channel looks the same >is there is a bug in how i am calculating the coherence > >These are the steps i carried out in calculating the coherence > >headerfile='pd_mof_tr0_c_0306.cnt'; >hdr = read_fcdc_header(headerfile); >cfg.trl = []; >for i=1:floor(hdr.nSamples/hdr.Fs) > cfg.trl(i,1) = (i-1)*hdr.Fs + 1; > cfg.trl(i,2) = (i )*hdr.Fs; > cfg.trl(i,3) = 0; >end > >cfg.headerfile=headerfile; > >>cfg.datafile=headerfile; > >>[data] = preprocessing(cfg); > >-and after the data is preprocessed i change the channel labels from actual >cz to eeg26 and so on > > > >cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'EEG' 'EMG2'},data.label); >cfg.channelcmb={'EEG' 'EMG2'}; >freq=freqanalysis(cfg,data); > > >-when i calculate using freqanalysis i get these warnings > >1.000 Hz : WARNING - using only one taper for specified smoothing >Warning: Size vector should be a row vector with integer elements. > >In freqanalysis_mtmconvol at 360 > In freqanalysis at 182 > In freqanalysis_mtmwelch at 67 > In freqanalysis at 182 >and so on till 30.000 hz > >-and while processing > >processing trial 2: 1000 samples >Warning: Size vector should be a row vector with integer elements. > >In freqanalysis_mtmconvol at 398 > In freqanalysis at 182 > In freqanalysis_mtmwelch at 67 > In freqanalysis at 182 > > > >fd=freqdescriptives([],freq); > > >cfg=[]; >cfg.xparam='freq'; >cfg.yparam='cohspctrm'; >cfg.xlim=[3 30]; >cfg.cohrefchannel='EMG2'; >cfg.box='yes'; >cfg.showlabels='yes'; > >cfg.channelname='EEG27'; >singleplotER(cfg,fd); >-when i try to plot i get this error >??? Error using ==> char >Cell elements must be character arrays. > >Error in ==> singleplotER at 326 > t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; > > >please , look at it and help me in this regard > >thanking you >with regards >muthuraman -------------- next part -------------- A non-text attachment was scrubbed... Name: Welch Periodogram Method.fig Type: application/octet-stream Size: 20550 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Fieldtrip-'mtmfft'.fig Type: application/octet-stream Size: 21189 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Fieltrip-'mtmwelch'.fig Type: application/octet-stream Size: 3635 bytes Desc: not available URL: From Jan.Schoffelen at FCDONDERS.RU.NL Wed Jun 21 11:31:07 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Wed, 21 Jun 2006 11:31:07 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: >the other question i have asked in the previous mail >i would like to do the source analysis >and the values specified in for ex:elec1010 >it has four values and the channel label >the first three values are x,y,z position values >what is the fourth value? Dear Muthuraman, Please have a look at the FAQ-section of the fieldtrip-website. It is explained what is specified in the layout-files. Yours, Jan-M From Jan.Schoffelen at FCDONDERS.RU.NL Wed Jun 21 12:32:15 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Wed, 21 Jun 2006 12:32:15 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: Dear Muthuraman, Please find attached a script and a figure. I compared the 'mtmfft' with 'mtmwelch', and the results look very similar. I did not test the 'mtmconvol' method, since this function is called when you specify 'mtmwelch'. I guess you have to check your configuration in that respect. I would say that the code is doing what it should do. Please make sure that you use the latest fieldtrip-version. Yours, Jan-Mathijs -----Original Message----- From: Muthuraman Muthuraman [mailto:muthuraman10 at hotmail.com] Sent: Wednesday, June 21, 2006 11:05 AM To: Jan.Schoffelen at fcdonders.ru.nl Subject: RE: [FIELDTRIP] query on coherence analysis Hello Jan Thanks for the suggestions I have tried 'mtmconvol' and also plotting using singleplotTFR the figure looks totally blue i have attached the figure with this mail for the same channel combination Figure-mtmconvol and also i have uploaded two files one is the CNT file of a patient and the other file is data structure after preprocessing and changing the channel label If u have any different results from the data please let me know my aim is to do the coherence analysis followed by the source analysis using 'DICS' the other question i have asked in the previous mail i would like to do the source analysis and the values specified in for ex:elec1010 it has four values and the channel label the first three values are x,y,z position values what is the fourth value? thanking you with regards muthu -------------- next part -------------- A non-text attachment was scrubbed... Name: muthu.fig Type: application/octet-stream Size: 1881 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: muthu.m Type: application/octet-stream Size: 1772 bytes Desc: not available URL: From srampp at TISCALI.DE Wed Jun 21 23:07:50 2006 From: srampp at TISCALI.DE (Stefan Rampp) Date: Wed, 21 Jun 2006 23:07:50 +0200 Subject: Missing minimumnormestimate etc Message-ID: Hi everyone, I was just trying to do source localization of epilepsy MEG data using mne, however, it appears that some functions are missing: minimumnormestimate, music, loreta and rv are used in sourceanalysis.m, but I can't find the implementations (and neither can matlab). Do I need to download additional libraries/toolboxes? Thank you, Stefan Rampp. Epilepsycenter Erlangen Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.montez at VUMC.NL Thu Jun 22 01:27:29 2006 From: t.montez at VUMC.NL (Montez, T.) Date: Thu, 22 Jun 2006 01:27:29 +0200 Subject: channel location file to import planar to EEGLAB Message-ID: Dear Fieldtripers, I am using EEGLAB to compute ICA of CTF 151 channels data. I used to read the data in EEGLAB directly from the CTF format, but some components are affected by the bad channels. Since removing the bad channels will reduce the number of components and will give problems later at the planar transformation; I tried using megrepair first and then importing the matlab array of data.trial{1}. I use the channel locations of a previous dataset opened from the CTF format. - I still get some components reflecting the bad channels, should I increase the cfg.neighbourdist? (I was using the default of 4 cm). - To import the data after the planar transformation I need a channel location file for the dH and dV pairs, can you help me with that? Thanks in advance, Teresa Montez -------------- next part -------------- An HTML attachment was scrubbed... URL: From srampp at TISCALI.DE Thu Jun 22 01:51:25 2006 From: srampp at TISCALI.DE (Stefan Rampp) Date: Thu, 22 Jun 2006 01:51:25 +0200 Subject: channel location file to import planar to EEGLAB Message-ID: channel location file to import planar to EEGLABDear Teresa, I can't really provide much info regarding your first question, however, I might be able to help you with the second: Have you applied 'combineplanar' after the planar transformation? This will combine the dH and dV pairs into one channel per pair, e.g. cfg = []; combplan = combineplanar(cfg, plan); were plan is the planar transformed data set. combineplanar allows to choose the method for combination of the pairs. For further details, you might want to have a look at the tutorial about event related averaging: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:eventrelatedaveraging Sincerely, Stefan Rampp Epilepsycenter Erlangen Germany. ----- Original Message ----- From: Montez, T. To: FIELDTRIP at NIC.SURFNET.NL Sent: Thursday, June 22, 2006 1:27 AM Subject: [FIELDTRIP] channel location file to import planar to EEGLAB Dear Fieldtripers, I am using EEGLAB to compute ICA of CTF 151 channels data. I used to read the data in EEGLAB directly from the CTF format, but some components are affected by the bad channels. Since removing the bad channels will reduce the number of components and will give problems later at the planar transformation; I tried using megrepair first and then importing the matlab array of data.trial{1}. I use the channel locations of a previous dataset opened from the CTF format. - I still get some components reflecting the bad channels, should I increase the cfg.neighbourdist? (I was using the default of 4 cm). - To import the data after the planar transformation I need a channel location file for the dH and dV pairs, can you help me with that? Thanks in advance, Teresa Montez -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Jun 22 09:25:56 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Jun 2006 09:25:56 +0200 Subject: Statistics for coherence in a within-subject experiment In-Reply-To: <000901c693b5$79d47c10$0200a8c0@laptop> Message-ID: Hi Jurij The parametric tests that you suggest are not implemented in FieldTrip. In the clusterrandanalysis function we use a randomization approach for statistical testing. It is a non-parametrical approach, and the test statistic consists of a parametrtical statistic per time- frequency-channel, which is clustered and summed over neighbouring timepoints/frequencies/channels. Not the single-sample statistic, but the clustersum is used for the statistical test, thereby increasing sensitivity and controlling for multiple comparisons. The single sample (time-frequency-channel) statistic has to be chosen to match with the experimental design (e.g. F or F) and the randomization/ permutation of the data between the subjects and conditions has to be adequate (in your case you want to shuffle data between conditions but only within each subject). That determines the statistic to use. I suggest that you go over the clusterrandanalysis tutorial at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:clusterrandanalysis best regards, Robert On 19 Jun 2006, at 17:31, Jurij Dreo wrote: > Hello! > > Thank you for your answers. Here are my replies to them: > > To avoid any misunderstandings here is again a summary of my study > design > - I have 11 subjects. > - Each of them performed 6 tasks related to working memory. > - Each subject performed anywehere from 25 to 60 repeats (trial) of > each condition (the standard number of trials per task was 30 - but > some subjects performed the entire experiment twice (ergo 60 > potential trials) .... and in some some of their trials are > unusable - artifacts ... ergo 25 min number of possible trials) > > Given my study design I thought something like a one-way ANOVA for > correlated samples would be in order. > (as I am comparing 6 conditions within-subjects as every subject > performed all sets) > > > ----------------- > > In your case you have observed a "value" in 11 subjects, over 6 > > conditions. That value happens to be coherence, but could as well > > have been something else. Since you have manipulated the conditions > > with each subject, you can use a dependent-samples test: the > observed > > values depend on the subject (an example of a dependent-samples test > > is a paired-t test). > ------------------- > > I´m not sure what you are saying here.... I agree with the > dependent samples idea... but I cannot preform a t-test ... ie. > more of them as that would inflate my p-rate overall. > > I thought that I would first do an ANOVA and then something like > the Tukey HSD Test to cimpare individual conditions > > -------------------- > > If the number of trials varies between subjects and/or sessions, it > > will be preferable to transform your coherence values to z-scores > > manually prior to submitting the values to clusterrandanalysis. > -------------------- > Yes I agree that would need to be done manually. > > ----------- > > Now about the 6 conditions, am I right that you have a 1x6 factorial > > design, or is there more strucure in the design? Do you have a > > specific hypothesis about the different conditions? If you only want > > to reject the null-hypothesis "the observed value (coherence) is the > > same (more accurately: stems from the same distribution) in all my 6 > > conditions", you would use an omnibus F-statistic, i.e. > > 'depsamplesF'. It might be that your hypothesis is more specific, or > > also in case you find an omnibus effect, then you would probably > want > > to perform explicit tests between two subsets of your 6 conditions > > using a 'depsamplesT' test. > > > ---------- > > I want to contrast all conditions at once (f -test anova) AND also > each combination of conditions (say a post- ANOVA Q-test) > > But Im still not sure which statistic to use and even if the one I > use will be able to deal with the fact that I have a different > number of conditions per condition per subject > > As far as I understand it... we must use some kind of ANOVA here... > A simple "paired" t-test will not do... as we are comparing more > than 2 conditions at once and I do not want to inflate my p-rate. > > Thank you for your help! > > Regards, > Jurij Dreo > From r.oostenveld at FCDONDERS.RU.NL Thu Jun 22 09:31:10 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Jun 2006 09:31:10 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <006c01c69576$c1d13270$14b2a8c0@mirandola> Message-ID: Dear Stefan, The SOURCEANALYSIS function is used as wrapper for various distributed or scanning inverse approaches, and DIPOLEFITTING is used for underdetermined model fitting to the data. The only underlying functions for SOURCEANALYSIS that are released on the ftp server are the lcmv and the dics beamformer methods. The functions that you refer to are implemented in our in-house version of FieldTrip but have not been tested thouroughly. I can give you a pre-release if you are willing to aid in the testing of those functions. best regards, Robert On 21 Jun 2006, at 23:07, Stefan Rampp wrote: > Hi everyone, > > I was just trying to do source localization of epilepsy MEG data > using mne, however, it appears that some functions are missing: > minimumnormestimate, music, loreta and rv are used in > sourceanalysis.m, but I can't find the implementations (and neither > can matlab). Do I need to download additional libraries/toolboxes? > > Thank you, > Stefan Rampp. > Epilepsycenter Erlangen > Germany > From r.oostenveld at FCDONDERS.RU.NL Thu Jun 22 09:40:31 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Jun 2006 09:40:31 +0200 Subject: channel location file to import planar to EEGLAB In-Reply-To: <28FF6B8D22C94B44A55E4E1325A94AF2348059@vumc-mb02.vumc.nl> Message-ID: Hi Theresa On 22 Jun 2006, at 1:27, Montez, T. wrote: > I am using EEGLAB to compute ICA of CTF 151 channels data. > > I used to read the data in EEGLAB directly from the CTF format, > but some components are affected by the bad channels. The bad channels do not reflect a linear mixture of underlying sources, therefore you should remove them prior to ICA. You should also remove all trials containing anomalous artifacts. > Since removing the bad channels will reduce the number of components > and will give problems later at the planar transformation; > I tried using megrepair first and then importing the matlab array > of data.trial{1}. I use the channel locations of a previous > dataset opened from the CTF format. MEGREPAIR uses a nearest-neighbour approach for fixing the missing channels. The "repaired" channels are linear combinations (i.e. a linear mixture) of the neighbours and hence do not add any information (i.e. components) to the data, doing ICA on the repaired dataset does not give you all 151 components. > - I still get some components reflecting the bad channels, > should I increase the cfg.neighbourdist? > (I was using the default of 4 cm). > > - To import the data after the planar transformation I need > a channel location file for the dH and dV pairs, > can you help me with that? The planar transformation in MEGPLANAR also results in a linear estimation of the horizontal and vertical gradients, i.e. if you start with 151 axial channels and you do MEGPLANAR, you will have 302 planar channels, but the dimensionality of that data will still be 151. That means that ICA on the 302-channel planar data will result in a maximum of 151 components. I suggest to do the ICA on the axial data with the bad channels removed. Subsequently you can switch from EEGLAB to FieldTrip and compute the planar representation of the ICA components using the MEGPLANAR function (I am not sure whether megplanar knows how to deal with ICA data, but it is easy to convert the ICA data into something that resembles an average ERF or alternatively to add support for the ICA data in megplanar). best regards, Robert From srampp at TISCALI.DE Thu Jun 22 10:43:01 2006 From: srampp at TISCALI.DE (Stefan Rampp) Date: Thu, 22 Jun 2006 10:43:01 +0200 Subject: Missing minimumnormestimate etc Message-ID: Dear Robert, Thank you for the fast answer. Since I'm interested in comparing various methods, I'd greatly appreciate a pre-release version. And of course I could contribute to Fieldtrip as a betatester for these functions like that. Sincerely, Stefan Rampp Epilepsycenter Erlangen Germany ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Thursday, June 22, 2006 9:31 AM Subject: Re: [FIELDTRIP] Missing minimumnormestimate etc > Dear Stefan, > > The SOURCEANALYSIS function is used as wrapper for various distributed or > scanning inverse approaches, and DIPOLEFITTING is used for > underdetermined model fitting to the data. The only underlying functions > for SOURCEANALYSIS that are released on the ftp server are the lcmv and > the dics beamformer methods. The functions that you refer to are > implemented in our in-house version of FieldTrip but have not been tested > thouroughly. I can give you a pre-release if you are willing to aid in > the testing of those functions. > > best regards, > Robert > > > On 21 Jun 2006, at 23:07, Stefan Rampp wrote: > >> Hi everyone, >> >> I was just trying to do source localization of epilepsy MEG data using >> mne, however, it appears that some functions are missing: >> minimumnormestimate, music, loreta and rv are used in sourceanalysis.m, >> but I can't find the implementations (and neither can matlab). Do I need >> to download additional libraries/toolboxes? >> >> Thank you, >> Stefan Rampp. >> Epilepsycenter Erlangen >> Germany >> From MZvyagintsev at UKAACHEN.DE Thu Jun 22 18:08:43 2006 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Thu, 22 Jun 2006 18:08:43 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <21EE19CF-BE60-4719-BC9E-C1F3737F26B5@fcdonders.ru.nl> Message-ID: Dear Robert, Would be also nice to have an implementaion of LORETA approach for source analysis from your in-house software. I would appreciate if you could send it to me as well. Best regards, Mikhail Zvyagintsev MZvyagintsev at UKAachen.de Robert Oostenveld wrote: > Dear Stefan, > > The SOURCEANALYSIS function is used as wrapper for various > distributed or scanning inverse approaches, and DIPOLEFITTING is used > for underdetermined model fitting to the data. The only underlying > functions for SOURCEANALYSIS that are released on the ftp server are > the lcmv and the dics beamformer methods. The functions that you > refer to are implemented in our in-house version of FieldTrip but > have not been tested thouroughly. I can give you a pre-release if you > are willing to aid in the testing of those functions. > > best regards, > Robert From muthuraman10 at HOTMAIL.COM Fri Jun 23 12:54:57 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Fri, 23 Jun 2006 10:54:57 +0000 Subject: query on CTF software!!! Message-ID: Hello For the Beamformer source analysis, do we need the CTF software because when i am trying out the tutorial in beamforming Matlab >>freq=19.0; >>Ncycles=10; >>dTimeWin=Ncycles/freq; >>cfg=[]; >>cfg.dataset='Subject01.ds'; >>cfg.channel={'MEG' 'STIM'}; >>cfg.trialdef.excludeConditions={'BAD'}; >>cfg.trialdef.includeTrigger=3; >>cfg.trialdef.prestim=0.1+dTimeWin; >>cfg.trialdef.poststim=-0.1; >>datapre=preprocessing(cfg); CTF_READ_RES4 [v 1.12] ....done ( 0.67 sec) i get the error ??? Error using ==> read_fcdc_header could not read CTF res4 header file Error in ==> preprocessing at 263 hdr = read_fcdc_header(cfg.headerfile); with regards muthu From r.oostenveld at FCDONDERS.RU.NL Fri Jun 23 15:23:22 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 23 Jun 2006 15:23:22 +0200 Subject: query on CTF software!!! In-Reply-To: Message-ID: dear Muthuraman On 23 Jun 2006, at 12:54, Muthuraman Muthuraman wrote: > For the Beamformer source analysis, do we need the CTF software > because when i am trying out the tutorial in beamforming You do not need the ctf software to follow the tutorial. The tutorial is based however on a ctf MEG dataset. > CTF_READ_RES4 [v 1.12] > ....done ( 0.67 sec) > > i get the error > > ??? Error using ==> read_fcdc_header > could not read CTF res4 header file > > Error in ==> preprocessing at 263 > hdr = read_fcdc_header(cfg.headerfile); Based on your error I suspect that matlab/fieldtrip cannot find the dataset that you are trying to analyze, or that you matlab path is incorrect. The function "CTF_READ_RES4" is not supposed to be called (it is part of the NIH ctf import routines, e.g. used in EEGLAB), since the default private/read_ctf_res4.m function can deal with the tutorial dataset just fine. Please look into the code of read_fcdc_header (using the matlab debugger) to figure out what your exact problem is. best Robert From r.oostenveld at FCDONDERS.RU.NL Fri Jun 23 15:28:03 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 23 Jun 2006 15:28:03 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <449AC08B.4080202@UKAachen.de> Message-ID: Dear Mikhail My loreta implementation still has some problems and is not 100% correct. I first want to fix it before I release it. If you know how to work with KEY-LORETA (the software from Pasqual Marqui) and could compare the two implementations, you could get a pre-release version and help fix the bugs. Robert On 22 Jun 2006, at 18:08, Mikhail Zvyagintsev wrote: > Dear Robert, > > Would be also nice to have an implementaion of LORETA approach for > source analysis from your in-house software. I would appreciate if > you could send it to me as well. > > Best regards, > > Mikhail Zvyagintsev > > MZvyagintsev at UKAachen.de From MZvyagintsev at UKAACHEN.DE Mon Jun 26 13:15:34 2006 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Mon, 26 Jun 2006 13:15:34 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <29758FB9-8B0E-4C41-8067-BF39410560A0@fcdonders.ru.nl> Message-ID: Dear Robert, Thank you for this encouragement. I was working with LORETA from Pasqual Marqui only with EEG data. I hope it will help me to be useful with fixing bugs. Kindly, Mikhail. MZvyagintsev at UKAachen.de Robert Oostenveld wrote: > Dear Mikhail > > My loreta implementation still has some problems and is not 100% > correct. I first want to fix it before I release it. If you know how > to work with KEY-LORETA (the software from Pasqual Marqui) and could > compare the two implementations, you could get a pre-release version > and help fix the bugs. > > Robert From esther.meeuwissen at FCDONDERS.RU.NL Mon Jun 26 15:04:27 2006 From: esther.meeuwissen at FCDONDERS.RU.NL (Esther Meeuwissen) Date: Mon, 26 Jun 2006 15:04:27 +0200 Subject: artifact rejection Message-ID: Hi all, A few weeks ago I started to work with Fieldtrip. I would like use it to analyze EEG data. I have a question concerning preprocessing of EEG data. I would like to do a artifact rejection during preprocessing partly using the functions in fieldtrip (detection and rejection of muscle artifacts) and partly reading in artifact markers that are exported out of brain vision analyser (I used the raw data inspector to detect eye blinks). I used the following script: EEGchans = {'Fp2', 'F7', 'F3', 'Fz', 'F4', 'F8', 'FC5', 'FC1', 'FCz', 'FC2', 'FC6', 'T 7', 'C3', 'Cz', 'C4', 'T8', 'CP5', 'CP1', 'CP2', 'CP6', 'TP10', 'P7', 'P3', 'Pz', 'P4', 'P8', 'O1', 'O2'}; EOGchans = {'VB','HL', 'HR', 'VO'}; files = {'GOS10B'... 'GOS11C'}; for subject=1:2, % Parameters cfg = []; cfg.datafile = strcat('',files{subject},'.eeg'); cfg.headerfile = strcat('',files{subject},'.vhdr'); cfg.trialdef.trgfile = strcat('',files{subject},'.vmrk'); cfg.rejectfile = strcat('',files{subject},'_Reject.Marker'); cfg.icaresultfile = strcat('',files{subject},'.ica'); cfg.outdatafile = strcat('',files{subject},'.mat'); cfg.channel = {'all'}; cfg.padding = 1.5; cfg.bpfilter = 'yes'; cfg.bpfreq = [0.3 30]; cfg.blc = 'yes'; cfg.blcwindow = [-0.1 0.0]; % EEG options cfg.reref = 'no'; cfg.implicitref = []; cfg.refchannel = {}; % Trial definition cfg.trialdef.stim = [1 2 3 4]; cfg.trialdef.prestim = 0.200; cfg.trialdef.poststim = 1.000; % Artifact options (preprocessing) cfg.artfctdef.reject = 'complete'; cfg.artfctdef.muscle.sgn = EEGchans; cfg.artfctdef.muscle.feedback = 'no'; cfg.artfctdef.muscle.cutoff = 15; % Do preprocessing cfg = definetrial(cfg); cfg = artifact_muscle(cfg) cfg = rejectartifact(cfg); data = preprocessing(cfg); %Save intermediate result save(cfg.outdatafile,'data'); clear data; pack; end; and get the following error message: Error using ==> horzcat CAT arguments dimensions are not consistent. Error in ==> rejectartifact at 182 cfg.artfctdef.type = [{'file'} cfg.artfctdef.type]; Error in ==> preprocessing at 317 [cfg] = rejectartifact(cfg); Error in ==> preproesther1 at 45 data = preprocessing(cfg); By trying to make it work I figured out that it is possible to do both the artifact rejection parts separately using (parts of) the script above but (Fieldtrip wants to combine two matrices to 1 matrix and that is what goes wrong). Does anyone know how (/whether) it is possible to do a artifact detection/rejection in Fieldtrip partly using functions of Fieldtrip itself and partly read markers of EEG parts containing a artifact (the file made by brain vision analyzer)? Thanks in advance for the answer(s)! Esther Meeuwissen From r.oostenveld at FCDONDERS.RU.NL Mon Jun 26 17:17:49 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 26 Jun 2006 17:17:49 +0200 Subject: artifact rejection In-Reply-To: Message-ID: Hi Esther, On 26 Jun 2006, at 15:04, Esther Meeuwissen wrote: > and get the following error message: > > Error using ==> horzcat > CAT arguments dimensions are not consistent. > > Error in ==> rejectartifact at 182 > cfg.artfctdef.type = [{'file'} cfg.artfctdef.type]; I suspect here that cfg.artfctdef.type is a cell-array with strings represented as a vertical cell-vector, and that line 182 tries to combine it with something that Matlab treats as horizontal cell- vector. It is unclear to me why it does that, since the cfg.artfctdef.type is built up internally (you did not explicitely specify it). > Error in ==> preprocessing at 317 > [cfg] = rejectartifact(cfg); > > Error in ==> preproesther1 at 45 > data = preprocessing(cfg); > > By trying to make it work I figured out that it is possible to do > both the > artifact rejection parts separately using (parts of) the script > above but > (Fieldtrip wants to combine two matrices to 1 matrix and that is > what goes > wrong). Does anyone know how (/whether) it is possible to do a > artifact > detection/rejection in Fieldtrip partly using functions of Fieldtrip > itself and partly read markers of EEG parts containing a artifact (the > file made by brain vision analyzer)? I have tried replicating your problem (with the data that I found on / home/electromag/estmee/GOs/analyses/datagoed), but did not encounter any problems up to the definetrial, artifatc_muscle and rejectartifact. However, the problem comes only in when preprocessing is called. For backward compatibility with other peoples old scripts, preprocessing is also calling definetrial and rejhectartifact, and rejectartifact seems confused by being called twice. I made a small change to rejectartifact that hopefully fixes the problem. The updated version is on home/common now and will be on the ftp this evening. best regards, Robert From Esther.Meeuwissen at FCDONDERS.RU.NL Tue Jun 27 09:05:21 2006 From: Esther.Meeuwissen at FCDONDERS.RU.NL (Esther Meeuwissen) Date: Tue, 27 Jun 2006 09:05:21 +0200 Subject: artifact rejection In-Reply-To: <442FC113-07E9-4479-9237-6D20F1D026C8@fcdonders.ru.nl> Message-ID: Robert Oostenveld wrote: > Hi Esther, > > On 26 Jun 2006, at 15:04, Esther Meeuwissen wrote: >> and get the following error message: >> >> Error using ==> horzcat >> CAT arguments dimensions are not consistent. >> >> Error in ==> rejectartifact at 182 >> cfg.artfctdef.type = [{'file'} cfg.artfctdef.type]; > > I suspect here that cfg.artfctdef.type is a cell-array with strings > represented as a vertical cell-vector, and that line 182 tries to > combine it with something that Matlab treats as horizontal > cell-vector. It is unclear to me why it does that, since the > cfg.artfctdef.type is built up internally (you did not explicitely > specify it). > >> Error in ==> preprocessing at 317 >> [cfg] = rejectartifact(cfg); >> >> Error in ==> preproesther1 at 45 >> data = preprocessing(cfg); >> >> By trying to make it work I figured out that it is possible to do >> both the >> artifact rejection parts separately using (parts of) the script above >> but >> (Fieldtrip wants to combine two matrices to 1 matrix and that is what >> goes >> wrong). Does anyone know how (/whether) it is possible to do a artifact >> detection/rejection in Fieldtrip partly using functions of Fieldtrip >> itself and partly read markers of EEG parts containing a artifact (the >> file made by brain vision analyzer)? > > I have tried replicating your problem (with the data that I found on > /home/electromag/estmee/GOs/analyses/datagoed), but did not encounter > any problems up to the definetrial, artifatc_muscle and > rejectartifact. However, the problem comes only in when preprocessing > is called. For backward compatibility with other peoples old scripts, > preprocessing is also calling definetrial and rejhectartifact, and > rejectartifact seems confused by being called twice. > > I made a small change to rejectartifact that hopefully fixes the > problem. The updated version is on home/common now and will be on the > ftp this evening. > > best regards, > Robert > From cgra05 at HST.AUC.DK Thu Jun 1 12:34:31 2006 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 1 Jun 2006 12:34:31 +0200 Subject: SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? In-Reply-To: <003e01c68493$c1b918f0$642dae83@fcdonders.nl> Message-ID: Hi Ingrid, OH - sorry, I didn't notice the question had already been asked on the webpage. However, I still couldn't find the answer on how to create the values for column 2 and 3, since it says at the webpage "The 2nd and 3rd are the X-position and Y-position". However, when I generate the layout file from Neuroscan I get some values for the X and Y coordinates, that are very different from yours, and the plot ends up in a big mess (see the attached file). So I was wondering if you have any idea of how to generate the X- and Y-positions from Neuroscan ??? (I have attached the generated layout-file from Neuroscan, in case that helps you. This one is named test128_neuroscan.lay) We were also wondering about the figure you e-mailed from our data, all channels appeared to be blue with a green cone (and then some frequency contributions in some channels). Is it because of some settings not edited correct, because we would have expected something like in the documentation - like figure 2 at the "Time-frequency Analysis Using Multitapers and Wavelets" page. >>From the test128_neuroscan.lay I tried to create the layout file test128_fieldtrip.lay, and got the plot shown in figure test128_fieldtrip.png Best regards, Carina Graversen -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 31. maj 2006 10:23 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, If you look at the FieldTrip page -> documentation -> frequently asked questions you can find the question (and answer): What is the format of the layout file, which is used for plotting? ...The 4th and 5th column specify the with and height of the subplot that will be made in multiplotER and multiplotTFR.... So the two columns with the same value for all channels are those columns. Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Wednesday, May 31, 2006 10:58 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Ingrid. Thanks a lot. I have tried to generate my own layout file in Neuroscan, but unfortunately it doesn't work. So I was wondering if you can tell me the format of the layout-file, because when I look at your file, 2 of the columns contain the same value for all channels. I have tried to generate for both cartesian and polor, but none of them matches. In the generated file I get the format: Can I change my input configuration to either use this format, or how should I change the format of the layout file ??? Thanks in advance :o) /Carina -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 26. maj 2006 13:29 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, Thanks for sending me the data. Indeed the biosemi 128ch layout doesn't correspond to your layout. You have 128 channels labeled from 1 to 128. If you open biosemi128.lay in a text-editor you can see that this layout file has 150 channels labeled from A1 to P7. The labels in your data (TFRmult.label) and the labels in the layout file don't match, that's why you got an empty figure (I'll add an error in the plot function, so that when no labels match you'll get an error message in the future). So what you have to do now is to make your own layout file that matches the data; with the correct x and y coordinates of the 128 channels and the same label names as in your data. Just as an illustration I attached an adapted version of the biosemi128.lay file, with only the first 128 channels, and labels 1 to 128, just as in your data. With the following configuration: cfg8 = []; cfg8.baseline = [0 0.1]; cfg8.xlim = [0 0.3] cfg8.ylim = [15 29]; cfg8.zlim = [-100 100]; cfg8.showlabels = 'yes'; cfg8.layout = 'testlay128.lay'; I got the attached figure from your data. Good luck, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: Wednesday, May 24, 2006 8:57 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina Are you sure that the biosemi 128ch layout corresponds with your electrode layout? Open the layout file in a tetx editor and look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#what_is_the_format _of_the_layout_file_which_is_used_for_plotting I suggest that you try the elec1010.lay or elec1005.lay, or even better, that you construct your own layout file corresponding with your own electrode locations. Robert On 24 May 2006, at 12:29, Carina Graversen wrote: > Hi. > > I'm trying to use the Fieldtrip program to create a wavelet plot of > my EEG > data. > > I have used it previously for 64 channel recordings, but now I'm > working > with 128 channels of data, which is causing me some problems. The > only thing > I have changed is the command: > cfg8.layout = 'biosemi128.lay'; > > But now the figure only outputs a grey page with no Time-Frequency > distributions at all. > > Can anyone tell me what I'm doing wrong - below is a complete list > of all > the commands I use :o). > > Best Regards, > Carina Graversen > > > > > % > ********************************************************************** > *** > % EVENTRELATEDAVERAGING > % > ********************************************************************** > *** > cfg1 = []; % empty > configuration > cfg1.datafile = 'test128.eeg'; % > 128 channel > Neuroscan eeg file > cfg1.headerfile = 'test128.eeg'; > cfg1.channel = 'all'; > > dataFIC = preprocessing(cfg1); % > Preprocess! > > cfg2 = []; % empty > configuration > > avgFIC = timelockanalysis(cfg2, dataFIC); > > > % % > ********************************************************************** > *** > % % WAVELET > % % > ********************************************************************** > *** > cfg7 = []; > cfg7.output = 'pow'; > cfg7.method = 'wltconvol' > cfg7.foi = 1:2:30; > cfg7.t_ftimwin = 5./cfg7.foi; > cfg7.tapsmofrq = 0.4 *cfg7.foi; > cfg7.toi = 0:0.01:0.5; > > TFRmult = freqanalysis(cfg7, avgFIC); > > cfg8 = []; > cfg8.baseline = [-0.5 0.5]; > cfg8.xlim = [0 0.5] > cfg8.zlim = [-3e-27 0.2]; > cfg8.showlabels = 'yes'; > cfg8.layout = 'biosemi128.lay'; > > multiplotTFR(cfg8, TFRmult); > -------------- next part -------------- A non-text attachment was scrubbed... Name: test128_neuroscan.lay Type: application/octet-stream Size: 7368 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test128_fieldtrip.png Type: image/png Size: 4916 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testlay128_fieldtrip.lay Type: application/octet-stream Size: 5173 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Thu Jun 1 12:35:43 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 1 Jun 2006 12:35:43 +0200 Subject: Filtering In-Reply-To: <000001c683f3$4e30cb30$90514484@dellgx240> Message-ID: Hi Vladimir On 30 May 2006, at 16:14, Vladimir Litvak wrote: > As I understand, when I do filtering in preprocessing the filter is > applied before the data is cut to epochs. Not completely: a segment of data is read from file that contains the trial (trl) plus the optional padding. That segment is filtered and then the padding is thrown away. Eventual filter atrifacts at the boundaries of the data segment that was read are in the padding and thus would not affect the data of interest itself. If you apply padding, the effect is the same as if you would have filtered the complete data continuously. > I now want to do some analysis where I want to filter after the > epochs are cut out (because there are TMS deltas there and I don't > want them to affect everything around them). Is there a simple way > to filter epoched data in FT (other than by my own code)? You can specify cfg.padding=0 in preprocessing and ensure that the TMS pulse is not inside the trial definition. You can do preprocessing without any options and then use timelockanalysis (with keeptrials) on it. Timelockanalysis supports almost all options that preprocessing has, i.e. all filtering and baselinecorection options, but of course cannot do the padding. Those additional options are not documented in timelockanalysis, but look in the code and you will see them. Doing it in timelockanalysis has the advantage that it is easier to play around with filter settings (i.e. it is faster not having to read the data every time). Also interesting to know perhaps is that you can also apply timelockanalysis and its filtering to an average, i.e. timelockanalysis will accept a timelock-structure as input. So you can average in the first call to timelockanalysis, and then throw that average into timelockanalysis a second time to see the effect of the filter. In the latter case only the average is filtered, i.e. it is very fast. best Robert From ingrid.nieuwenhuis at FCDONDERS.RU.NL Thu Jun 1 13:21:11 2006 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Thu, 1 Jun 2006 13:21:11 +0200 Subject: SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? In-Reply-To: Message-ID: Hi Carina, The problem is that the width and height of the boxes (column 4 and 5) are too big compared to your x and y coordinates. What multiplotTFR does is that it plots the TFR boxes at the specified coordinates. The x and y coordinates are between +/- 0 and 0.7 and the box width/height is 0.18 and 1.14, so all the plots are plotted on top of each other. That's why it is a mess. So you could use the x and y coordinates, but the boxes should be smaller, or you can scale it al up. What comes out of the plots is just what the data is. Probably depends on your settings during the TFR analysis. The dark blue at the edges and bottom are NaN's in the data. Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Thursday, June 01, 2006 12:35 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Ingrid, OH - sorry, I didn't notice the question had already been asked on the webpage. However, I still couldn't find the answer on how to create the values for column 2 and 3, since it says at the webpage "The 2nd and 3rd are the X-position and Y-position". However, when I generate the layout file from Neuroscan I get some values for the X and Y coordinates, that are very different from yours, and the plot ends up in a big mess (see the attached file). So I was wondering if you have any idea of how to generate the X- and Y-positions from Neuroscan ??? (I have attached the generated layout-file from Neuroscan, in case that helps you. This one is named test128_neuroscan.lay) We were also wondering about the figure you e-mailed from our data, all channels appeared to be blue with a green cone (and then some frequency contributions in some channels). Is it because of some settings not edited correct, because we would have expected something like in the documentation - like figure 2 at the "Time-frequency Analysis Using Multitapers and Wavelets" page. >>From the test128_neuroscan.lay I tried to create the layout file test128_fieldtrip.lay, and got the plot shown in figure test128_fieldtrip.png Best regards, Carina Graversen -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 31. maj 2006 10:23 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, If you look at the FieldTrip page -> documentation -> frequently asked questions you can find the question (and answer): What is the format of the layout file, which is used for plotting? ...The 4th and 5th column specify the with and height of the subplot that will be made in multiplotER and multiplotTFR.... So the two columns with the same value for all channels are those columns. Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Carina Graversen Sent: Wednesday, May 31, 2006 10:58 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Ingrid. Thanks a lot. I have tried to generate my own layout file in Neuroscan, but unfortunately it doesn't work. So I was wondering if you can tell me the format of the layout-file, because when I look at your file, 2 of the columns contain the same value for all channels. I have tried to generate for both cartesian and polor, but none of them matches. In the generated file I get the format: Can I change my input configuration to either use this format, or how should I change the format of the layout file ??? Thanks in advance :o) /Carina -----Oprindelig meddelelse----- Fra: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL]Pa vegne af Ingrid Nieuwenhuis Sendt: 26. maj 2006 13:29 Til: FIELDTRIP at NIC.SURFNET.NL Emne: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina, Thanks for sending me the data. Indeed the biosemi 128ch layout doesn't correspond to your layout. You have 128 channels labeled from 1 to 128. If you open biosemi128.lay in a text-editor you can see that this layout file has 150 channels labeled from A1 to P7. The labels in your data (TFRmult.label) and the labels in the layout file don't match, that's why you got an empty figure (I'll add an error in the plot function, so that when no labels match you'll get an error message in the future). So what you have to do now is to make your own layout file that matches the data; with the correct x and y coordinates of the 128 channels and the same label names as in your data. Just as an illustration I attached an adapted version of the biosemi128.lay file, with only the first 128 channels, and labels 1 to 128, just as in your data. With the following configuration: cfg8 = []; cfg8.baseline = [0 0.1]; cfg8.xlim = [0 0.3] cfg8.ylim = [15 29]; cfg8.zlim = [-100 100]; cfg8.showlabels = 'yes'; cfg8.layout = 'testlay128.lay'; I got the attached figure from your data. Good luck, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: Wednesday, May 24, 2006 8:57 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? Hi Carina Are you sure that the biosemi 128ch layout corresponds with your electrode layout? Open the layout file in a tetx editor and look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#what_is_the_format _of_the_layout_file_which_is_used_for_plotting I suggest that you try the elec1010.lay or elec1005.lay, or even better, that you construct your own layout file corresponding with your own electrode locations. Robert On 24 May 2006, at 12:29, Carina Graversen wrote: > Hi. > > I'm trying to use the Fieldtrip program to create a wavelet plot of > my EEG > data. > > I have used it previously for 64 channel recordings, but now I'm > working > with 128 channels of data, which is causing me some problems. The > only thing > I have changed is the command: > cfg8.layout = 'biosemi128.lay'; > > But now the figure only outputs a grey page with no Time-Frequency > distributions at all. > > Can anyone tell me what I'm doing wrong - below is a complete list > of all > the commands I use :o). > > Best Regards, > Carina Graversen > > > > > % > ********************************************************************** > *** > % EVENTRELATEDAVERAGING > % > ********************************************************************** > *** > cfg1 = []; % empty > configuration > cfg1.datafile = 'test128.eeg'; % > 128 channel > Neuroscan eeg file > cfg1.headerfile = 'test128.eeg'; > cfg1.channel = 'all'; > > dataFIC = preprocessing(cfg1); % > Preprocess! > > cfg2 = []; % empty > configuration > > avgFIC = timelockanalysis(cfg2, dataFIC); > > > % % > ********************************************************************** > *** > % % WAVELET > % % > ********************************************************************** > *** > cfg7 = []; > cfg7.output = 'pow'; > cfg7.method = 'wltconvol' > cfg7.foi = 1:2:30; > cfg7.t_ftimwin = 5./cfg7.foi; > cfg7.tapsmofrq = 0.4 *cfg7.foi; > cfg7.toi = 0:0.01:0.5; > > TFRmult = freqanalysis(cfg7, avgFIC); > > cfg8 = []; > cfg8.baseline = [-0.5 0.5]; > cfg8.xlim = [0 0.5] > cfg8.zlim = [-3e-27 0.2]; > cfg8.showlabels = 'yes'; > cfg8.layout = 'biosemi128.lay'; > > multiplotTFR(cfg8, TFRmult); > From r.oostenveld at FCDONDERS.RU.NL Thu Jun 1 13:51:02 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 1 Jun 2006 13:51:02 +0200 Subject: SV: [FIELDTRIP] multiplotTFR for 128 channel Neuroscan EEG data ??? In-Reply-To: Message-ID: Hi Carina, Please take attached "layoutplot" function and copy it into the fieldtrip directory. Then do >> cfg.layout = 'CTF151.lay' cfg = layout: 'CTF151.lay' >> layoutplot(cfg) reading layout from file CTF151.lay and you will get the attached figure for the 151 channel CTF system. Then try plotting the other layouts (the *.lay files) and your own layout, and modify the values in your own layout file (in a text editor) untill you like what you see. Robert PS when I was looking at the other layouts, I noticed that the elec1020, elec1010 and elec1005 layouts supplied with fieldtrip are not optimal, since they also have overlapping boxes. -------------- next part -------------- A non-text attachment was scrubbed... Name: layoutplot.m Type: application/octet-stream Size: 998 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 1.png Type: image/png Size: 27957 bytes Desc: not available URL: From r.oostenveld at FCDONDERS.RU.NL Thu Jun 1 13:58:48 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 1 Jun 2006 13:58:48 +0200 Subject: query on coherence source analysis In-Reply-To: Message-ID: Dear Muthuraman I have not been able to reproduce your error. I suggest that you get the latest version of FieldTrip from our FTP server and try again. best egards, Robert PS this is the test script I used. It uses some simulated data, which again uses a MEG gradiometer definition and a head model from the tutorial data. ----------------- % read some data that is required to simulate MEG data, i.e. volume model, % sensor positions and MRI (optional, only for plotting) vol = read_ctf_hdm('Subject01.hdm'); hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); grad = hdr.grad; % construct the simulated MEG data for condition A ("active") cfg = []; cfg.vol = vol; cfg.grad = grad; cfg.fsample = 300; cfg.ntrials = 2; cfg.triallength = 1; cfg.dip.pos = [0 7 8]; cfg.dip.mom = [1 0 0]; cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); cfg.absnoise = 1e-8; data = dipolesimulation(cfg); % add the source signal as fake EMG channel for i=1:cfg.ntrials data.trial{i}(end+1,:) = cfg.dip.signal + randn(size (cfg.dip.signal)); end data.label{end+1} = 'EMG'; cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'MEG' 'EMG'},data.label); cfg.channelcmb={'MEG' 'EMG'}; freq=freqanalysis(cfg,data); From olga at GRAPHICMIND.INFO Sat Jun 3 12:45:41 2006 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Sat, 3 Jun 2006 14:45:41 +0400 Subject: deleting two EOG channale from data-stucture Message-ID: Dear list members, I would like to delete two channels from my data. How is it better to do this? Best Regards, Olga -------------- next part -------------- An HTML attachment was scrubbed... URL: From olga at GRAPHICMIND.INFO Sat Jun 3 14:16:57 2006 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Sat, 3 Jun 2006 16:16:57 +0400 Subject: and clusterrandomization Message-ID: Thank you very much, Eric! That was an inconsistency in the loci of EOG channels between subjects. Now I corrected it: HEOG and VEOG data are still presented in the data structure, but do not have the location (pnt 0 0 0). Is it OK? The results looks as what I excpected. Best Regards, Olga. ----- Original Message ----- From: "Eric Maris" To: Sent: Friday, May 26, 2006 5:35 PM Subject: Re: [FIELDTRIP] and clusterrandomization > Dear Olga, > > > But the problems is still in my clusterrandomization. > Could the fact that the order of the channel in the file (C_vc11.label) is > not the same as in the C_vc11.elec.label influences the result of > clusterrandomization (I do not have my neigbouring channel file)? > > > That should not matter. However, the labels in your data structure (.label > in the output of timelockgrandaverage) should exactly match the labels in > the elec-structure. If that is OK, then something might have gone wrong > with the combination of the data of the different subjects. Do they all > have the same elec-structure? If the same physical channel has different > labels for different subjects, then this may create inconsistencies > between EEGlab and Fieldtrip. For Fieldtrip, channels that have the same > label are assumed to be physically identical, even if they are in > different positions in the data structure. This is only a guess, of > course. > > > kind regards, > > Eric Maris > > > > > > > > > > Best Regards, > Olga. > ----- Original Message ----- > From: Ingrid Nieuwenhuis > To: FIELDTRIP at NIC.SURFNET.NL > Sent: Wednesday, May 24, 2006 8:45 PM > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > Hi Olga, > > > > About the z-param: > > This is the field that contains the data to be plotted; for instance > 'avg', 'powspctrm' or 'cohspctrm'. Normally the function looks in your > data.dimord to find out which z-param to use. To make the function work > you could give cfg.zparam = 'avg' (for instance if you want to plot an > ERF/ERP). But if you could send me what the dimord field of the data that > you want to plot is, I could look why the plot functions don't extract the > correct zparam themselves. > > > > About the timelockgranaveraging: I also think it should be the same. I > have no idea what it could be. > > > > Good luck, > > Ingrid Nieuwenhuis > > > > > ------------------------------------------------------------------------------ > > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Olga Sysoeva > Sent: Wednesday, May 24, 2006 5:44 PM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > > Dear List member, > > > > Sorry for such dull questions but, > > I am again facing the new problems with Fieldtrip, although did not solve > some previous one (still can not singleplot and multiplot anything 'cause > of "unknown zparam field". > > > > OK, about new one :-) > > > > It seems that I did not use write the timelockgranaveraging. > > > > The problem must be here, when I made grand averaging of all my 11 > subject > data > > cfg =[]; > cfg.keepindividual = 'yes' > C_vc11 = > > timelockgrandaverage(cfg,vc_c_avg1,vc_c_avg2,vc_c_avg3,vc_c_avg4,vc_c_avg5, > vc_c_avg6,vc_c_avg7,vc_c_avg8,vc_c_avg9,vc_c_avg10,vc_c_avg11 ); > > As I understand the > > vc_c_avg11.avg([9],[43]) should be similar with C_vc11.individual ([11], > [9], [43]) > But it is not. > What can it be? > > Best Regards, > > Olga. > > > > > > ----- Original Message ----- > > From: Olga Sysoeva > > To: FIELDTRIP at NIC.SURFNET.NL > > Sent: Saturday, May 13, 2006 4:34 PM > > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > > Thank you very much, Lilla! > > Now I knwo what to do but faced the problem with " unknown zparam > field" when ploting the results. Unfortunatly cfg.zparam does not > discribed in help file... > > Best Regards, Olga > > ----- Original Message ----- > > From: Lilla Magyari > > To: FIELDTRIP at NIC.SURFNET.NL > > Sent: Saturday, May 13, 2006 3:11 PM > > Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data > within-subject > > > > Dear Olga, > > > > I am just studying time-frequency analysis but I have done already on > my data, so perhaps I can help you. > > First, yes, you have to do freqanalysis on the preprocessed data of > the individual subjects for all conditions that you want to compare (i.e. > the input for this function contains all trials from one subject in one > condition.) And it is also important that the other input for this > function is the cfg where for example, in the cfg.method you have to > specify what kind of time-frequency analysis you want to use. (You have to > write 'wltconvol' for wavelet transformation and 'mltconvol' for > multitaper analysis.) > > When you use freqanalysis as output you can get TFR for one subject > in one condition (but it is also possible to keep the information for the > individual trials of the condition by specifying cfg.keeptrials = 'yes'). > When you have the TFRs for each subject you can grandaverage them with > freqgrandaverage where the input is the TFRs of all subjects (and before > averaging you can use also freqbaseline for giving a baseline for your > TFRs). > > > > I hope it helps. > > > > Best regards, > > Lilla Magyari > > > > > > > > > -------------------------------------------------------------------------- > > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On > Behalf Of Olga Sysoeva > Sent: Saturday, May 13, 2006 9:28 AM > To: FIELDTRIP at NIC.SURFNET.NL > Subject: [FIELDTRIP] clusterrandomization on 3D-data within-subject > > > > Dear list members, > > > > Thank you everybody for your help! I've already got interesting > results using clusterrandomization on my data! Thanks a lot! > > > > Now I have a question about using the clusterrandomization on 3-D > data (channel-time-frequency) in within-subject analysis. > > As I understand it is possible with Fieldtrip, but I really newby in > time-frequency anlysis, therefore wanted your comments, > > as far as I didn't find the example of the application of > clusteranalysis on this set of the data in tuturial. > > > > I successfully conduct the within-subject clusterrandomization on my > grand-average data, which does not have the third, frequency demintion. > > Now I want to add it. But I could not apply freqanalyisis on > grandavarage data, could I? Should I made the TFR of individual data and > than grand-avarage the result? > > Which function should I use? > > > > Best Regards, > > Olga. From olga at GRAPHICMIND.INFO Sat Jun 3 14:26:35 2006 From: olga at GRAPHICMIND.INFO (Olga Sysoeva) Date: Sat, 3 Jun 2006 16:26:35 +0400 Subject: clusrand: 19 channels 0 minnbchan Message-ID: Dear experts, Does it make sense to make clusterrandomization if I put "0" in the min number of neibouring channels if I have only 19 of them (10-20 system)? As I understand in this case just the time is considered when clustering. How many consequent time point is requiered to build a cluster? Best Regards, Olga. -------------- next part -------------- An HTML attachment was scrubbed... URL: From maris at NICI.RU.NL Sat Jun 3 18:47:21 2006 From: maris at NICI.RU.NL (Eric Maris) Date: Sat, 3 Jun 2006 18:47:21 +0200 Subject: deleting two EOG channale from data-stucture Message-ID: Dear Olga, I would like to delete two channels from my data. How is it better to do this? Type "help channelselection" at the Matlab command line. This will give you information on how the Fieldtrip functions perform channelselection on the basis of the input in cfg.channel. I don't have Matlab running now, but I think that '-EOG' in cfg.channel will do the job you request. greetings, Eric From maris at NICI.RU.NL Sat Jun 3 18:50:06 2006 From: maris at NICI.RU.NL (Eric Maris) Date: Sat, 3 Jun 2006 18:50:06 +0200 Subject: and clusterrandomization Message-ID: Dear Olga, > That was an inconsistency in the loci of EOG channels between subjects. > Now I corrected it: HEOG and VEOG data are still presented in the data > structure, but do not have the location (pnt 0 0 0). Is it OK? The results > looks as what I excpected. Because you never will include the EOG-channels in an analysis of the EEG-channels, the location of the EOG is not required by clusterrandanalysis. greetings, Eric Maris > Best Regards, > Olga. > > ----- Original Message ----- > From: "Eric Maris" > To: > Sent: Friday, May 26, 2006 5:35 PM > Subject: Re: [FIELDTRIP] and clusterrandomization > > >> Dear Olga, >> >> >> But the problems is still in my clusterrandomization. >> Could the fact that the order of the channel in the file (C_vc11.label) >> is not the same as in the C_vc11.elec.label influences the result of >> clusterrandomization (I do not have my neigbouring channel file)? >> >> >> That should not matter. However, the labels in your data structure >> (.label in the output of timelockgrandaverage) should exactly match the >> labels in the elec-structure. If that is OK, then something might have >> gone wrong with the combination of the data of the different subjects. Do >> they all have the same elec-structure? If the same physical channel has >> different labels for different subjects, then this may create >> inconsistencies between EEGlab and Fieldtrip. For Fieldtrip, channels >> that have the same label are assumed to be physically identical, even if >> they are in different positions in the data structure. This is only a >> guess, of course. >> >> >> kind regards, >> >> Eric Maris >> >> >> >> >> >> >> >> >> >> Best Regards, >> Olga. >> ----- Original Message ----- >> From: Ingrid Nieuwenhuis >> To: FIELDTRIP at NIC.SURFNET.NL >> Sent: Wednesday, May 24, 2006 8:45 PM >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject >> >> >> Hi Olga, >> >> >> >> About the z-param: >> >> This is the field that contains the data to be plotted; for instance >> 'avg', 'powspctrm' or 'cohspctrm'. Normally the function looks in your >> data.dimord to find out which z-param to use. To make the function work >> you could give cfg.zparam = 'avg' (for instance if you want to plot an >> ERF/ERP). But if you could send me what the dimord field of the data that >> you want to plot is, I could look why the plot functions don't extract >> the correct zparam themselves. >> >> >> >> About the timelockgranaveraging: I also think it should be the same. I >> have no idea what it could be. >> >> >> >> Good luck, >> >> Ingrid Nieuwenhuis >> >> >> >> >> ------------------------------------------------------------------------------ >> >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >> Behalf Of Olga Sysoeva >> Sent: Wednesday, May 24, 2006 5:44 PM >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data within-subject >> >> >> >> Dear List member, >> >> >> >> Sorry for such dull questions but, >> >> I am again facing the new problems with Fieldtrip, although did not >> solve some previous one (still can not singleplot and multiplot anything >> 'cause of "unknown zparam field". >> >> >> >> OK, about new one :-) >> >> >> >> It seems that I did not use write the timelockgranaveraging. >> >> >> >> The problem must be here, when I made grand averaging of all my 11 >> subject >> data >> >> cfg =[]; >> cfg.keepindividual = 'yes' >> C_vc11 = >> >> timelockgrandaverage(cfg,vc_c_avg1,vc_c_avg2,vc_c_avg3,vc_c_avg4,vc_c_avg5, >> vc_c_avg6,vc_c_avg7,vc_c_avg8,vc_c_avg9,vc_c_avg10,vc_c_avg11 ); >> >> As I understand the >> >> vc_c_avg11.avg([9],[43]) should be similar with C_vc11.individual ([11], >> [9], [43]) >> But it is not. >> What can it be? >> >> Best Regards, >> >> Olga. >> >> >> >> >> >> ----- Original Message ----- >> >> From: Olga Sysoeva >> >> To: FIELDTRIP at NIC.SURFNET.NL >> >> Sent: Saturday, May 13, 2006 4:34 PM >> >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data >> within-subject >> >> >> >> Thank you very much, Lilla! >> >> Now I knwo what to do but faced the problem with " unknown zparam >> field" when ploting the results. Unfortunatly cfg.zparam does not >> discribed in help file... >> >> Best Regards, Olga >> >> ----- Original Message ----- >> >> From: Lilla Magyari >> >> To: FIELDTRIP at NIC.SURFNET.NL >> >> Sent: Saturday, May 13, 2006 3:11 PM >> >> Subject: Re: [FIELDTRIP] clusterrandomization on 3D-data >> within-subject >> >> >> >> Dear Olga, >> >> >> >> I am just studying time-frequency analysis but I have done already >> on my data, so perhaps I can help you. >> >> First, yes, you have to do freqanalysis on the preprocessed data of >> the individual subjects for all conditions that you want to compare (i.e. >> the input for this function contains all trials from one subject in one >> condition.) And it is also important that the other input for this >> function is the cfg where for example, in the cfg.method you have to >> specify what kind of time-frequency analysis you want to use. (You have >> to write 'wltconvol' for wavelet transformation and 'mltconvol' for >> multitaper analysis.) >> >> When you use freqanalysis as output you can get TFR for one subject >> in one condition (but it is also possible to keep the information for the >> individual trials of the condition by specifying cfg.keeptrials = 'yes'). >> When you have the TFRs for each subject you can grandaverage them with >> freqgrandaverage where the input is the TFRs of all subjects (and before >> averaging you can use also freqbaseline for giving a baseline for your >> TFRs). >> >> >> >> I hope it helps. >> >> >> >> Best regards, >> >> Lilla Magyari >> >> >> >> >> >> >> >> >> -------------------------------------------------------------------------- >> >> From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On >> Behalf Of Olga Sysoeva >> Sent: Saturday, May 13, 2006 9:28 AM >> To: FIELDTRIP at NIC.SURFNET.NL >> Subject: [FIELDTRIP] clusterrandomization on 3D-data within-subject >> >> >> >> Dear list members, >> >> >> >> Thank you everybody for your help! I've already got interesting >> results using clusterrandomization on my data! Thanks a lot! >> >> >> >> Now I have a question about using the clusterrandomization on 3-D >> data (channel-time-frequency) in within-subject analysis. >> >> As I understand it is possible with Fieldtrip, but I really newby in >> time-frequency anlysis, therefore wanted your comments, >> >> as far as I didn't find the example of the application of >> clusteranalysis on this set of the data in tuturial. >> >> >> >> I successfully conduct the within-subject clusterrandomization on my >> grand-average data, which does not have the third, frequency demintion. >> >> Now I want to add it. But I could not apply freqanalyisis on >> grandavarage data, could I? Should I made the TFR of individual data and >> than grand-avarage the result? >> >> Which function should I use? >> >> >> >> Best Regards, >> >> Olga. From maris at NICI.RU.NL Sat Jun 3 18:53:19 2006 From: maris at NICI.RU.NL (Eric Maris) Date: Sat, 3 Jun 2006 18:53:19 +0200 Subject: clusrand: 19 channels 0 minnbchan Message-ID: Dear Olga, Does it make sense to make clusterrandomization if I put "0" in the min number of neibouring channels if I have only 19 of them (10-20 system)? As I understand in this case just the time is considered when clustering. How many consequent time point is requiered to build a cluster? Yes, it makes sense. The cfg.minnbchan-field is a way to suppress the tendency of the cluster-growing algorithm to connect everything with everything, even on the basis of noise. The FA-rate is not affect by the value of cfg.minnbchan. greetings, Eric Maris From pchris at UNC.EDU Mon Jun 5 19:05:30 2006 From: pchris at UNC.EDU (Punita Christopher) Date: Mon, 5 Jun 2006 19:05:30 +0200 Subject: dipole model Message-ID: Has anyone seen any literature that deals with a spherical multiple layer head model in which the dipole spans across layers i.e. the source and sink of the dipole are in separate layers. Thanks, Punita From r.oostenveld at FCDONDERS.RU.NL Tue Jun 6 10:50:02 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 6 Jun 2006 10:50:02 +0200 Subject: dipole model In-Reply-To: Message-ID: Hi Punita, On 5 Jun 2006, at 19:05, Punita Christopher wrote: > Has anyone seen any literature that deals with a spherical multiple > layer > head model in which the dipole spans across layers i.e. the source and > sink of the dipole are in separate layers. In the dipole model the source and sink are infintely close together. The difference on the scalp between a dipole and a source+sink model with only a few mm in between will be negligible. A source+sink model with more distance between them can be modelled as such, it requires the solution of the monopole in a sphere (i.e. the desired source +sink consists of the superposition of two monopoles). I am not sure whether an analytical solution for that exsists in a 3- or 4-shell model, but I would would guess that it does (*). For a BEM model it is trivial to replace the dipole infinite medium potential with a monopole infinite medium potential, i.e the BEM formulation (separation of source and volume conduction) allows the specification of arbitrary sources. best Robert *) I don't know literature for a monopole in a multi-shell sphere, but I would expect it to be in either textbooks as a didactical example or in older articles (70s or 80s). You may want to search for multipole expansions, which are described in more recent literature, the monopole is the first term (0th order) of that, the dipole the second term. Perhaps "Phys Med Biol. 2001 Aug;46(8):2255-66. A study of equivalent source techniques for high-resolution EEG imaging. Yao D, Zhou Y, Zeng M, Fan S, Lian J, Wu D, Ao X, Chen L, He B." could provide more insight. From muthuraman10 at HOTMAIL.COM Tue Jun 6 11:19:56 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Tue, 6 Jun 2006 09:19:56 +0000 Subject: query on coherence analysis In-Reply-To: Message-ID: Hello Thanks for the comments, i have downloaded the latest version and now i am able to calculate using mtmwelch but i get a error when i am plotting i will included the matlab commands >>cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); >>fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='foi'; cfg.yparam='cohspctrm'; cfg.xlim=[0 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG26'; singleplotER(cfg,fd); ??? Reference to non-existent field 'foi'. Error in ==> singleplotER at 272 plot(varargin{k-1}.(cfg.xparam), P, style); with regards muthu >From: Robert Oostenveld >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence source analysis >Date: Thu, 1 Jun 2006 13:58:48 +0200 > >Dear Muthuraman > >I have not been able to reproduce your error. I suggest that you get the >latest version of FieldTrip from our FTP server and try again. > >best egards, >Robert > >PS this is the test script I used. It uses some simulated data, which >again uses a MEG gradiometer definition and a head model from the tutorial >data. > > >----------------- >% read some data that is required to simulate MEG data, i.e. volume model, >% sensor positions and MRI (optional, only for plotting) >vol = read_ctf_hdm('Subject01.hdm'); >hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); >grad = hdr.grad; > >% construct the simulated MEG data for condition A ("active") >cfg = []; >cfg.vol = vol; >cfg.grad = grad; >cfg.fsample = 300; >cfg.ntrials = 2; >cfg.triallength = 1; >cfg.dip.pos = [0 7 8]; >cfg.dip.mom = [1 0 0]; >cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); >cfg.absnoise = 1e-8; >data = dipolesimulation(cfg); > >% add the source signal as fake EMG channel >for i=1:cfg.ntrials > data.trial{i}(end+1,:) = cfg.dip.signal + randn(size (cfg.dip.signal)); >end >data.label{end+1} = 'EMG'; > >cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'MEG' 'EMG'},data.label); >cfg.channelcmb={'MEG' 'EMG'}; >freq=freqanalysis(cfg,data); > > > From ingrid.nieuwenhuis at FCDONDERS.RU.NL Tue Jun 6 13:33:28 2006 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Tue, 6 Jun 2006 13:33:28 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: Dear Muthuraman, cfg.xparam should not be 'foi', but 'freq' (see help singleplotER) Bests, Ingrid -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Tuesday, June 06, 2006 11:20 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] query on coherence analysis Hello Thanks for the comments, i have downloaded the latest version and now i am able to calculate using mtmwelch but i get a error when i am plotting i will included the matlab commands >>cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); >>fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='foi'; cfg.yparam='cohspctrm'; cfg.xlim=[0 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG26'; singleplotER(cfg,fd); ??? Reference to non-existent field 'foi'. Error in ==> singleplotER at 272 plot(varargin{k-1}.(cfg.xparam), P, style); with regards muthu >From: Robert Oostenveld >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence source analysis >Date: Thu, 1 Jun 2006 13:58:48 +0200 > >Dear Muthuraman > >I have not been able to reproduce your error. I suggest that you get the >latest version of FieldTrip from our FTP server and try again. > >best egards, >Robert > >PS this is the test script I used. It uses some simulated data, which >again uses a MEG gradiometer definition and a head model from the tutorial >data. > > >----------------- >% read some data that is required to simulate MEG data, i.e. volume model, >% sensor positions and MRI (optional, only for plotting) >vol = read_ctf_hdm('Subject01.hdm'); >hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); >grad = hdr.grad; > >% construct the simulated MEG data for condition A ("active") >cfg = []; >cfg.vol = vol; >cfg.grad = grad; >cfg.fsample = 300; >cfg.ntrials = 2; >cfg.triallength = 1; >cfg.dip.pos = [0 7 8]; >cfg.dip.mom = [1 0 0]; >cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); >cfg.absnoise = 1e-8; >data = dipolesimulation(cfg); > >% add the source signal as fake EMG channel >for i=1:cfg.ntrials > data.trial{i}(end+1,:) = cfg.dip.signal + randn(size (cfg.dip.signal)); >end >data.label{end+1} = 'EMG'; > >cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'MEG' 'EMG'},data.label); >cfg.channelcmb={'MEG' 'EMG'}; >freq=freqanalysis(cfg,data); > > > From ingrid.nieuwenhuis at FCDONDERS.RU.NL Wed Jun 14 11:55:53 2006 From: ingrid.nieuwenhuis at FCDONDERS.RU.NL (Ingrid Nieuwenhuis) Date: Wed, 14 Jun 2006 11:55:53 +0200 Subject: missing cumtapcnt field Message-ID: I'm (trying to) beamform, but I get the following error: reference to non-existent field 'cumtapcnt' In prepare_freq_matrices line 124. Ntrials = length(freq.cumtapcnt) I used freqanalysis method 'mtmconvol' to do make the freq, and it indeed doesn't contain a 'cumtapcnt' cfg = []; cfg.method = 'mtmconvol'; cfg.output = 'powandcsd'; cfg.foi = 90; cfg.t_ftimwin = 0.5; cfg.tapsmofrq = 30; cfg.pad = 'maxperlen'; cfg.taper = 'dpss'; cfg.keeptrials = 'yes'; cfg.keeptapers = 'no'; cfg.toi = 0.75 freq_BF = freqanalysis(cfg, data); So my questions: - Why doesn't my freq contain a cumtapcnt field. Should I have kept my tapers (cfg.keeptapers = 'yes')? - Can I solve this without having to freqanalysis my data all over again, I can see in my freq.crsspctrm = [76 x 11476 double] that I have 76 trials. Can I for instance just make a vector of ones with length 76 and put that in my freq, or will that create problems? Thanks a lot, Ingrid From Jan.Schoffelen at FCDONDERS.RU.NL Wed Jun 14 12:42:08 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Wed, 14 Jun 2006 12:42:08 +0200 Subject: missing cumtapcnt field In-Reply-To: Message-ID: Hi Ingrid, >Can I for instance just make a vector of ones with length 76 and put that >in my freq, or will that create problems? The answer to this question is yes. Indeed, no cumtapcnt is passed back when using freqanalysis_mtmconvol. Should be fixed, though. In your case I think it is sufficient just to provide a vector which has a dimensionality of Nx1, N being the number of epoch. The content of this vector will not be used later on in this case. On the other hand, the cumtapcnt-vector, as outputted by for example freqanalysis_mtmfft contains for each epoch the number of tapers which have been used for the estimation of the spectra for that particular epoch. Please note that if you set the option cfg.keeptapers = 'yes', the vector consists only of ones (or if you use e.g. a single hanning-taper, or such a low amount of smoothing, that you only need one 'dpss'-taper, in which case by the way it does not make sense to use the 'dpss'). In any other case, the cumtapcnt-vector contains a number, which can be different for each epoch (when you have trials of different lengths). You can easily compute the number of tapers, this will be: 2xNxK-1, with N being the length of your data segment (in seconds), and K being the taper-smoothing you specified in cfg.tapsmofrq. Yours, JM From nathanweisz at MAC.COM Thu Jun 15 11:42:43 2006 From: nathanweisz at MAC.COM (Nathan Weisz) Date: Thu, 15 Jun 2006 11:42:43 +0200 Subject: source positions - brain regions Message-ID: dear help-list, sorry for what appears to be a very basic question. i'm just starting to explore the source analysis possibilities that fieldtrip offers. for this i downloaded a EEG tutorial dataset from eeglab, did eeglab2fieldtrip, and the timelockanalysis. now i wanted to estimate the source waveforms of the erp. %this is my input: vol = []; vol.r = 12 * [0.88 0.92 1.00]; % radii of spheres, the head radius is 12 cm vol.c = [1 1/80 1]; % conductivity vol.o = [0 0 0]; tmp=data.elec; tmp.pnt=tmp.pnt*12; cfg=[]; cfg.method='lcmv'; cfg.vol=vol; cfg.elec=tmp; cfg.resolution=1; datamn=sourceanalysis(cfg,dataav); %this is the output datamn = xgrid: [-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10] ygrid: [-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10] zgrid: [-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10] dim: [21 21 19] vol: [1x1 struct] time: [1x256 double] pos: [8379x3 double] inside: [1x4811 double] outside: [1x3568 double] method: 'average' avg: [1x1 struct] cfg: [1x1 struct] there were no error or warning messages, so from the basic structure things seem to be ok. the time courses of my source activity appears to be saved in datamn.avg.mom. >> size(datamn.avg.mom{datamn.inside(1)}) ans = 3 256 however now i'm a little bit stuck. from here, what is the best method of finding out which dipoles correspond (very roughly) to which brain regions, so i can extract specifically those to look at the sourcewaveforms? unfortunatley no mri. I am aware of the sourceplot function, but was uncapable of producing a meaningful output. thanks in advance for any hints & best wishes, nathan -------------------------------- Dr. Nathan Weisz Dept. of Psychology University of Konstanz P.O. Box D25 78457 Konstanz, Germany Tel: ++49-7531-884612 Email & Chat-AV: nathanweisz at mac.com Homepage: http://homepage.mac.com/nathanweisz/start/research.html From muthuraman10 at HOTMAIL.COM Thu Jun 15 15:59:54 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Thu, 15 Jun 2006 13:59:54 +0000 Subject: query on coherence analysis In-Reply-To: <002201c6895d$07c0d680$642dae83@fcdonders.nl> Message-ID: Hello Thankyou for the previous help it works now i am able to proceed further to calculate the coherence The problem now the coherence obtained using the mtmwelch when i plot the coherence figures for the channels all the coherence figures for the different channel looks the same is there is a bug in how i am calculating the coherence These are the steps i carried out in calculating the coherence headerfile='pd_mof_tr0_c_0306.cnt'; hdr = read_fcdc_header(headerfile); cfg.trl = []; for i=1:floor(hdr.nSamples/hdr.Fs) cfg.trl(i,1) = (i-1)*hdr.Fs + 1; cfg.trl(i,2) = (i )*hdr.Fs; cfg.trl(i,3) = 0; end cfg.headerfile=headerfile; >>cfg.datafile=headerfile; >>[data] = preprocessing(cfg); -and after the data is preprocessed i change the channel labels from actual cz to eeg26 and so on cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); -when i calculate using freqanalysis i get these warnings 1.000 Hz : WARNING - using only one taper for specified smoothing Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 360 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 and so on till 30.000 hz -and while processing processing trial 2: 1000 samples Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 398 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='freq'; cfg.yparam='cohspctrm'; cfg.xlim=[3 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG27'; singleplotER(cfg,fd); -when i try to plot i get this error ??? Error using ==> char Cell elements must be character arrays. Error in ==> singleplotER at 326 t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; please , look at it and help me in this regard thanking you with regards muthuraman >From: Ingrid Nieuwenhuis >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis >Date: Tue, 6 Jun 2006 13:33:28 +0200 > >Dear Muthuraman, > >cfg.xparam should not be 'foi', but 'freq' (see help singleplotER) > >Bests, >Ingrid > > >-----Original Message----- >From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf >Of Muthuraman Muthuraman >Sent: Tuesday, June 06, 2006 11:20 AM >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis > >Hello > >Thanks for the comments, i have downloaded the latest version >and now i am able to calculate using mtmwelch > >but i get a error when i am plotting >i will included the matlab commands > > >>cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'EEG' 'EMG2'},data.label); >cfg.channelcmb={'EEG' 'EMG2'}; >freq=freqanalysis(cfg,data); > > >>fd=freqdescriptives([],freq); > >cfg=[]; >cfg.xparam='foi'; >cfg.yparam='cohspctrm'; >cfg.xlim=[0 30]; >cfg.cohrefchannel='EMG2'; >cfg.box='yes'; >cfg.showlabels='yes'; >cfg.channelname='EEG26'; >singleplotER(cfg,fd); > >??? Reference to non-existent field 'foi'. > >Error in ==> singleplotER at 272 > plot(varargin{k-1}.(cfg.xparam), P, style); > >with regards >muthu > > > >From: Robert Oostenveld > >Reply-To: FieldTrip discussion list > >To: FIELDTRIP at NIC.SURFNET.NL > >Subject: Re: [FIELDTRIP] query on coherence source analysis > >Date: Thu, 1 Jun 2006 13:58:48 +0200 > > > >Dear Muthuraman > > > >I have not been able to reproduce your error. I suggest that you get the > >latest version of FieldTrip from our FTP server and try again. > > > >best egards, > >Robert > > > >PS this is the test script I used. It uses some simulated data, which > >again uses a MEG gradiometer definition and a head model from the >tutorial > > >data. > > > > > >----------------- > >% read some data that is required to simulate MEG data, i.e. volume >model, > >% sensor positions and MRI (optional, only for plotting) > >vol = read_ctf_hdm('Subject01.hdm'); > >hdr = read_fcdc_header('Subject01.ds/Subject01.res4'); > >grad = hdr.grad; > > > >% construct the simulated MEG data for condition A ("active") > >cfg = []; > >cfg.vol = vol; > >cfg.grad = grad; > >cfg.fsample = 300; > >cfg.ntrials = 2; > >cfg.triallength = 1; > >cfg.dip.pos = [0 7 8]; > >cfg.dip.mom = [1 0 0]; > >cfg.dip.signal = sin(2*pi*10*(1:cfg.fsample)./cfg.fsample); > >cfg.absnoise = 1e-8; > >data = dipolesimulation(cfg); > > > >% add the source signal as fake EMG channel > >for i=1:cfg.ntrials > > data.trial{i}(end+1,:) = cfg.dip.signal + randn(size >(cfg.dip.signal)); > >end > >data.label{end+1} = 'EMG'; > > > >cfg=[]; > >cfg.output='powandcsd'; > >cfg.method='mtmwelch'; > >cfg.foi=1:2:30; > >numfoi = length(cfg.foi); > >cfg.taper='hanning'; > >cfg.t_ftimwin=zeros(1,numfoi); > >cfg.t_ftimwin(:)=0.5; > >cfg.channel=channelselection({'MEG' 'EMG'},data.label); > >cfg.channelcmb={'MEG' 'EMG'}; > >freq=freqanalysis(cfg,data); > > > > > > From linpe at NINDS.NIH.GOV Thu Jun 15 22:08:19 2006 From: linpe at NINDS.NIH.GOV (Lin, Peter (NIH/NINDS) [E]) Date: Thu, 15 Jun 2006 16:08:19 -0400 Subject: No subject Message-ID: I am trying to import neuroscan data into fieldtrip for analysis. I tried using eeglab to load my epoch's neuroscan file and then used the eeglab2fieldtrip command on the EEG structure to generate a new data file. My question is how to process the data further using the frequencyanalysis method. >>[data]=eeglab2fieldtrip(EEG,'preprocessing') data = label: {1x64 cell} fsample: 1000 elec: [1x1 struct] trial: {1x224 cell} time: {1x224 cell} cfg: [1x1 struct] I'm wondering if my created data file is not correct. Any help on how to proceed would be great. Thanks, Peter Peter Lin, MD Clinical Fellow, Human Motor Control Section Phone: 301-402-0703 email: linpe at ninds.nih.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Fri Jun 16 09:05:50 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 16 Jun 2006 09:05:50 +0200 Subject: No subject In-Reply-To: Message-ID: Dear Peter, As far as I can see, the data looks OK. At least it contains the fields subsequent analysis steps need to know. However, I cannot judge the content of these fields, but there's no reason to assume that's not fine. To proceed, I would first advice you to have a look at the fieldtrip website. If you follow the link documentation, and then tutorial-documentation, there's already some stuff regarding frequency analysis. Moreover, the website also contains the documentation of all fieldtrip functions, which you can also access from the matlab command line, by typing help functionname. For example, try help freqanalysis, or help freqanalysis_mtmconvol. There's already quite some information in there, as well as all the options you can play with. Good luck Jan-mathijs _____ From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Lin, Peter (NIH/NINDS) [E] Sent: Thursday, June 15, 2006 10:08 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] I am trying to import neuroscan data into fieldtrip for analysis. I tried using eeglab to load my epoch's neuroscan file and then used the eeglab2fieldtrip command on the EEG structure to generate a new data file. My question is how to process the data further using the frequencyanalysis method. >>[data]=eeglab2fieldtrip(EEG,'preprocessing') data = label: {1x64 cell} fsample: 1000 elec: [1x1 struct] trial: {1x224 cell} time: {1x224 cell} cfg: [1x1 struct] I'm wondering if my created data file is not correct. Any help on how to proceed would be great. Thanks, Peter Peter Lin, MD Clinical Fellow, Human Motor Control Section Phone: 301-402-0703 email: linpe at ninds.nih.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jan.Schoffelen at FCDONDERS.RU.NL Fri Jun 16 09:15:15 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 16 Jun 2006 09:15:15 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: Dear Muthuraman, At first glance I don't have a clue what's going on. Did you have a look into fd.powspctrm, and fd.cohspctrm? Does it contain normal numbers, zeros, or nan? It might be a bug in freqanalysis_mtmwelch. Did you try out other methods, to be specified in cfg.method? If yes, did this also give strange results? If no, could you try out cfg.method = 'mtmconvol' instead of 'mtmwelch'? Please have a look at the documentation which additional options you have to specify. What matlab-version do you use? Do you use the latest fieldtrip-version? One additional thing: please note that you specified the odd frequencies 1:2:29, whereas your time-window is half a second wide. These are not optimal settings, since the frequency-resolution of your time-window is 2 Hz. This means that your time-window never contains an integer amount of cycles of the frequency you want to estimate. This might lead to strange results, though I don't think it has anything to do with your present problem. However, I would use cfg.freq = 2:2:30 in combination with a time-window of 0.5 s Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Muthuraman Muthuraman Sent: Thursday, June 15, 2006 4:00 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] query on coherence analysis Hello Thankyou for the previous help it works now i am able to proceed further to calculate the coherence The problem now the coherence obtained using the mtmwelch when i plot the coherence figures for the channels all the coherence figures for the different channel looks the same is there is a bug in how i am calculating the coherence These are the steps i carried out in calculating the coherence headerfile='pd_mof_tr0_c_0306.cnt'; hdr = read_fcdc_header(headerfile); cfg.trl = []; for i=1:floor(hdr.nSamples/hdr.Fs) cfg.trl(i,1) = (i-1)*hdr.Fs + 1; cfg.trl(i,2) = (i )*hdr.Fs; cfg.trl(i,3) = 0; end cfg.headerfile=headerfile; >>cfg.datafile=headerfile; >>[data] = preprocessing(cfg); -and after the data is preprocessed i change the channel labels from actual cz to eeg26 and so on cfg=[]; cfg.output='powandcsd'; cfg.method='mtmwelch'; cfg.foi=1:2:30; numfoi = length(cfg.foi); cfg.taper='hanning'; cfg.t_ftimwin=zeros(1,numfoi); cfg.t_ftimwin(:)=0.5; cfg.channel=channelselection({'EEG' 'EMG2'},data.label); cfg.channelcmb={'EEG' 'EMG2'}; freq=freqanalysis(cfg,data); -when i calculate using freqanalysis i get these warnings 1.000 Hz : WARNING - using only one taper for specified smoothing Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 360 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 and so on till 30.000 hz -and while processing processing trial 2: 1000 samples Warning: Size vector should be a row vector with integer elements. >In freqanalysis_mtmconvol at 398 In freqanalysis at 182 In freqanalysis_mtmwelch at 67 In freqanalysis at 182 fd=freqdescriptives([],freq); cfg=[]; cfg.xparam='freq'; cfg.yparam='cohspctrm'; cfg.xlim=[3 30]; cfg.cohrefchannel='EMG2'; cfg.box='yes'; cfg.showlabels='yes'; cfg.channelname='EEG27'; singleplotER(cfg,fd); -when i try to plot i get this error ??? Error using ==> char Cell elements must be character arrays. Error in ==> singleplotER at 326 t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; please , look at it and help me in this regard thanking you with regards muthuraman From r.oostenveld at FCDONDERS.RU.NL Fri Jun 16 10:39:48 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 16 Jun 2006 10:39:48 +0200 Subject: source positions - brain regions In-Reply-To: <5E221385-C805-4FFA-BE76-F2C0DF9BEE72@mac.com> Message-ID: hi Nathan On 15 Jun 2006, at 11:42, Nathan Weisz wrote: > however now i'm a little bit stuck. from here, what is the best > method of finding out which dipoles correspond (very roughly) to > which brain regions, so i can extract specifically those to look at > the sourcewaveforms? unfortunatley no mri. > I am aware of the sourceplot function, but was uncapable of > producing a meaningful output. So far it seems ok. The headmodel is in cm, the electrodes as well (I presume, otherwise it would have given warnings and/or errors), so the source locations are also expressed in cm, since they are expresed in the same coordinate system. I suggest that you have a look at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_are_the_differ ent_head_and_mri_coordinate_systems_defined to get a better understanding in general. What we normally do in such a case is to use an indivudual headmodel, and what we thus subsequently would do is to take an anatomical MRI of the same subject, in which the MRI is aligned to the same head/ model coordinate system (using the ears and nose fiducials). Since you do not have a MRI, you could take a standard MRI (i.e. the MNI template in single_subj_T1 from SPM). Some time ago I (or Arno) posted a homogenous transformation matrix "besa2spm" on the eeglab mailing list (*). That homogenous transformation matrix transforms from besa coordinates for a spherical model to MNI coordinates. besa2spm = [ 0.0101 -0.9400 0 0.5588 1.1889 0.0080 0.0530 -18.0041 -0.0005 -0.0000 1.1268 1.8045 0 0 0 1.0000 ]; spm2besa = inv(besa2spm); The transformation matrix is for the "besa" spherical model in EEGLAB, which has different sphere radii (85mm outer sphere) than you have used. So you should add a scaling from the besa radii to yours. your2besa = eye(4); your2besa(1,1) = 8.5/12; your2besa(2,2) = 8.5/12; your2besa(3,3) = 8.5/12; then your2spm = besa2spm * your2besa spm2your = inv(your2spm); It is most convenient to apply the inverse transformation to the MRI corodinate system. I.e. do mri = read_fcdc_mri('single_subj_T1.mnc') then mri.transform describes the voxels in SPM/MNI coordinates, so mri.transform = spm2your * mri.transform; changes the anatomical MRI into your headmodel coordinates. Subsequently you can interpolate the functional values onto the anaomtical voxel locations with SOURCEINTERPOLATE, and plot the functional values overlaid over the anatomical with SOURCEPLLOT or SLICEINTERP. best regards, Robert PS (*) the besa2spm coordinate transformation matrix was constructed using ELECTORDENORMAMALIZE, which warps electrodes. In this case the spherical 1020 electrodes were warped to the corresponding electrodes in the MNI template. The homogenous transformation matrix describes the warp/deformation and can be used as well for the dipoles inside the head. From jurij.dreo at GUEST.ARNES.SI Sat Jun 17 12:18:26 2006 From: jurij.dreo at GUEST.ARNES.SI (Jurij Dreo) Date: Sat, 17 Jun 2006 11:18:26 +0100 Subject: Statistics for coherence in a within-subject experiment Message-ID: Hello, I am using BESA to perform coherence and source coherence calculations for a multiple-subject/multiple-condition experiment. In the experiment I have 11 subjects, 6 conditions and around 30 sets per condition per subject. In BESA the data was preprocessed and the coherence values in the Time-Frequency domain were calculated for each person. As BESA has no capabilities to calculate statistics in a multiple- subject study, their support personnel directed me towards FieldTrip. I´ve been looking over the documentation and tutorials on your web page and also downloaded the scrip and ran it in matlab. The tutorial on Cluster-Lever randomization Tests for the Time- Frequency domain is quite straight-forward. I am however not quite sure which statistic to use for the cfg.statistic variable to analyze coherence in a within-subject study such as the one I have. The documentation on the cfg.statistic variable says it can have these values: 1. indepsamplesT' (independent samples T-statistic) 2. 'indepsamplesregrT' (independent samples regression coefficient T- statistic) 3. 'indepsamplesZcoh' (independent samples Z-statistic for coherence) 4. 'indepsamplesTsqcrs' (independent samples T-square-statistic for the cross-spectrum) 5. 'depsamplesT' (dependent samples T-statistic) 6. 'actvsblT' (activation versus baseline T-statistic) 7. 'depsamplesregrT' (dependent samples regression coefficient T- statistic) 8. 'indepsamplesF' (independent samples F-statistic) 9. 'depsamplesF' (dependent samples F-statistic) I am not sure if any of these options are compatible with a within- subject multiple condition coherence statistical analysis. option 3. - indepsamplesZcoh is obviously only suitable for a between- trial, two-condition experiment and there are no other options that explicitally say they are used for coherence. So how can one compare 6 conditions for 11 subjects with regards to coherence if one imports the Time-Frequency domain data for each person into FieldTrip? Thank you for your help! Regards, Jurij Dreo From r.oostenveld at FCDONDERS.RU.NL Mon Jun 19 16:18:55 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 19 Jun 2006 16:18:55 +0200 Subject: Statistics for coherence in a within-subject experiment In-Reply-To: <20060617_091826_063328.jurij.dreo@guest.arnes.si> Message-ID: Hi Jurij > option 3. - indepsamplesZcoh is obviously only suitable for a between- > trial, two-condition experiment Yes, that is for testing coherence differences between two conditions within one subject. > and there are no other options that explicitally say they are used > for coherence. > > So how can one compare 6 conditions for 11 subjects with regards to > coherence if one imports the Time-Frequency domain data for each > person into FieldTrip? In your case you have observed a "value" in 11 subjects, over 6 conditions. That value happens to be coherence, but could as well have been something else. Since you have manipulated the conditions with each subject, you can use a dependent-samples test: the observed values depend on the subject (an example of a dependent-samples test is a paired-t test). If the number of trials varies between subjects and/or sessions, it will be preferable to transform your coherence values to z-scores manually prior to submitting the values to clusterrandanalysis. Now about the 6 conditions, am I right that you have a 1x6 factorial design, or is there more strucure in the design? Do you have a specific hypothesis about the different conditions? If you only want to reject the null-hypothesis "the observed value (coherence) is the same (more accurately: stems from the same distribution) in all my 6 conditions", you would use an omnibus F-statistic, i.e. 'depsamplesF'. It might be that your hypothesis is more specific, or also in case you find an omnibus effect, then you would probably want to perform explicit tests between two subsets of your 6 conditions using a 'depsamplesT' test. best regards, Robert From jurij.dreo at GUEST.ARNES.SI Mon Jun 19 17:31:46 2006 From: jurij.dreo at GUEST.ARNES.SI (Jurij Dreo) Date: Mon, 19 Jun 2006 17:31:46 +0200 Subject: Statistics for coherence in a within-subject experiment Message-ID: Hello! Thank you for your answers. Here are my replies to them: To avoid any misunderstandings here is again a summary of my study design - I have 11 subjects. - Each of them performed 6 tasks related to working memory. - Each subject performed anywehere from 25 to 60 repeats (trial) of each condition (the standard number of trials per task was 30 - but some subjects performed the entire experiment twice (ergo 60 potential trials) .... and in some some of their trials are unusable - artifacts ... ergo 25 min number of possible trials) Given my study design I thought something like a one-way ANOVA for correlated samples would be in order. (as I am comparing 6 conditions within-subjects as every subject performed all sets) ----------------- > In your case you have observed a "value" in 11 subjects, over 6 > conditions. That value happens to be coherence, but could as well > have been something else. Since you have manipulated the conditions > with each subject, you can use a dependent-samples test: the observed > values depend on the subject (an example of a dependent-samples test > is a paired-t test). ------------------- I´m not sure what you are saying here.... I agree with the dependent samples idea... but I cannot preform a t-test ... ie. more of them as that would inflate my p-rate overall. I thought that I would first do an ANOVA and then something like the Tukey HSD Test to cimpare individual conditions -------------------- > If the number of trials varies between subjects and/or sessions, it > will be preferable to transform your coherence values to z-scores > manually prior to submitting the values to clusterrandanalysis. -------------------- Yes I agree that would need to be done manually. ----------- > Now about the 6 conditions, am I right that you have a 1x6 factorial > design, or is there more strucure in the design? Do you have a > specific hypothesis about the different conditions? If you only want > to reject the null-hypothesis "the observed value (coherence) is the > same (more accurately: stems from the same distribution) in all my 6 > conditions", you would use an omnibus F-statistic, i.e. > 'depsamplesF'. It might be that your hypothesis is more specific, or > also in case you find an omnibus effect, then you would probably want > to perform explicit tests between two subsets of your 6 conditions > using a 'depsamplesT' test. > ---------- I want to contrast all conditions at once (f -test anova) AND also each combination of conditions (say a post- ANOVA Q-test) But Im still not sure which statistic to use and even if the one I use will be able to deal with the fact that I have a different number of conditions per condition per subject As far as I understand it... we must use some kind of ANOVA here... A simple "paired" t-test will not do... as we are comparing more than 2 conditions at once and I do not want to inflate my p-rate. Thank you for your help! Regards, Jurij Dreo -------------- next part -------------- An HTML attachment was scrubbed... URL: From muthuraman10 at HOTMAIL.COM Tue Jun 20 10:40:17 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Tue, 20 Jun 2006 08:40:17 +0000 Subject: query on coherence analysis Message-ID: Hello Jan The answers for the questions you have asked and also i have attached some figures with this mail 1-using welch periodogram method 2-using fieldtrip 'mtmfft' 3-using fieldtrip 'mtmwelch' Did you have a look into fd.powspctrm, and fd.cohspctrm? -yes,both look the same so something is surely going wrong Does it contain normal numbers, zeros, or nan? -yes, it has normal numbers but the vlaues are from 1.0 to 10.0 not as normal in the case of 0.1 to 1 in coherence spectrum Did you try out other methods, to be specified in cfg.method? -yes using 'mtmfft' i have attached the figure in the mail in which i dont get the correct frequency content and the values are less -In the 'mtmwelch' method i get a error when i am plotting, even then i am able to see the figure ??? Error using ==> char Cell elements must be character arrays. Error in ==> singleplotER at 326 t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; -In the 'mtmconvol' i am not able to plot i get a error selected 60 channels for coherence ??? Error using ==> plot Vectors must be the same lengths. Error in ==> singleplotER at 272 plot(varargin{k-1}.(cfg.xparam), P, style); please go through it and give your comments and one more question for the source analysis what are the values we need,when i open the elec1010 there are four values x,y,z values and what is the fourth value with regards muthu >From: Jan Mathijs Schoffelen >Reply-To: FieldTrip discussion list >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis >Date: Fri, 16 Jun 2006 09:15:15 +0200 > >Dear Muthuraman, > >At first glance I don't have a clue what's going on. >Did you have a look into fd.powspctrm, and fd.cohspctrm? >Does it contain normal numbers, zeros, or nan? >It might be a bug in freqanalysis_mtmwelch. >Did you try out other methods, to be specified in cfg.method? >If yes, did this also give strange results? If no, could you try out >cfg.method = 'mtmconvol' instead of 'mtmwelch'? Please have a look at the >documentation which additional options you have to specify. >What matlab-version do you use? Do you use the latest fieldtrip-version? > >One additional thing: please note that you specified the odd frequencies >1:2:29, whereas your time-window is half a second wide. These are not >optimal settings, since the frequency-resolution of your time-window is 2 >Hz. This means that your time-window never contains an integer amount of >cycles of the frequency you want to estimate. This might lead to strange >results, though I don't think it has anything to do with your present >problem. However, I would use cfg.freq = 2:2:30 in combination with a >time-window of 0.5 s > >Yours, > >Jan-Mathijs > >-----Original Message----- >From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf >Of Muthuraman Muthuraman >Sent: Thursday, June 15, 2006 4:00 PM >To: FIELDTRIP at NIC.SURFNET.NL >Subject: Re: [FIELDTRIP] query on coherence analysis > >Hello > >Thankyou for the previous help it works now >i am able to proceed further to calculate the coherence > >The problem now the coherence obtained using the mtmwelch >when i plot the coherence figures for the channels >all the coherence figures for the different channel looks the same >is there is a bug in how i am calculating the coherence > >These are the steps i carried out in calculating the coherence > >headerfile='pd_mof_tr0_c_0306.cnt'; >hdr = read_fcdc_header(headerfile); >cfg.trl = []; >for i=1:floor(hdr.nSamples/hdr.Fs) > cfg.trl(i,1) = (i-1)*hdr.Fs + 1; > cfg.trl(i,2) = (i )*hdr.Fs; > cfg.trl(i,3) = 0; >end > >cfg.headerfile=headerfile; > >>cfg.datafile=headerfile; > >>[data] = preprocessing(cfg); > >-and after the data is preprocessed i change the channel labels from actual >cz to eeg26 and so on > > > >cfg=[]; >cfg.output='powandcsd'; >cfg.method='mtmwelch'; >cfg.foi=1:2:30; >numfoi = length(cfg.foi); >cfg.taper='hanning'; >cfg.t_ftimwin=zeros(1,numfoi); >cfg.t_ftimwin(:)=0.5; >cfg.channel=channelselection({'EEG' 'EMG2'},data.label); >cfg.channelcmb={'EEG' 'EMG2'}; >freq=freqanalysis(cfg,data); > > >-when i calculate using freqanalysis i get these warnings > >1.000 Hz : WARNING - using only one taper for specified smoothing >Warning: Size vector should be a row vector with integer elements. > >In freqanalysis_mtmconvol at 360 > In freqanalysis at 182 > In freqanalysis_mtmwelch at 67 > In freqanalysis at 182 >and so on till 30.000 hz > >-and while processing > >processing trial 2: 1000 samples >Warning: Size vector should be a row vector with integer elements. > >In freqanalysis_mtmconvol at 398 > In freqanalysis at 182 > In freqanalysis_mtmwelch at 67 > In freqanalysis at 182 > > > >fd=freqdescriptives([],freq); > > >cfg=[]; >cfg.xparam='freq'; >cfg.yparam='cohspctrm'; >cfg.xlim=[3 30]; >cfg.cohrefchannel='EMG2'; >cfg.box='yes'; >cfg.showlabels='yes'; > >cfg.channelname='EEG27'; >singleplotER(cfg,fd); >-when i try to plot i get this error >??? Error using ==> char >Cell elements must be character arrays. > >Error in ==> singleplotER at 326 > t=[char(cfg.channelname) ' / ' num2str(cfg.channelindex) ]; > > >please , look at it and help me in this regard > >thanking you >with regards >muthuraman -------------- next part -------------- A non-text attachment was scrubbed... Name: Welch Periodogram Method.fig Type: application/octet-stream Size: 20550 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Fieldtrip-'mtmfft'.fig Type: application/octet-stream Size: 21189 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Fieltrip-'mtmwelch'.fig Type: application/octet-stream Size: 3635 bytes Desc: not available URL: From Jan.Schoffelen at FCDONDERS.RU.NL Wed Jun 21 11:31:07 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Wed, 21 Jun 2006 11:31:07 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: >the other question i have asked in the previous mail >i would like to do the source analysis >and the values specified in for ex:elec1010 >it has four values and the channel label >the first three values are x,y,z position values >what is the fourth value? Dear Muthuraman, Please have a look at the FAQ-section of the fieldtrip-website. It is explained what is specified in the layout-files. Yours, Jan-M From Jan.Schoffelen at FCDONDERS.RU.NL Wed Jun 21 12:32:15 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Wed, 21 Jun 2006 12:32:15 +0200 Subject: query on coherence analysis In-Reply-To: Message-ID: Dear Muthuraman, Please find attached a script and a figure. I compared the 'mtmfft' with 'mtmwelch', and the results look very similar. I did not test the 'mtmconvol' method, since this function is called when you specify 'mtmwelch'. I guess you have to check your configuration in that respect. I would say that the code is doing what it should do. Please make sure that you use the latest fieldtrip-version. Yours, Jan-Mathijs -----Original Message----- From: Muthuraman Muthuraman [mailto:muthuraman10 at hotmail.com] Sent: Wednesday, June 21, 2006 11:05 AM To: Jan.Schoffelen at fcdonders.ru.nl Subject: RE: [FIELDTRIP] query on coherence analysis Hello Jan Thanks for the suggestions I have tried 'mtmconvol' and also plotting using singleplotTFR the figure looks totally blue i have attached the figure with this mail for the same channel combination Figure-mtmconvol and also i have uploaded two files one is the CNT file of a patient and the other file is data structure after preprocessing and changing the channel label If u have any different results from the data please let me know my aim is to do the coherence analysis followed by the source analysis using 'DICS' the other question i have asked in the previous mail i would like to do the source analysis and the values specified in for ex:elec1010 it has four values and the channel label the first three values are x,y,z position values what is the fourth value? thanking you with regards muthu -------------- next part -------------- A non-text attachment was scrubbed... Name: muthu.fig Type: application/octet-stream Size: 1881 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: muthu.m Type: application/octet-stream Size: 1772 bytes Desc: not available URL: From srampp at TISCALI.DE Wed Jun 21 23:07:50 2006 From: srampp at TISCALI.DE (Stefan Rampp) Date: Wed, 21 Jun 2006 23:07:50 +0200 Subject: Missing minimumnormestimate etc Message-ID: Hi everyone, I was just trying to do source localization of epilepsy MEG data using mne, however, it appears that some functions are missing: minimumnormestimate, music, loreta and rv are used in sourceanalysis.m, but I can't find the implementations (and neither can matlab). Do I need to download additional libraries/toolboxes? Thank you, Stefan Rampp. Epilepsycenter Erlangen Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.montez at VUMC.NL Thu Jun 22 01:27:29 2006 From: t.montez at VUMC.NL (Montez, T.) Date: Thu, 22 Jun 2006 01:27:29 +0200 Subject: channel location file to import planar to EEGLAB Message-ID: Dear Fieldtripers, I am using EEGLAB to compute ICA of CTF 151 channels data. I used to read the data in EEGLAB directly from the CTF format, but some components are affected by the bad channels. Since removing the bad channels will reduce the number of components and will give problems later at the planar transformation; I tried using megrepair first and then importing the matlab array of data.trial{1}. I use the channel locations of a previous dataset opened from the CTF format. - I still get some components reflecting the bad channels, should I increase the cfg.neighbourdist? (I was using the default of 4 cm). - To import the data after the planar transformation I need a channel location file for the dH and dV pairs, can you help me with that? Thanks in advance, Teresa Montez -------------- next part -------------- An HTML attachment was scrubbed... URL: From srampp at TISCALI.DE Thu Jun 22 01:51:25 2006 From: srampp at TISCALI.DE (Stefan Rampp) Date: Thu, 22 Jun 2006 01:51:25 +0200 Subject: channel location file to import planar to EEGLAB Message-ID: channel location file to import planar to EEGLABDear Teresa, I can't really provide much info regarding your first question, however, I might be able to help you with the second: Have you applied 'combineplanar' after the planar transformation? This will combine the dH and dV pairs into one channel per pair, e.g. cfg = []; combplan = combineplanar(cfg, plan); were plan is the planar transformed data set. combineplanar allows to choose the method for combination of the pairs. For further details, you might want to have a look at the tutorial about event related averaging: http://www2.ru.nl/fcdonders/fieldtrip/doku.php?id=fieldtrip:documentation:tutorial:eventrelatedaveraging Sincerely, Stefan Rampp Epilepsycenter Erlangen Germany. ----- Original Message ----- From: Montez, T. To: FIELDTRIP at NIC.SURFNET.NL Sent: Thursday, June 22, 2006 1:27 AM Subject: [FIELDTRIP] channel location file to import planar to EEGLAB Dear Fieldtripers, I am using EEGLAB to compute ICA of CTF 151 channels data. I used to read the data in EEGLAB directly from the CTF format, but some components are affected by the bad channels. Since removing the bad channels will reduce the number of components and will give problems later at the planar transformation; I tried using megrepair first and then importing the matlab array of data.trial{1}. I use the channel locations of a previous dataset opened from the CTF format. - I still get some components reflecting the bad channels, should I increase the cfg.neighbourdist? (I was using the default of 4 cm). - To import the data after the planar transformation I need a channel location file for the dH and dV pairs, can you help me with that? Thanks in advance, Teresa Montez -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Thu Jun 22 09:25:56 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Jun 2006 09:25:56 +0200 Subject: Statistics for coherence in a within-subject experiment In-Reply-To: <000901c693b5$79d47c10$0200a8c0@laptop> Message-ID: Hi Jurij The parametric tests that you suggest are not implemented in FieldTrip. In the clusterrandanalysis function we use a randomization approach for statistical testing. It is a non-parametrical approach, and the test statistic consists of a parametrtical statistic per time- frequency-channel, which is clustered and summed over neighbouring timepoints/frequencies/channels. Not the single-sample statistic, but the clustersum is used for the statistical test, thereby increasing sensitivity and controlling for multiple comparisons. The single sample (time-frequency-channel) statistic has to be chosen to match with the experimental design (e.g. F or F) and the randomization/ permutation of the data between the subjects and conditions has to be adequate (in your case you want to shuffle data between conditions but only within each subject). That determines the statistic to use. I suggest that you go over the clusterrandanalysis tutorial at http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial:clusterrandanalysis best regards, Robert On 19 Jun 2006, at 17:31, Jurij Dreo wrote: > Hello! > > Thank you for your answers. Here are my replies to them: > > To avoid any misunderstandings here is again a summary of my study > design > - I have 11 subjects. > - Each of them performed 6 tasks related to working memory. > - Each subject performed anywehere from 25 to 60 repeats (trial) of > each condition (the standard number of trials per task was 30 - but > some subjects performed the entire experiment twice (ergo 60 > potential trials) .... and in some some of their trials are > unusable - artifacts ... ergo 25 min number of possible trials) > > Given my study design I thought something like a one-way ANOVA for > correlated samples would be in order. > (as I am comparing 6 conditions within-subjects as every subject > performed all sets) > > > ----------------- > > In your case you have observed a "value" in 11 subjects, over 6 > > conditions. That value happens to be coherence, but could as well > > have been something else. Since you have manipulated the conditions > > with each subject, you can use a dependent-samples test: the > observed > > values depend on the subject (an example of a dependent-samples test > > is a paired-t test). > ------------------- > > I´m not sure what you are saying here.... I agree with the > dependent samples idea... but I cannot preform a t-test ... ie. > more of them as that would inflate my p-rate overall. > > I thought that I would first do an ANOVA and then something like > the Tukey HSD Test to cimpare individual conditions > > -------------------- > > If the number of trials varies between subjects and/or sessions, it > > will be preferable to transform your coherence values to z-scores > > manually prior to submitting the values to clusterrandanalysis. > -------------------- > Yes I agree that would need to be done manually. > > ----------- > > Now about the 6 conditions, am I right that you have a 1x6 factorial > > design, or is there more strucure in the design? Do you have a > > specific hypothesis about the different conditions? If you only want > > to reject the null-hypothesis "the observed value (coherence) is the > > same (more accurately: stems from the same distribution) in all my 6 > > conditions", you would use an omnibus F-statistic, i.e. > > 'depsamplesF'. It might be that your hypothesis is more specific, or > > also in case you find an omnibus effect, then you would probably > want > > to perform explicit tests between two subsets of your 6 conditions > > using a 'depsamplesT' test. > > > ---------- > > I want to contrast all conditions at once (f -test anova) AND also > each combination of conditions (say a post- ANOVA Q-test) > > But Im still not sure which statistic to use and even if the one I > use will be able to deal with the fact that I have a different > number of conditions per condition per subject > > As far as I understand it... we must use some kind of ANOVA here... > A simple "paired" t-test will not do... as we are comparing more > than 2 conditions at once and I do not want to inflate my p-rate. > > Thank you for your help! > > Regards, > Jurij Dreo > From r.oostenveld at FCDONDERS.RU.NL Thu Jun 22 09:31:10 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Jun 2006 09:31:10 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <006c01c69576$c1d13270$14b2a8c0@mirandola> Message-ID: Dear Stefan, The SOURCEANALYSIS function is used as wrapper for various distributed or scanning inverse approaches, and DIPOLEFITTING is used for underdetermined model fitting to the data. The only underlying functions for SOURCEANALYSIS that are released on the ftp server are the lcmv and the dics beamformer methods. The functions that you refer to are implemented in our in-house version of FieldTrip but have not been tested thouroughly. I can give you a pre-release if you are willing to aid in the testing of those functions. best regards, Robert On 21 Jun 2006, at 23:07, Stefan Rampp wrote: > Hi everyone, > > I was just trying to do source localization of epilepsy MEG data > using mne, however, it appears that some functions are missing: > minimumnormestimate, music, loreta and rv are used in > sourceanalysis.m, but I can't find the implementations (and neither > can matlab). Do I need to download additional libraries/toolboxes? > > Thank you, > Stefan Rampp. > Epilepsycenter Erlangen > Germany > From r.oostenveld at FCDONDERS.RU.NL Thu Jun 22 09:40:31 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 22 Jun 2006 09:40:31 +0200 Subject: channel location file to import planar to EEGLAB In-Reply-To: <28FF6B8D22C94B44A55E4E1325A94AF2348059@vumc-mb02.vumc.nl> Message-ID: Hi Theresa On 22 Jun 2006, at 1:27, Montez, T. wrote: > I am using EEGLAB to compute ICA of CTF 151 channels data. > > I used to read the data in EEGLAB directly from the CTF format, > but some components are affected by the bad channels. The bad channels do not reflect a linear mixture of underlying sources, therefore you should remove them prior to ICA. You should also remove all trials containing anomalous artifacts. > Since removing the bad channels will reduce the number of components > and will give problems later at the planar transformation; > I tried using megrepair first and then importing the matlab array > of data.trial{1}. I use the channel locations of a previous > dataset opened from the CTF format. MEGREPAIR uses a nearest-neighbour approach for fixing the missing channels. The "repaired" channels are linear combinations (i.e. a linear mixture) of the neighbours and hence do not add any information (i.e. components) to the data, doing ICA on the repaired dataset does not give you all 151 components. > - I still get some components reflecting the bad channels, > should I increase the cfg.neighbourdist? > (I was using the default of 4 cm). > > - To import the data after the planar transformation I need > a channel location file for the dH and dV pairs, > can you help me with that? The planar transformation in MEGPLANAR also results in a linear estimation of the horizontal and vertical gradients, i.e. if you start with 151 axial channels and you do MEGPLANAR, you will have 302 planar channels, but the dimensionality of that data will still be 151. That means that ICA on the 302-channel planar data will result in a maximum of 151 components. I suggest to do the ICA on the axial data with the bad channels removed. Subsequently you can switch from EEGLAB to FieldTrip and compute the planar representation of the ICA components using the MEGPLANAR function (I am not sure whether megplanar knows how to deal with ICA data, but it is easy to convert the ICA data into something that resembles an average ERF or alternatively to add support for the ICA data in megplanar). best regards, Robert From srampp at TISCALI.DE Thu Jun 22 10:43:01 2006 From: srampp at TISCALI.DE (Stefan Rampp) Date: Thu, 22 Jun 2006 10:43:01 +0200 Subject: Missing minimumnormestimate etc Message-ID: Dear Robert, Thank you for the fast answer. Since I'm interested in comparing various methods, I'd greatly appreciate a pre-release version. And of course I could contribute to Fieldtrip as a betatester for these functions like that. Sincerely, Stefan Rampp Epilepsycenter Erlangen Germany ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Thursday, June 22, 2006 9:31 AM Subject: Re: [FIELDTRIP] Missing minimumnormestimate etc > Dear Stefan, > > The SOURCEANALYSIS function is used as wrapper for various distributed or > scanning inverse approaches, and DIPOLEFITTING is used for > underdetermined model fitting to the data. The only underlying functions > for SOURCEANALYSIS that are released on the ftp server are the lcmv and > the dics beamformer methods. The functions that you refer to are > implemented in our in-house version of FieldTrip but have not been tested > thouroughly. I can give you a pre-release if you are willing to aid in > the testing of those functions. > > best regards, > Robert > > > On 21 Jun 2006, at 23:07, Stefan Rampp wrote: > >> Hi everyone, >> >> I was just trying to do source localization of epilepsy MEG data using >> mne, however, it appears that some functions are missing: >> minimumnormestimate, music, loreta and rv are used in sourceanalysis.m, >> but I can't find the implementations (and neither can matlab). Do I need >> to download additional libraries/toolboxes? >> >> Thank you, >> Stefan Rampp. >> Epilepsycenter Erlangen >> Germany >> From MZvyagintsev at UKAACHEN.DE Thu Jun 22 18:08:43 2006 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Thu, 22 Jun 2006 18:08:43 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <21EE19CF-BE60-4719-BC9E-C1F3737F26B5@fcdonders.ru.nl> Message-ID: Dear Robert, Would be also nice to have an implementaion of LORETA approach for source analysis from your in-house software. I would appreciate if you could send it to me as well. Best regards, Mikhail Zvyagintsev MZvyagintsev at UKAachen.de Robert Oostenveld wrote: > Dear Stefan, > > The SOURCEANALYSIS function is used as wrapper for various > distributed or scanning inverse approaches, and DIPOLEFITTING is used > for underdetermined model fitting to the data. The only underlying > functions for SOURCEANALYSIS that are released on the ftp server are > the lcmv and the dics beamformer methods. The functions that you > refer to are implemented in our in-house version of FieldTrip but > have not been tested thouroughly. I can give you a pre-release if you > are willing to aid in the testing of those functions. > > best regards, > Robert From muthuraman10 at HOTMAIL.COM Fri Jun 23 12:54:57 2006 From: muthuraman10 at HOTMAIL.COM (Muthuraman Muthuraman) Date: Fri, 23 Jun 2006 10:54:57 +0000 Subject: query on CTF software!!! Message-ID: Hello For the Beamformer source analysis, do we need the CTF software because when i am trying out the tutorial in beamforming Matlab >>freq=19.0; >>Ncycles=10; >>dTimeWin=Ncycles/freq; >>cfg=[]; >>cfg.dataset='Subject01.ds'; >>cfg.channel={'MEG' 'STIM'}; >>cfg.trialdef.excludeConditions={'BAD'}; >>cfg.trialdef.includeTrigger=3; >>cfg.trialdef.prestim=0.1+dTimeWin; >>cfg.trialdef.poststim=-0.1; >>datapre=preprocessing(cfg); CTF_READ_RES4 [v 1.12] ....done ( 0.67 sec) i get the error ??? Error using ==> read_fcdc_header could not read CTF res4 header file Error in ==> preprocessing at 263 hdr = read_fcdc_header(cfg.headerfile); with regards muthu From r.oostenveld at FCDONDERS.RU.NL Fri Jun 23 15:23:22 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 23 Jun 2006 15:23:22 +0200 Subject: query on CTF software!!! In-Reply-To: Message-ID: dear Muthuraman On 23 Jun 2006, at 12:54, Muthuraman Muthuraman wrote: > For the Beamformer source analysis, do we need the CTF software > because when i am trying out the tutorial in beamforming You do not need the ctf software to follow the tutorial. The tutorial is based however on a ctf MEG dataset. > CTF_READ_RES4 [v 1.12] > ....done ( 0.67 sec) > > i get the error > > ??? Error using ==> read_fcdc_header > could not read CTF res4 header file > > Error in ==> preprocessing at 263 > hdr = read_fcdc_header(cfg.headerfile); Based on your error I suspect that matlab/fieldtrip cannot find the dataset that you are trying to analyze, or that you matlab path is incorrect. The function "CTF_READ_RES4" is not supposed to be called (it is part of the NIH ctf import routines, e.g. used in EEGLAB), since the default private/read_ctf_res4.m function can deal with the tutorial dataset just fine. Please look into the code of read_fcdc_header (using the matlab debugger) to figure out what your exact problem is. best Robert From r.oostenveld at FCDONDERS.RU.NL Fri Jun 23 15:28:03 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 23 Jun 2006 15:28:03 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <449AC08B.4080202@UKAachen.de> Message-ID: Dear Mikhail My loreta implementation still has some problems and is not 100% correct. I first want to fix it before I release it. If you know how to work with KEY-LORETA (the software from Pasqual Marqui) and could compare the two implementations, you could get a pre-release version and help fix the bugs. Robert On 22 Jun 2006, at 18:08, Mikhail Zvyagintsev wrote: > Dear Robert, > > Would be also nice to have an implementaion of LORETA approach for > source analysis from your in-house software. I would appreciate if > you could send it to me as well. > > Best regards, > > Mikhail Zvyagintsev > > MZvyagintsev at UKAachen.de From MZvyagintsev at UKAACHEN.DE Mon Jun 26 13:15:34 2006 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Mon, 26 Jun 2006 13:15:34 +0200 Subject: Missing minimumnormestimate etc In-Reply-To: <29758FB9-8B0E-4C41-8067-BF39410560A0@fcdonders.ru.nl> Message-ID: Dear Robert, Thank you for this encouragement. I was working with LORETA from Pasqual Marqui only with EEG data. I hope it will help me to be useful with fixing bugs. Kindly, Mikhail. MZvyagintsev at UKAachen.de Robert Oostenveld wrote: > Dear Mikhail > > My loreta implementation still has some problems and is not 100% > correct. I first want to fix it before I release it. If you know how > to work with KEY-LORETA (the software from Pasqual Marqui) and could > compare the two implementations, you could get a pre-release version > and help fix the bugs. > > Robert From esther.meeuwissen at FCDONDERS.RU.NL Mon Jun 26 15:04:27 2006 From: esther.meeuwissen at FCDONDERS.RU.NL (Esther Meeuwissen) Date: Mon, 26 Jun 2006 15:04:27 +0200 Subject: artifact rejection Message-ID: Hi all, A few weeks ago I started to work with Fieldtrip. I would like use it to analyze EEG data. I have a question concerning preprocessing of EEG data. I would like to do a artifact rejection during preprocessing partly using the functions in fieldtrip (detection and rejection of muscle artifacts) and partly reading in artifact markers that are exported out of brain vision analyser (I used the raw data inspector to detect eye blinks). I used the following script: EEGchans = {'Fp2', 'F7', 'F3', 'Fz', 'F4', 'F8', 'FC5', 'FC1', 'FCz', 'FC2', 'FC6', 'T 7', 'C3', 'Cz', 'C4', 'T8', 'CP5', 'CP1', 'CP2', 'CP6', 'TP10', 'P7', 'P3', 'Pz', 'P4', 'P8', 'O1', 'O2'}; EOGchans = {'VB','HL', 'HR', 'VO'}; files = {'GOS10B'... 'GOS11C'}; for subject=1:2, % Parameters cfg = []; cfg.datafile = strcat('',files{subject},'.eeg'); cfg.headerfile = strcat('',files{subject},'.vhdr'); cfg.trialdef.trgfile = strcat('',files{subject},'.vmrk'); cfg.rejectfile = strcat('',files{subject},'_Reject.Marker'); cfg.icaresultfile = strcat('',files{subject},'.ica'); cfg.outdatafile = strcat('',files{subject},'.mat'); cfg.channel = {'all'}; cfg.padding = 1.5; cfg.bpfilter = 'yes'; cfg.bpfreq = [0.3 30]; cfg.blc = 'yes'; cfg.blcwindow = [-0.1 0.0]; % EEG options cfg.reref = 'no'; cfg.implicitref = []; cfg.refchannel = {}; % Trial definition cfg.trialdef.stim = [1 2 3 4]; cfg.trialdef.prestim = 0.200; cfg.trialdef.poststim = 1.000; % Artifact options (preprocessing) cfg.artfctdef.reject = 'complete'; cfg.artfctdef.muscle.sgn = EEGchans; cfg.artfctdef.muscle.feedback = 'no'; cfg.artfctdef.muscle.cutoff = 15; % Do preprocessing cfg = definetrial(cfg); cfg = artifact_muscle(cfg) cfg = rejectartifact(cfg); data = preprocessing(cfg); %Save intermediate result save(cfg.outdatafile,'data'); clear data; pack; end; and get the following error message: Error using ==> horzcat CAT arguments dimensions are not consistent. Error in ==> rejectartifact at 182 cfg.artfctdef.type = [{'file'} cfg.artfctdef.type]; Error in ==> preprocessing at 317 [cfg] = rejectartifact(cfg); Error in ==> preproesther1 at 45 data = preprocessing(cfg); By trying to make it work I figured out that it is possible to do both the artifact rejection parts separately using (parts of) the script above but (Fieldtrip wants to combine two matrices to 1 matrix and that is what goes wrong). Does anyone know how (/whether) it is possible to do a artifact detection/rejection in Fieldtrip partly using functions of Fieldtrip itself and partly read markers of EEG parts containing a artifact (the file made by brain vision analyzer)? Thanks in advance for the answer(s)! Esther Meeuwissen From r.oostenveld at FCDONDERS.RU.NL Mon Jun 26 17:17:49 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 26 Jun 2006 17:17:49 +0200 Subject: artifact rejection In-Reply-To: Message-ID: Hi Esther, On 26 Jun 2006, at 15:04, Esther Meeuwissen wrote: > and get the following error message: > > Error using ==> horzcat > CAT arguments dimensions are not consistent. > > Error in ==> rejectartifact at 182 > cfg.artfctdef.type = [{'file'} cfg.artfctdef.type]; I suspect here that cfg.artfctdef.type is a cell-array with strings represented as a vertical cell-vector, and that line 182 tries to combine it with something that Matlab treats as horizontal cell- vector. It is unclear to me why it does that, since the cfg.artfctdef.type is built up internally (you did not explicitely specify it). > Error in ==> preprocessing at 317 > [cfg] = rejectartifact(cfg); > > Error in ==> preproesther1 at 45 > data = preprocessing(cfg); > > By trying to make it work I figured out that it is possible to do > both the > artifact rejection parts separately using (parts of) the script > above but > (Fieldtrip wants to combine two matrices to 1 matrix and that is > what goes > wrong). Does anyone know how (/whether) it is possible to do a > artifact > detection/rejection in Fieldtrip partly using functions of Fieldtrip > itself and partly read markers of EEG parts containing a artifact (the > file made by brain vision analyzer)? I have tried replicating your problem (with the data that I found on / home/electromag/estmee/GOs/analyses/datagoed), but did not encounter any problems up to the definetrial, artifatc_muscle and rejectartifact. However, the problem comes only in when preprocessing is called. For backward compatibility with other peoples old scripts, preprocessing is also calling definetrial and rejhectartifact, and rejectartifact seems confused by being called twice. I made a small change to rejectartifact that hopefully fixes the problem. The updated version is on home/common now and will be on the ftp this evening. best regards, Robert From Esther.Meeuwissen at FCDONDERS.RU.NL Tue Jun 27 09:05:21 2006 From: Esther.Meeuwissen at FCDONDERS.RU.NL (Esther Meeuwissen) Date: Tue, 27 Jun 2006 09:05:21 +0200 Subject: artifact rejection In-Reply-To: <442FC113-07E9-4479-9237-6D20F1D026C8@fcdonders.ru.nl> Message-ID: Robert Oostenveld wrote: > Hi Esther, > > On 26 Jun 2006, at 15:04, Esther Meeuwissen wrote: >> and get the following error message: >> >> Error using ==> horzcat >> CAT arguments dimensions are not consistent. >> >> Error in ==> rejectartifact at 182 >> cfg.artfctdef.type = [{'file'} cfg.artfctdef.type]; > > I suspect here that cfg.artfctdef.type is a cell-array with strings > represented as a vertical cell-vector, and that line 182 tries to > combine it with something that Matlab treats as horizontal > cell-vector. It is unclear to me why it does that, since the > cfg.artfctdef.type is built up internally (you did not explicitely > specify it). > >> Error in ==> preprocessing at 317 >> [cfg] = rejectartifact(cfg); >> >> Error in ==> preproesther1 at 45 >> data = preprocessing(cfg); >> >> By trying to make it work I figured out that it is possible to do >> both the >> artifact rejection parts separately using (parts of) the script above >> but >> (Fieldtrip wants to combine two matrices to 1 matrix and that is what >> goes >> wrong). Does anyone know how (/whether) it is possible to do a artifact >> detection/rejection in Fieldtrip partly using functions of Fieldtrip >> itself and partly read markers of EEG parts containing a artifact (the >> file made by brain vision analyzer)? > > I have tried replicating your problem (with the data that I found on > /home/electromag/estmee/GOs/analyses/datagoed), but did not encounter > any problems up to the definetrial, artifatc_muscle and > rejectartifact. However, the problem comes only in when preprocessing > is called. For backward compatibility with other peoples old scripts, > preprocessing is also calling definetrial and rejhectartifact, and > rejectartifact seems confused by being called twice. > > I made a small change to rejectartifact that hopefully fixes the > problem. The updated version is on home/common now and will be on the > ftp this evening. > > best regards, > Robert >