From marco.buiatti at UNIV-PARIS5.FR Fri Sep 2 18:28:39 2005 From: marco.buiatti at UNIV-PARIS5.FR (Marco Buiatti) Date: Fri, 2 Sep 2005 18:28:39 +0200 Subject: eeglab2fieldtrip Message-ID: Dear fieldtrippers, I'm a beginner to fieldtrip, and I have my EEG data saved as eeglab datasets. In the documentation pages you mention the possibility to import eeglab datasets with a eeglab2fieldtrip function, but I could not find this function in the fieldtrip version I downloaded (version 20050901). Can you help me with this? Thank you, Marco From r.oostenveld at FCDONDERS.RU.NL Fri Sep 2 18:53:12 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 2 Sep 2005 18:53:12 +0200 Subject: eeglab2fieldtrip In-Reply-To: Message-ID: Hi Marco, Sorry that it was missing, please find it attached. I will also add it to the daily release version. The EEGLAB data structure contains much more information than a typical FieldTrip function output. In EEGLAB, everything is collected together in this single large EEG structure, whereas in fieldtrip only the minimum amount of information is stored in the output structures of each function. Hence, you have to select which part of the EEG structure to convert. That is done by selecting the corresponding fieldtrip function as the 'fieldbox'. The selected data then will be converted to correspond with the output of that fieldtrip function. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: eeglab2fieldtrip.m Type: application/octet-stream Size: 4331 bytes Desc: not available URL: -------------- next part -------------- On 2-sep-2005, at 18:28, Marco Buiatti wrote: > Dear fieldtrippers, > > I'm a beginner to fieldtrip, and I have my EEG data saved as eeglab > datasets. In the documentation pages you mention the possibility to > import > eeglab datasets with a eeglab2fieldtrip function, but I could not > find this > function in the fieldtrip version I downloaded (version 20050901). > Can you > help me with this? > > Thank you, > > Marco ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From P.Praamstra at BHAM.AC.UK Wed Sep 7 12:06:49 2005 From: P.Praamstra at BHAM.AC.UK (Peter Praamstra) Date: Wed, 7 Sep 2005 11:06:49 +0100 Subject: besa2fieldtrip Message-ID: An HTML attachment was scrubbed... URL: From h.f.kwok at BHAM.AC.UK Fri Sep 16 12:08:39 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Fri, 16 Sep 2005 12:08:39 +0200 Subject: sourcestatistics Message-ID: Hi, We've been trying to use sourcestatistics.m but I found that first of all a few private functions are missing. These include: sourcestatistics_parametric.m sourcestatistics_randomization.m and sourcestatistics_randcluster.m Therefore, everytime we set the cfg.method to 'randomization' or 'randcluster', it complaint that it could not find the functions. Another problem occurred when we tried to set the cfg.approach to 'stat': source1=besa2fieldtrip('AM3001_ld.dat'); source2=besa2fieldtrip('CGi2604_ld.dat'); cfg=[]; cfg.parameter='pow'; cfg.approach='stats'; cfg.method='ttest'; [stat]=sourcestatistics(cfg,source1,source2); Then we got the following error message: ??? Operands to the || and && operators must be convertible to logical scalar values. Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos)~=length (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) Error in ==> sourcestatistics at 86 stat = statistics_wrapper(cfg, varargin{:}); Can anyone help please? Hoi Fei From MZvyagintsev at UKAACHEN.DE Sun Sep 18 16:15:48 2005 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Sun, 18 Sep 2005 16:15:48 +0200 Subject: dipolefitting Message-ID: Hi Robert! Could you describe shortly how to perform dipole analysis on the example-data? is it possible to do it after Event Related Averaging step? Which additional info it needs, becouse it does not work sipmply (with description from the dipolefitting.m - always something is missed)... And actually script which you recommended for trying dipole fitting makes several warnings - 'divide by zero'. Is it not important? Thank you, Mikhail. From MZvyagintsev at UKAACHEN.DE Mon Sep 19 11:24:32 2005 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Mon, 19 Sep 2005 11:24:32 +0200 Subject: .hdm file Message-ID: Dear Robert, Could you also describe .hdm file - it fields and how to create this file by my own, and how do you create it normaly. Thank you, Mikhail. From Jan.Schoffelen at FCDONDERS.RU.NL Mon Sep 19 11:36:50 2005 From: Jan.Schoffelen at FCDONDERS.RU.NL (J.M. Schoffelen) Date: Mon, 19 Sep 2005 11:36:50 +0200 Subject: .hdm file In-Reply-To: Message-ID: Dear Mikhail, The .hdm file is a CTF-specific file, which contains the information necessary to create the forward model, or the leadfields. If you are playing around with CTF-data, you should have a look at how this is created by the CTF-software in the CTF-documentation. If you are not using CTF-stuff, than you do not need a .hdm, but rather a forward-model, which should be specified in cfg.vol. The simplest version of this is a single sphere model, which specifies a sphere with an origin vol.o (x, y and z coordinates), and a radius in vol.r, in which the x,y and z coordinates are defined with respect to your sensors. This single sphere itself is then the best-fitting sphere to the subject's head. At present, the estimation of this sphere is not possible in fieldtrip. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Mikhail Zvyagintsev Sent: Monday, September 19, 2005 11:25 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] .hdm file Dear Robert, Could you also describe .hdm file - it fields and how to create this file by my own, and how do you create it normaly. Thank you, Mikhail. From MZvyagintsev at UKAACHEN.DE Mon Sep 19 17:38:08 2005 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Mon, 19 Sep 2005 17:38:08 +0200 Subject: Current of source Message-ID: Dear Robert, as I found dipolefitting.m calculates just dipole moment. Do you have any routines to transform dipole moment to the electrical current? I looked through the FieldTrip, but I did not find it. Accordingly to my previous question (I mean how to deal with dipolefitting.m and dataset from example) - it works now, but I would still wait for your recomendation how to use it properly in this special case. Another question is - how would you recommend to estimate activity of auditoria dipoles? Does nonlinear algorithm make any difference if I would do it separately - one after another one or it is always better to estimate them both in the same time? Some time they are not in exactly simmetrical positions... And if I estimate them one after another one, how should I project out the contribution of the first source from the measured signal? Thank you, Mikhail. From r.oostenveld at FCDONDERS.RU.NL Mon Sep 26 15:33:04 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 26 Sep 2005 15:33:04 +0200 Subject: sourcestatistics In-Reply-To: Message-ID: Hi Ho Fei On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > We've been trying to use sourcestatistics.m but I found that first > of all a > few private functions are missing. These include: > sourcestatistics_parametric.m > sourcestatistics_randomization.m > and sourcestatistics_randcluster.m There are different methods available for statistical assesements of differences between conditions, most of them are implemented for all different data types, namely ERPs TFRs and source reconstructions. These are implemented as submethods of the sourcestatistics, freqstatistics and timelockstatistics functions. These functions will call the appropritate subfunction, and these are missing. Some of the subfunctions are still work in progress and are not part of the release version of fieldtrip (because of scientific novelty). However, there are also a few subfunctions that are supposed to be part of the release version. I just checked and they are indeed not part of the current zip file any more. I will make sure to include them in the upcoming daily version. Furthermore, I will also send them to you as attachement in a separate mail (probably tomorrow). > Another problem occurred when we tried to set the cfg.approach to > 'stat': > ... > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 > if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos)~=length > (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) That is indeed a bug. Please change the last part of the statement from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos (:)==varargin{1}.pos(:))". I will fix it in the official version as well. best regards, Robert PS Sorry for my late reply, I was on the SPR conference. From h.f.kwok at BHAM.AC.UK Mon Sep 26 16:09:28 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Mon, 26 Sep 2005 15:09:28 +0100 Subject: sourcestatistics: another bug/problem In-Reply-To: Message-ID: Dear Robert, Thanks. I have changed line 65 of the statistic_wrapper.m but encountered the following error: ??? Reference to non-existent field 'design'. Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 design = cfg.design; Error in ==> sourcestatistics at 86 stat = statistics_wrapper(cfg, varargin{:}); The problem seems to arise from the fact that while calling the source_statistics, 'design' is not one of the fields that one has to specify. Regards, Hoi Fei -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: 26 September 2005 14:33 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] sourcestatistics Hi Ho Fei On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > We've been trying to use sourcestatistics.m but I found that first > of all a > few private functions are missing. These include: > sourcestatistics_parametric.m > sourcestatistics_randomization.m > and sourcestatistics_randcluster.m There are different methods available for statistical assesements of differences between conditions, most of them are implemented for all different data types, namely ERPs TFRs and source reconstructions. These are implemented as submethods of the sourcestatistics, freqstatistics and timelockstatistics functions. These functions will call the appropritate subfunction, and these are missing. Some of the subfunctions are still work in progress and are not part of the release version of fieldtrip (because of scientific novelty). However, there are also a few subfunctions that are supposed to be part of the release version. I just checked and they are indeed not part of the current zip file any more. I will make sure to include them in the upcoming daily version. Furthermore, I will also send them to you as attachement in a separate mail (probably tomorrow). > Another problem occurred when we tried to set the cfg.approach to > 'stat': > ... > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 > if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos)~=length > (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) That is indeed a bug. Please change the last part of the statement from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos (:)==varargin{1}.pos(:))". I will fix it in the official version as well. best regards, Robert PS Sorry for my late reply, I was on the SPR conference. From andrew at AUDIOSPEECH.UBC.CA Mon Sep 26 18:26:36 2005 From: andrew at AUDIOSPEECH.UBC.CA (Andrew Dimitrijevic) Date: Mon, 26 Sep 2005 09:26:36 -0700 Subject: beginner problems Message-ID: Hi, I just downloaded fieldtrip and I'm trying the "Example MATLAB scripts" off the website I'm using matlab 7, the data "subject01.ds" is an unzipped folder in the main fieldtrip folder. (I guess CTF data is a folder?... I usually use Neuroscan CNT files.... but I'm guessing thats how CTF saves thier data) Here's the diary output: cfg = []; cfg.channel = {'MEG' 'STIM'}; cfg.dataset = 'Subject01.ds'; cfg.trialdef.excludeConditions = {'BAD'}; cfg.trialdef.includeTrigger = 3; % Define trigger cfg.blc = 'yes'; % baseline correction cfg.blcwindow = [-0.2 0]; % baseline correction window cfg.lpfilter = 'yes' % low-pass filter cfg = channel: {'MEG' 'STIM'} dataset: 'Subject01.ds' trialdef: [1x1 struct] blc: 'yes' blcwindow: [-0.2000 0] lpfilter: 'yes' cfg.lpfreq = 35; % low-pass filter of 35 Hertz cfg.padding = 0; % do not pad trials dataFIC = preprocessing(cfg); % process... evaluating trialfunction 'trialfun_ctf_epoched' ??? Error using ==> nargout Not a valid M-file. Error in ==> definetrial at 141 num = nargout(cfg.trialfun); Error in ==> preprocessing at 263 [cfg] = definetrial(cfg); Should there be an m-file: 'trialfun_ctf_epoched.m'? - if so I can't find it in any (sub)directories. Thanks Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TECHUNIX.TECHNION.AC.IL Tue Sep 27 14:47:00 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Tue, 27 Sep 2005 15:47:00 +0300 Subject: Custom layout Message-ID: Hi, I'm working on some data recorded with custom EEG cap (electrodes locations in two formats attached). Can you please make for me or tell me how to make a layout file for topoplot functions out of this? Thanks, Vladimir -------------- next part -------------- A non-text attachment was scrubbed... Name: fin.sfp Type: application/octet-stream Size: 2598 bytes Desc: URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fin.elp Type: application/octet-stream Size: 1550 bytes Desc: URL: From r.oostenveld at FCDONDERS.RU.NL Thu Sep 29 09:31:41 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Sep 2005 09:31:41 +0200 Subject: Current of source In-Reply-To: Message-ID: Hi Mikhail On 19-sep-2005, at 17:38, Mikhail Zvyagintsev wrote: > as I found dipolefitting.m calculates just dipole moment. Do you > have any > routines to transform dipole moment to the electrical current? I > looked > through the FieldTrip, but I did not find it. Current in the brain is not like current through a wire, therefore you cannot express it in Ampere alone. You can either express it as current density (i.e. current per unit of volume) if you compute a distributed source reconstruction or as dipole moment for a sparse source reconstruction. A current dipole consists of a source at the dendrite and a sink at the soma (or the other way around, depending on whether it is an exitatory or inhibitory synaps). The current source and sink together form the dipole. The distance between source and sink determine the impact that the current generator has on the secondary currents in the surrounding tissue. E.g. if the distance were zero, there would be no impact at all. Therefore the current is normalised for the distance between the two, i.e. source strenght is expressed in Ampere times meter. If you make the distance twice as small, and the current flowing from the source to the sink twice as large, the impact on the secondary currents in the surrounding tissue remains the same, just as the dipole moment. > Accordingly to my previous question (I mean how to deal with > dipolefitting.m > and dataset from example) - it works now, but I would still wait > for your > recomendation how to use it properly in this special case. > Another question is - how would you recommend to estimate activity of > auditoria dipoles? Does nonlinear algorithm make any difference if > I would > do it separately - one after another one or it is always better to > estimate > them both in the same time? Some time they are not in exactly > simmetrical > positions... And if I estimate them one after another one, how > should I > project out the contribution of the first source from the measured > signal? In EEG (AEPs), you are required to estimate them simultaneously, since they both project to a vertex extremum. In MEG, you can try to estimate them separate, by taking subselections of sensors over both hemispheres. Even then, about 10% of the field of the left auditory dipole is still visible over the right hemisphere (if I recall correctly). That means that in MEG you better also estimate them simultaneously. You can start the estimation with a symemtry constraint, and then use the positions of the symmetric dipole pair as the initial guess in an unconstrained optimalisation. If you have a single dipole model for your data, you can subtract the model field distribution from the observed, and then continue with the residual field. However, that is not optimal, since the field of the first dipole is not orthogonal to the second dipole, and hence you are subtracting part of the activity of the second dipole as well. best regards, Robert ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From r.oostenveld at FCDONDERS.RU.NL Thu Sep 29 09:46:55 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Sep 2005 09:46:55 +0200 Subject: Custom layout In-Reply-To: Message-ID: Hi Vladimir, On 27-sep-2005, at 14:47, Litvak Vladimir wrote: > I'm working on some data recorded with custom EEG cap (electrodes > locations in > two formats attached). Can you please make for me or tell me how to > make a > layout file for topoplot functions out of this? The BESA sfp format is supported by Fieldtrip. You can use read_fcdc_elec on that file, or in this case, you can specify cfg.layout='fin.sfp' in the plotting functions. For an optimal layout, especially for the multiplotXX functions, you probably should make a *.lay file manually (the layout file specifies the 2D location and the size of each subplot), but for topoplotXXX the automatic layout that you get with cfg.layout='fin.sfp' probably will be sufficient. best Robert From r.oostenveld at FCDONDERS.RU.NL Thu Sep 29 09:51:17 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Sep 2005 09:51:17 +0200 Subject: sourcestatistics: another bug/problem In-Reply-To: <000001c5c2a3$e884c400$e516bc93@universi8ef8be> Message-ID: Hi Ho Fei, You have to specify the experimental design in cfg.design, similar to the design matrix in SPM. You have multiple source volumes, one for each subject and condition. For each source volume you have to give the condition label (as a number), i.e. the length of cfg.design equals the number of source volumes and the number of unique elements equals the number of conditions. You can also use more elaborate design matrices with multiple rows, one row for one each factor, but it you are not familiar with design matrices, I would not try that immediately. best regards, Robert On 26-sep-2005, at 16:09, Hoi Fei Kwok wrote: > Dear Robert, > > Thanks. I have changed line 65 of the statistic_wrapper.m but > encountered > the following error: > > ??? Reference to non-existent field 'design'. > > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 > design = cfg.design; > > Error in ==> sourcestatistics at 86 > stat = statistics_wrapper(cfg, varargin{:}); > > The problem seems to arise from the fact that while calling the > source_statistics, 'design' is not one of the fields that one has to > specify. > > Regards, > Hoi Fei > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Robert Oostenveld > Sent: 26 September 2005 14:33 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] sourcestatistics > > Hi Ho Fei > > On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > >> We've been trying to use sourcestatistics.m but I found that first >> of all a >> few private functions are missing. These include: >> sourcestatistics_parametric.m >> sourcestatistics_randomization.m >> and sourcestatistics_randcluster.m >> > > There are different methods available for statistical assesements of > differences between conditions, most of them are implemented for all > different data types, namely ERPs TFRs and source reconstructions. > These are implemented as submethods of the sourcestatistics, > freqstatistics and timelockstatistics functions. These functions will > call the appropritate subfunction, and these are missing. Some of the > subfunctions are still work in progress and are not part of the > release version of fieldtrip (because of scientific novelty). > However, there are also a few subfunctions that are supposed to be > part of the release version. I just checked and they are indeed not > part of the current zip file any more. I will make sure to include > them in the upcoming daily version. Furthermore, I will also send > them to you as attachement in a separate mail (probably tomorrow). > > >> Another problem occurred when we tried to set the cfg.approach to >> 'stat': >> ... >> Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 >> if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos) >> ~=length >> (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) >> > > That is indeed a bug. Please change the last part of the statement > from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos > (:)==varargin{1}.pos(:))". I will fix it in the official version as > well. > > best regards, > Robert > > PS Sorry for my late reply, I was on the SPR conference. > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From h.f.kwok at BHAM.AC.UK Thu Sep 29 10:10:14 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Thu, 29 Sep 2005 09:10:14 +0100 Subject: sourcestatistics: another bug/problem In-Reply-To: <47B77A8E-50C4-4242-A132-A2223D98C664@fcdonders.ru.nl> Message-ID: Thanks, Robert, I raised this partly because in the help documentation of the file sourcestatistics, the field 'design' wasn't mentioned. Perhaps it will be clearer for the users if this is explicitly mentioned. By the way, what are the allowable values for the field 'design'? Regards, Hoi Fei -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: 29 September 2005 08:51 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] sourcestatistics: another bug/problem Hi Ho Fei, You have to specify the experimental design in cfg.design, similar to the design matrix in SPM. You have multiple source volumes, one for each subject and condition. For each source volume you have to give the condition label (as a number), i.e. the length of cfg.design equals the number of source volumes and the number of unique elements equals the number of conditions. You can also use more elaborate design matrices with multiple rows, one row for one each factor, but it you are not familiar with design matrices, I would not try that immediately. best regards, Robert On 26-sep-2005, at 16:09, Hoi Fei Kwok wrote: > Dear Robert, > > Thanks. I have changed line 65 of the statistic_wrapper.m but > encountered > the following error: > > ??? Reference to non-existent field 'design'. > > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 > design = cfg.design; > > Error in ==> sourcestatistics at 86 > stat = statistics_wrapper(cfg, varargin{:}); > > The problem seems to arise from the fact that while calling the > source_statistics, 'design' is not one of the fields that one has to > specify. > > Regards, > Hoi Fei > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Robert Oostenveld > Sent: 26 September 2005 14:33 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] sourcestatistics > > Hi Ho Fei > > On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > >> We've been trying to use sourcestatistics.m but I found that first >> of all a >> few private functions are missing. These include: >> sourcestatistics_parametric.m >> sourcestatistics_randomization.m >> and sourcestatistics_randcluster.m >> > > There are different methods available for statistical assesements of > differences between conditions, most of them are implemented for all > different data types, namely ERPs TFRs and source reconstructions. > These are implemented as submethods of the sourcestatistics, > freqstatistics and timelockstatistics functions. These functions will > call the appropritate subfunction, and these are missing. Some of the > subfunctions are still work in progress and are not part of the > release version of fieldtrip (because of scientific novelty). > However, there are also a few subfunctions that are supposed to be > part of the release version. I just checked and they are indeed not > part of the current zip file any more. I will make sure to include > them in the upcoming daily version. Furthermore, I will also send > them to you as attachement in a separate mail (probably tomorrow). > > >> Another problem occurred when we tried to set the cfg.approach to >> 'stat': >> ... >> Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 >> if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos) >> ~=length >> (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) >> > > That is indeed a bug. Please change the last part of the statement > from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos > (:)==varargin{1}.pos(:))". I will fix it in the official version as > well. > > best regards, > Robert > > PS Sorry for my late reply, I was on the SPR conference. > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From h.f.kwok at BHAM.AC.UK Thu Sep 29 10:13:42 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Thu, 29 Sep 2005 09:13:42 +0100 Subject: sourcestatistics: another bug/problem In-Reply-To: <47B77A8E-50C4-4242-A132-A2223D98C664@fcdonders.ru.nl> Message-ID: Hi, Robert, Sorry about this but after I've sent my previous post, I noticed from your post that it seems a bit clearer now the field 'design' refers to the design matrix and not the type of the design. Thanks. Hoi Fei -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: 29 September 2005 08:51 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] sourcestatistics: another bug/problem Hi Ho Fei, You have to specify the experimental design in cfg.design, similar to the design matrix in SPM. You have multiple source volumes, one for each subject and condition. For each source volume you have to give the condition label (as a number), i.e. the length of cfg.design equals the number of source volumes and the number of unique elements equals the number of conditions. You can also use more elaborate design matrices with multiple rows, one row for one each factor, but it you are not familiar with design matrices, I would not try that immediately. best regards, Robert On 26-sep-2005, at 16:09, Hoi Fei Kwok wrote: > Dear Robert, > > Thanks. I have changed line 65 of the statistic_wrapper.m but > encountered > the following error: > > ??? Reference to non-existent field 'design'. > > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 > design = cfg.design; > > Error in ==> sourcestatistics at 86 > stat = statistics_wrapper(cfg, varargin{:}); > > The problem seems to arise from the fact that while calling the > source_statistics, 'design' is not one of the fields that one has to > specify. > > Regards, > Hoi Fei > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Robert Oostenveld > Sent: 26 September 2005 14:33 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] sourcestatistics > > Hi Ho Fei > > On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > >> We've been trying to use sourcestatistics.m but I found that first >> of all a >> few private functions are missing. These include: >> sourcestatistics_parametric.m >> sourcestatistics_randomization.m >> and sourcestatistics_randcluster.m >> > > There are different methods available for statistical assesements of > differences between conditions, most of them are implemented for all > different data types, namely ERPs TFRs and source reconstructions. > These are implemented as submethods of the sourcestatistics, > freqstatistics and timelockstatistics functions. These functions will > call the appropritate subfunction, and these are missing. Some of the > subfunctions are still work in progress and are not part of the > release version of fieldtrip (because of scientific novelty). > However, there are also a few subfunctions that are supposed to be > part of the release version. I just checked and they are indeed not > part of the current zip file any more. I will make sure to include > them in the upcoming daily version. Furthermore, I will also send > them to you as attachement in a separate mail (probably tomorrow). > > >> Another problem occurred when we tried to set the cfg.approach to >> 'stat': >> ... >> Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 >> if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos) >> ~=length >> (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) >> > > That is indeed a bug. Please change the last part of the statement > from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos > (:)==varargin{1}.pos(:))". I will fix it in the official version as > well. > > best regards, > Robert > > PS Sorry for my late reply, I was on the SPR conference. > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From marco.buiatti at UNIV-PARIS5.FR Fri Sep 2 18:28:39 2005 From: marco.buiatti at UNIV-PARIS5.FR (Marco Buiatti) Date: Fri, 2 Sep 2005 18:28:39 +0200 Subject: eeglab2fieldtrip Message-ID: Dear fieldtrippers, I'm a beginner to fieldtrip, and I have my EEG data saved as eeglab datasets. In the documentation pages you mention the possibility to import eeglab datasets with a eeglab2fieldtrip function, but I could not find this function in the fieldtrip version I downloaded (version 20050901). Can you help me with this? Thank you, Marco From r.oostenveld at FCDONDERS.RU.NL Fri Sep 2 18:53:12 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 2 Sep 2005 18:53:12 +0200 Subject: eeglab2fieldtrip In-Reply-To: Message-ID: Hi Marco, Sorry that it was missing, please find it attached. I will also add it to the daily release version. The EEGLAB data structure contains much more information than a typical FieldTrip function output. In EEGLAB, everything is collected together in this single large EEG structure, whereas in fieldtrip only the minimum amount of information is stored in the output structures of each function. Hence, you have to select which part of the EEG structure to convert. That is done by selecting the corresponding fieldtrip function as the 'fieldbox'. The selected data then will be converted to correspond with the output of that fieldtrip function. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: eeglab2fieldtrip.m Type: application/octet-stream Size: 4331 bytes Desc: not available URL: -------------- next part -------------- On 2-sep-2005, at 18:28, Marco Buiatti wrote: > Dear fieldtrippers, > > I'm a beginner to fieldtrip, and I have my EEG data saved as eeglab > datasets. In the documentation pages you mention the possibility to > import > eeglab datasets with a eeglab2fieldtrip function, but I could not > find this > function in the fieldtrip version I downloaded (version 20050901). > Can you > help me with this? > > Thank you, > > Marco ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From P.Praamstra at BHAM.AC.UK Wed Sep 7 12:06:49 2005 From: P.Praamstra at BHAM.AC.UK (Peter Praamstra) Date: Wed, 7 Sep 2005 11:06:49 +0100 Subject: besa2fieldtrip Message-ID: An HTML attachment was scrubbed... URL: From h.f.kwok at BHAM.AC.UK Fri Sep 16 12:08:39 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Fri, 16 Sep 2005 12:08:39 +0200 Subject: sourcestatistics Message-ID: Hi, We've been trying to use sourcestatistics.m but I found that first of all a few private functions are missing. These include: sourcestatistics_parametric.m sourcestatistics_randomization.m and sourcestatistics_randcluster.m Therefore, everytime we set the cfg.method to 'randomization' or 'randcluster', it complaint that it could not find the functions. Another problem occurred when we tried to set the cfg.approach to 'stat': source1=besa2fieldtrip('AM3001_ld.dat'); source2=besa2fieldtrip('CGi2604_ld.dat'); cfg=[]; cfg.parameter='pow'; cfg.approach='stats'; cfg.method='ttest'; [stat]=sourcestatistics(cfg,source1,source2); Then we got the following error message: ??? Operands to the || and && operators must be convertible to logical scalar values. Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos)~=length (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) Error in ==> sourcestatistics at 86 stat = statistics_wrapper(cfg, varargin{:}); Can anyone help please? Hoi Fei From MZvyagintsev at UKAACHEN.DE Sun Sep 18 16:15:48 2005 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Sun, 18 Sep 2005 16:15:48 +0200 Subject: dipolefitting Message-ID: Hi Robert! Could you describe shortly how to perform dipole analysis on the example-data? is it possible to do it after Event Related Averaging step? Which additional info it needs, becouse it does not work sipmply (with description from the dipolefitting.m - always something is missed)... And actually script which you recommended for trying dipole fitting makes several warnings - 'divide by zero'. Is it not important? Thank you, Mikhail. From MZvyagintsev at UKAACHEN.DE Mon Sep 19 11:24:32 2005 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Mon, 19 Sep 2005 11:24:32 +0200 Subject: .hdm file Message-ID: Dear Robert, Could you also describe .hdm file - it fields and how to create this file by my own, and how do you create it normaly. Thank you, Mikhail. From Jan.Schoffelen at FCDONDERS.RU.NL Mon Sep 19 11:36:50 2005 From: Jan.Schoffelen at FCDONDERS.RU.NL (J.M. Schoffelen) Date: Mon, 19 Sep 2005 11:36:50 +0200 Subject: .hdm file In-Reply-To: Message-ID: Dear Mikhail, The .hdm file is a CTF-specific file, which contains the information necessary to create the forward model, or the leadfields. If you are playing around with CTF-data, you should have a look at how this is created by the CTF-software in the CTF-documentation. If you are not using CTF-stuff, than you do not need a .hdm, but rather a forward-model, which should be specified in cfg.vol. The simplest version of this is a single sphere model, which specifies a sphere with an origin vol.o (x, y and z coordinates), and a radius in vol.r, in which the x,y and z coordinates are defined with respect to your sensors. This single sphere itself is then the best-fitting sphere to the subject's head. At present, the estimation of this sphere is not possible in fieldtrip. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Mikhail Zvyagintsev Sent: Monday, September 19, 2005 11:25 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] .hdm file Dear Robert, Could you also describe .hdm file - it fields and how to create this file by my own, and how do you create it normaly. Thank you, Mikhail. From MZvyagintsev at UKAACHEN.DE Mon Sep 19 17:38:08 2005 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Mon, 19 Sep 2005 17:38:08 +0200 Subject: Current of source Message-ID: Dear Robert, as I found dipolefitting.m calculates just dipole moment. Do you have any routines to transform dipole moment to the electrical current? I looked through the FieldTrip, but I did not find it. Accordingly to my previous question (I mean how to deal with dipolefitting.m and dataset from example) - it works now, but I would still wait for your recomendation how to use it properly in this special case. Another question is - how would you recommend to estimate activity of auditoria dipoles? Does nonlinear algorithm make any difference if I would do it separately - one after another one or it is always better to estimate them both in the same time? Some time they are not in exactly simmetrical positions... And if I estimate them one after another one, how should I project out the contribution of the first source from the measured signal? Thank you, Mikhail. From r.oostenveld at FCDONDERS.RU.NL Mon Sep 26 15:33:04 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 26 Sep 2005 15:33:04 +0200 Subject: sourcestatistics In-Reply-To: Message-ID: Hi Ho Fei On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > We've been trying to use sourcestatistics.m but I found that first > of all a > few private functions are missing. These include: > sourcestatistics_parametric.m > sourcestatistics_randomization.m > and sourcestatistics_randcluster.m There are different methods available for statistical assesements of differences between conditions, most of them are implemented for all different data types, namely ERPs TFRs and source reconstructions. These are implemented as submethods of the sourcestatistics, freqstatistics and timelockstatistics functions. These functions will call the appropritate subfunction, and these are missing. Some of the subfunctions are still work in progress and are not part of the release version of fieldtrip (because of scientific novelty). However, there are also a few subfunctions that are supposed to be part of the release version. I just checked and they are indeed not part of the current zip file any more. I will make sure to include them in the upcoming daily version. Furthermore, I will also send them to you as attachement in a separate mail (probably tomorrow). > Another problem occurred when we tried to set the cfg.approach to > 'stat': > ... > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 > if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos)~=length > (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) That is indeed a bug. Please change the last part of the statement from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos (:)==varargin{1}.pos(:))". I will fix it in the official version as well. best regards, Robert PS Sorry for my late reply, I was on the SPR conference. From h.f.kwok at BHAM.AC.UK Mon Sep 26 16:09:28 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Mon, 26 Sep 2005 15:09:28 +0100 Subject: sourcestatistics: another bug/problem In-Reply-To: Message-ID: Dear Robert, Thanks. I have changed line 65 of the statistic_wrapper.m but encountered the following error: ??? Reference to non-existent field 'design'. Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 design = cfg.design; Error in ==> sourcestatistics at 86 stat = statistics_wrapper(cfg, varargin{:}); The problem seems to arise from the fact that while calling the source_statistics, 'design' is not one of the fields that one has to specify. Regards, Hoi Fei -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: 26 September 2005 14:33 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] sourcestatistics Hi Ho Fei On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > We've been trying to use sourcestatistics.m but I found that first > of all a > few private functions are missing. These include: > sourcestatistics_parametric.m > sourcestatistics_randomization.m > and sourcestatistics_randcluster.m There are different methods available for statistical assesements of differences between conditions, most of them are implemented for all different data types, namely ERPs TFRs and source reconstructions. These are implemented as submethods of the sourcestatistics, freqstatistics and timelockstatistics functions. These functions will call the appropritate subfunction, and these are missing. Some of the subfunctions are still work in progress and are not part of the release version of fieldtrip (because of scientific novelty). However, there are also a few subfunctions that are supposed to be part of the release version. I just checked and they are indeed not part of the current zip file any more. I will make sure to include them in the upcoming daily version. Furthermore, I will also send them to you as attachement in a separate mail (probably tomorrow). > Another problem occurred when we tried to set the cfg.approach to > 'stat': > ... > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 > if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos)~=length > (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) That is indeed a bug. Please change the last part of the statement from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos (:)==varargin{1}.pos(:))". I will fix it in the official version as well. best regards, Robert PS Sorry for my late reply, I was on the SPR conference. From andrew at AUDIOSPEECH.UBC.CA Mon Sep 26 18:26:36 2005 From: andrew at AUDIOSPEECH.UBC.CA (Andrew Dimitrijevic) Date: Mon, 26 Sep 2005 09:26:36 -0700 Subject: beginner problems Message-ID: Hi, I just downloaded fieldtrip and I'm trying the "Example MATLAB scripts" off the website I'm using matlab 7, the data "subject01.ds" is an unzipped folder in the main fieldtrip folder. (I guess CTF data is a folder?... I usually use Neuroscan CNT files.... but I'm guessing thats how CTF saves thier data) Here's the diary output: cfg = []; cfg.channel = {'MEG' 'STIM'}; cfg.dataset = 'Subject01.ds'; cfg.trialdef.excludeConditions = {'BAD'}; cfg.trialdef.includeTrigger = 3; % Define trigger cfg.blc = 'yes'; % baseline correction cfg.blcwindow = [-0.2 0]; % baseline correction window cfg.lpfilter = 'yes' % low-pass filter cfg = channel: {'MEG' 'STIM'} dataset: 'Subject01.ds' trialdef: [1x1 struct] blc: 'yes' blcwindow: [-0.2000 0] lpfilter: 'yes' cfg.lpfreq = 35; % low-pass filter of 35 Hertz cfg.padding = 0; % do not pad trials dataFIC = preprocessing(cfg); % process... evaluating trialfunction 'trialfun_ctf_epoched' ??? Error using ==> nargout Not a valid M-file. Error in ==> definetrial at 141 num = nargout(cfg.trialfun); Error in ==> preprocessing at 263 [cfg] = definetrial(cfg); Should there be an m-file: 'trialfun_ctf_epoched.m'? - if so I can't find it in any (sub)directories. Thanks Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TECHUNIX.TECHNION.AC.IL Tue Sep 27 14:47:00 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Tue, 27 Sep 2005 15:47:00 +0300 Subject: Custom layout Message-ID: Hi, I'm working on some data recorded with custom EEG cap (electrodes locations in two formats attached). Can you please make for me or tell me how to make a layout file for topoplot functions out of this? Thanks, Vladimir -------------- next part -------------- A non-text attachment was scrubbed... Name: fin.sfp Type: application/octet-stream Size: 2598 bytes Desc: URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fin.elp Type: application/octet-stream Size: 1550 bytes Desc: URL: From r.oostenveld at FCDONDERS.RU.NL Thu Sep 29 09:31:41 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Sep 2005 09:31:41 +0200 Subject: Current of source In-Reply-To: Message-ID: Hi Mikhail On 19-sep-2005, at 17:38, Mikhail Zvyagintsev wrote: > as I found dipolefitting.m calculates just dipole moment. Do you > have any > routines to transform dipole moment to the electrical current? I > looked > through the FieldTrip, but I did not find it. Current in the brain is not like current through a wire, therefore you cannot express it in Ampere alone. You can either express it as current density (i.e. current per unit of volume) if you compute a distributed source reconstruction or as dipole moment for a sparse source reconstruction. A current dipole consists of a source at the dendrite and a sink at the soma (or the other way around, depending on whether it is an exitatory or inhibitory synaps). The current source and sink together form the dipole. The distance between source and sink determine the impact that the current generator has on the secondary currents in the surrounding tissue. E.g. if the distance were zero, there would be no impact at all. Therefore the current is normalised for the distance between the two, i.e. source strenght is expressed in Ampere times meter. If you make the distance twice as small, and the current flowing from the source to the sink twice as large, the impact on the secondary currents in the surrounding tissue remains the same, just as the dipole moment. > Accordingly to my previous question (I mean how to deal with > dipolefitting.m > and dataset from example) - it works now, but I would still wait > for your > recomendation how to use it properly in this special case. > Another question is - how would you recommend to estimate activity of > auditoria dipoles? Does nonlinear algorithm make any difference if > I would > do it separately - one after another one or it is always better to > estimate > them both in the same time? Some time they are not in exactly > simmetrical > positions... And if I estimate them one after another one, how > should I > project out the contribution of the first source from the measured > signal? In EEG (AEPs), you are required to estimate them simultaneously, since they both project to a vertex extremum. In MEG, you can try to estimate them separate, by taking subselections of sensors over both hemispheres. Even then, about 10% of the field of the left auditory dipole is still visible over the right hemisphere (if I recall correctly). That means that in MEG you better also estimate them simultaneously. You can start the estimation with a symemtry constraint, and then use the positions of the symmetric dipole pair as the initial guess in an unconstrained optimalisation. If you have a single dipole model for your data, you can subtract the model field distribution from the observed, and then continue with the residual field. However, that is not optimal, since the field of the first dipole is not orthogonal to the second dipole, and hence you are subtracting part of the activity of the second dipole as well. best regards, Robert ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From r.oostenveld at FCDONDERS.RU.NL Thu Sep 29 09:46:55 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Sep 2005 09:46:55 +0200 Subject: Custom layout In-Reply-To: Message-ID: Hi Vladimir, On 27-sep-2005, at 14:47, Litvak Vladimir wrote: > I'm working on some data recorded with custom EEG cap (electrodes > locations in > two formats attached). Can you please make for me or tell me how to > make a > layout file for topoplot functions out of this? The BESA sfp format is supported by Fieldtrip. You can use read_fcdc_elec on that file, or in this case, you can specify cfg.layout='fin.sfp' in the plotting functions. For an optimal layout, especially for the multiplotXX functions, you probably should make a *.lay file manually (the layout file specifies the 2D location and the size of each subplot), but for topoplotXXX the automatic layout that you get with cfg.layout='fin.sfp' probably will be sufficient. best Robert From r.oostenveld at FCDONDERS.RU.NL Thu Sep 29 09:51:17 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Sep 2005 09:51:17 +0200 Subject: sourcestatistics: another bug/problem In-Reply-To: <000001c5c2a3$e884c400$e516bc93@universi8ef8be> Message-ID: Hi Ho Fei, You have to specify the experimental design in cfg.design, similar to the design matrix in SPM. You have multiple source volumes, one for each subject and condition. For each source volume you have to give the condition label (as a number), i.e. the length of cfg.design equals the number of source volumes and the number of unique elements equals the number of conditions. You can also use more elaborate design matrices with multiple rows, one row for one each factor, but it you are not familiar with design matrices, I would not try that immediately. best regards, Robert On 26-sep-2005, at 16:09, Hoi Fei Kwok wrote: > Dear Robert, > > Thanks. I have changed line 65 of the statistic_wrapper.m but > encountered > the following error: > > ??? Reference to non-existent field 'design'. > > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 > design = cfg.design; > > Error in ==> sourcestatistics at 86 > stat = statistics_wrapper(cfg, varargin{:}); > > The problem seems to arise from the fact that while calling the > source_statistics, 'design' is not one of the fields that one has to > specify. > > Regards, > Hoi Fei > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Robert Oostenveld > Sent: 26 September 2005 14:33 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] sourcestatistics > > Hi Ho Fei > > On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > >> We've been trying to use sourcestatistics.m but I found that first >> of all a >> few private functions are missing. These include: >> sourcestatistics_parametric.m >> sourcestatistics_randomization.m >> and sourcestatistics_randcluster.m >> > > There are different methods available for statistical assesements of > differences between conditions, most of them are implemented for all > different data types, namely ERPs TFRs and source reconstructions. > These are implemented as submethods of the sourcestatistics, > freqstatistics and timelockstatistics functions. These functions will > call the appropritate subfunction, and these are missing. Some of the > subfunctions are still work in progress and are not part of the > release version of fieldtrip (because of scientific novelty). > However, there are also a few subfunctions that are supposed to be > part of the release version. I just checked and they are indeed not > part of the current zip file any more. I will make sure to include > them in the upcoming daily version. Furthermore, I will also send > them to you as attachement in a separate mail (probably tomorrow). > > >> Another problem occurred when we tried to set the cfg.approach to >> 'stat': >> ... >> Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 >> if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos) >> ~=length >> (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) >> > > That is indeed a bug. Please change the last part of the statement > from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos > (:)==varargin{1}.pos(:))". I will fix it in the official version as > well. > > best regards, > Robert > > PS Sorry for my late reply, I was on the SPR conference. > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From h.f.kwok at BHAM.AC.UK Thu Sep 29 10:10:14 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Thu, 29 Sep 2005 09:10:14 +0100 Subject: sourcestatistics: another bug/problem In-Reply-To: <47B77A8E-50C4-4242-A132-A2223D98C664@fcdonders.ru.nl> Message-ID: Thanks, Robert, I raised this partly because in the help documentation of the file sourcestatistics, the field 'design' wasn't mentioned. Perhaps it will be clearer for the users if this is explicitly mentioned. By the way, what are the allowable values for the field 'design'? Regards, Hoi Fei -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: 29 September 2005 08:51 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] sourcestatistics: another bug/problem Hi Ho Fei, You have to specify the experimental design in cfg.design, similar to the design matrix in SPM. You have multiple source volumes, one for each subject and condition. For each source volume you have to give the condition label (as a number), i.e. the length of cfg.design equals the number of source volumes and the number of unique elements equals the number of conditions. You can also use more elaborate design matrices with multiple rows, one row for one each factor, but it you are not familiar with design matrices, I would not try that immediately. best regards, Robert On 26-sep-2005, at 16:09, Hoi Fei Kwok wrote: > Dear Robert, > > Thanks. I have changed line 65 of the statistic_wrapper.m but > encountered > the following error: > > ??? Reference to non-existent field 'design'. > > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 > design = cfg.design; > > Error in ==> sourcestatistics at 86 > stat = statistics_wrapper(cfg, varargin{:}); > > The problem seems to arise from the fact that while calling the > source_statistics, 'design' is not one of the fields that one has to > specify. > > Regards, > Hoi Fei > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Robert Oostenveld > Sent: 26 September 2005 14:33 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] sourcestatistics > > Hi Ho Fei > > On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > >> We've been trying to use sourcestatistics.m but I found that first >> of all a >> few private functions are missing. These include: >> sourcestatistics_parametric.m >> sourcestatistics_randomization.m >> and sourcestatistics_randcluster.m >> > > There are different methods available for statistical assesements of > differences between conditions, most of them are implemented for all > different data types, namely ERPs TFRs and source reconstructions. > These are implemented as submethods of the sourcestatistics, > freqstatistics and timelockstatistics functions. These functions will > call the appropritate subfunction, and these are missing. Some of the > subfunctions are still work in progress and are not part of the > release version of fieldtrip (because of scientific novelty). > However, there are also a few subfunctions that are supposed to be > part of the release version. I just checked and they are indeed not > part of the current zip file any more. I will make sure to include > them in the upcoming daily version. Furthermore, I will also send > them to you as attachement in a separate mail (probably tomorrow). > > >> Another problem occurred when we tried to set the cfg.approach to >> 'stat': >> ... >> Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 >> if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos) >> ~=length >> (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) >> > > That is indeed a bug. Please change the last part of the statement > from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos > (:)==varargin{1}.pos(:))". I will fix it in the official version as > well. > > best regards, > Robert > > PS Sorry for my late reply, I was on the SPR conference. > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From h.f.kwok at BHAM.AC.UK Thu Sep 29 10:13:42 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Thu, 29 Sep 2005 09:13:42 +0100 Subject: sourcestatistics: another bug/problem In-Reply-To: <47B77A8E-50C4-4242-A132-A2223D98C664@fcdonders.ru.nl> Message-ID: Hi, Robert, Sorry about this but after I've sent my previous post, I noticed from your post that it seems a bit clearer now the field 'design' refers to the design matrix and not the type of the design. Thanks. Hoi Fei -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: 29 September 2005 08:51 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] sourcestatistics: another bug/problem Hi Ho Fei, You have to specify the experimental design in cfg.design, similar to the design matrix in SPM. You have multiple source volumes, one for each subject and condition. For each source volume you have to give the condition label (as a number), i.e. the length of cfg.design equals the number of source volumes and the number of unique elements equals the number of conditions. You can also use more elaborate design matrices with multiple rows, one row for one each factor, but it you are not familiar with design matrices, I would not try that immediately. best regards, Robert On 26-sep-2005, at 16:09, Hoi Fei Kwok wrote: > Dear Robert, > > Thanks. I have changed line 65 of the statistic_wrapper.m but > encountered > the following error: > > ??? Reference to non-existent field 'design'. > > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 > design = cfg.design; > > Error in ==> sourcestatistics at 86 > stat = statistics_wrapper(cfg, varargin{:}); > > The problem seems to arise from the fact that while calling the > source_statistics, 'design' is not one of the fields that one has to > specify. > > Regards, > Hoi Fei > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Robert Oostenveld > Sent: 26 September 2005 14:33 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] sourcestatistics > > Hi Ho Fei > > On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > >> We've been trying to use sourcestatistics.m but I found that first >> of all a >> few private functions are missing. These include: >> sourcestatistics_parametric.m >> sourcestatistics_randomization.m >> and sourcestatistics_randcluster.m >> > > There are different methods available for statistical assesements of > differences between conditions, most of them are implemented for all > different data types, namely ERPs TFRs and source reconstructions. > These are implemented as submethods of the sourcestatistics, > freqstatistics and timelockstatistics functions. These functions will > call the appropritate subfunction, and these are missing. Some of the > subfunctions are still work in progress and are not part of the > release version of fieldtrip (because of scientific novelty). > However, there are also a few subfunctions that are supposed to be > part of the release version. I just checked and they are indeed not > part of the current zip file any more. I will make sure to include > them in the upcoming daily version. Furthermore, I will also send > them to you as attachement in a separate mail (probably tomorrow). > > >> Another problem occurred when we tried to set the cfg.approach to >> 'stat': >> ... >> Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 >> if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos) >> ~=length >> (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) >> > > That is indeed a bug. Please change the last part of the statement > from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos > (:)==varargin{1}.pos(:))". I will fix it in the official version as > well. > > best regards, > Robert > > PS Sorry for my late reply, I was on the SPR conference. > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From marco.buiatti at UNIV-PARIS5.FR Fri Sep 2 18:28:39 2005 From: marco.buiatti at UNIV-PARIS5.FR (Marco Buiatti) Date: Fri, 2 Sep 2005 18:28:39 +0200 Subject: eeglab2fieldtrip Message-ID: Dear fieldtrippers, I'm a beginner to fieldtrip, and I have my EEG data saved as eeglab datasets. In the documentation pages you mention the possibility to import eeglab datasets with a eeglab2fieldtrip function, but I could not find this function in the fieldtrip version I downloaded (version 20050901). Can you help me with this? Thank you, Marco From r.oostenveld at FCDONDERS.RU.NL Fri Sep 2 18:53:12 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 2 Sep 2005 18:53:12 +0200 Subject: eeglab2fieldtrip In-Reply-To: Message-ID: Hi Marco, Sorry that it was missing, please find it attached. I will also add it to the daily release version. The EEGLAB data structure contains much more information than a typical FieldTrip function output. In EEGLAB, everything is collected together in this single large EEG structure, whereas in fieldtrip only the minimum amount of information is stored in the output structures of each function. Hence, you have to select which part of the EEG structure to convert. That is done by selecting the corresponding fieldtrip function as the 'fieldbox'. The selected data then will be converted to correspond with the output of that fieldtrip function. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: eeglab2fieldtrip.m Type: application/octet-stream Size: 4331 bytes Desc: not available URL: -------------- next part -------------- On 2-sep-2005, at 18:28, Marco Buiatti wrote: > Dear fieldtrippers, > > I'm a beginner to fieldtrip, and I have my EEG data saved as eeglab > datasets. In the documentation pages you mention the possibility to > import > eeglab datasets with a eeglab2fieldtrip function, but I could not > find this > function in the fieldtrip version I downloaded (version 20050901). > Can you > help me with this? > > Thank you, > > Marco ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From P.Praamstra at BHAM.AC.UK Wed Sep 7 12:06:49 2005 From: P.Praamstra at BHAM.AC.UK (Peter Praamstra) Date: Wed, 7 Sep 2005 11:06:49 +0100 Subject: besa2fieldtrip Message-ID: An HTML attachment was scrubbed... URL: From h.f.kwok at BHAM.AC.UK Fri Sep 16 12:08:39 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Fri, 16 Sep 2005 12:08:39 +0200 Subject: sourcestatistics Message-ID: Hi, We've been trying to use sourcestatistics.m but I found that first of all a few private functions are missing. These include: sourcestatistics_parametric.m sourcestatistics_randomization.m and sourcestatistics_randcluster.m Therefore, everytime we set the cfg.method to 'randomization' or 'randcluster', it complaint that it could not find the functions. Another problem occurred when we tried to set the cfg.approach to 'stat': source1=besa2fieldtrip('AM3001_ld.dat'); source2=besa2fieldtrip('CGi2604_ld.dat'); cfg=[]; cfg.parameter='pow'; cfg.approach='stats'; cfg.method='ttest'; [stat]=sourcestatistics(cfg,source1,source2); Then we got the following error message: ??? Operands to the || and && operators must be convertible to logical scalar values. Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos)~=length (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) Error in ==> sourcestatistics at 86 stat = statistics_wrapper(cfg, varargin{:}); Can anyone help please? Hoi Fei From MZvyagintsev at UKAACHEN.DE Sun Sep 18 16:15:48 2005 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Sun, 18 Sep 2005 16:15:48 +0200 Subject: dipolefitting Message-ID: Hi Robert! Could you describe shortly how to perform dipole analysis on the example-data? is it possible to do it after Event Related Averaging step? Which additional info it needs, becouse it does not work sipmply (with description from the dipolefitting.m - always something is missed)... And actually script which you recommended for trying dipole fitting makes several warnings - 'divide by zero'. Is it not important? Thank you, Mikhail. From MZvyagintsev at UKAACHEN.DE Mon Sep 19 11:24:32 2005 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Mon, 19 Sep 2005 11:24:32 +0200 Subject: .hdm file Message-ID: Dear Robert, Could you also describe .hdm file - it fields and how to create this file by my own, and how do you create it normaly. Thank you, Mikhail. From Jan.Schoffelen at FCDONDERS.RU.NL Mon Sep 19 11:36:50 2005 From: Jan.Schoffelen at FCDONDERS.RU.NL (J.M. Schoffelen) Date: Mon, 19 Sep 2005 11:36:50 +0200 Subject: .hdm file In-Reply-To: Message-ID: Dear Mikhail, The .hdm file is a CTF-specific file, which contains the information necessary to create the forward model, or the leadfields. If you are playing around with CTF-data, you should have a look at how this is created by the CTF-software in the CTF-documentation. If you are not using CTF-stuff, than you do not need a .hdm, but rather a forward-model, which should be specified in cfg.vol. The simplest version of this is a single sphere model, which specifies a sphere with an origin vol.o (x, y and z coordinates), and a radius in vol.r, in which the x,y and z coordinates are defined with respect to your sensors. This single sphere itself is then the best-fitting sphere to the subject's head. At present, the estimation of this sphere is not possible in fieldtrip. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Mikhail Zvyagintsev Sent: Monday, September 19, 2005 11:25 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] .hdm file Dear Robert, Could you also describe .hdm file - it fields and how to create this file by my own, and how do you create it normaly. Thank you, Mikhail. From MZvyagintsev at UKAACHEN.DE Mon Sep 19 17:38:08 2005 From: MZvyagintsev at UKAACHEN.DE (Mikhail Zvyagintsev) Date: Mon, 19 Sep 2005 17:38:08 +0200 Subject: Current of source Message-ID: Dear Robert, as I found dipolefitting.m calculates just dipole moment. Do you have any routines to transform dipole moment to the electrical current? I looked through the FieldTrip, but I did not find it. Accordingly to my previous question (I mean how to deal with dipolefitting.m and dataset from example) - it works now, but I would still wait for your recomendation how to use it properly in this special case. Another question is - how would you recommend to estimate activity of auditoria dipoles? Does nonlinear algorithm make any difference if I would do it separately - one after another one or it is always better to estimate them both in the same time? Some time they are not in exactly simmetrical positions... And if I estimate them one after another one, how should I project out the contribution of the first source from the measured signal? Thank you, Mikhail. From r.oostenveld at FCDONDERS.RU.NL Mon Sep 26 15:33:04 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 26 Sep 2005 15:33:04 +0200 Subject: sourcestatistics In-Reply-To: Message-ID: Hi Ho Fei On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > We've been trying to use sourcestatistics.m but I found that first > of all a > few private functions are missing. These include: > sourcestatistics_parametric.m > sourcestatistics_randomization.m > and sourcestatistics_randcluster.m There are different methods available for statistical assesements of differences between conditions, most of them are implemented for all different data types, namely ERPs TFRs and source reconstructions. These are implemented as submethods of the sourcestatistics, freqstatistics and timelockstatistics functions. These functions will call the appropritate subfunction, and these are missing. Some of the subfunctions are still work in progress and are not part of the release version of fieldtrip (because of scientific novelty). However, there are also a few subfunctions that are supposed to be part of the release version. I just checked and they are indeed not part of the current zip file any more. I will make sure to include them in the upcoming daily version. Furthermore, I will also send them to you as attachement in a separate mail (probably tomorrow). > Another problem occurred when we tried to set the cfg.approach to > 'stat': > ... > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 > if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos)~=length > (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) That is indeed a bug. Please change the last part of the statement from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos (:)==varargin{1}.pos(:))". I will fix it in the official version as well. best regards, Robert PS Sorry for my late reply, I was on the SPR conference. From h.f.kwok at BHAM.AC.UK Mon Sep 26 16:09:28 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Mon, 26 Sep 2005 15:09:28 +0100 Subject: sourcestatistics: another bug/problem In-Reply-To: Message-ID: Dear Robert, Thanks. I have changed line 65 of the statistic_wrapper.m but encountered the following error: ??? Reference to non-existent field 'design'. Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 design = cfg.design; Error in ==> sourcestatistics at 86 stat = statistics_wrapper(cfg, varargin{:}); The problem seems to arise from the fact that while calling the source_statistics, 'design' is not one of the fields that one has to specify. Regards, Hoi Fei -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: 26 September 2005 14:33 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] sourcestatistics Hi Ho Fei On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > We've been trying to use sourcestatistics.m but I found that first > of all a > few private functions are missing. These include: > sourcestatistics_parametric.m > sourcestatistics_randomization.m > and sourcestatistics_randcluster.m There are different methods available for statistical assesements of differences between conditions, most of them are implemented for all different data types, namely ERPs TFRs and source reconstructions. These are implemented as submethods of the sourcestatistics, freqstatistics and timelockstatistics functions. These functions will call the appropritate subfunction, and these are missing. Some of the subfunctions are still work in progress and are not part of the release version of fieldtrip (because of scientific novelty). However, there are also a few subfunctions that are supposed to be part of the release version. I just checked and they are indeed not part of the current zip file any more. I will make sure to include them in the upcoming daily version. Furthermore, I will also send them to you as attachement in a separate mail (probably tomorrow). > Another problem occurred when we tried to set the cfg.approach to > 'stat': > ... > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 > if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos)~=length > (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) That is indeed a bug. Please change the last part of the statement from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos (:)==varargin{1}.pos(:))". I will fix it in the official version as well. best regards, Robert PS Sorry for my late reply, I was on the SPR conference. From andrew at AUDIOSPEECH.UBC.CA Mon Sep 26 18:26:36 2005 From: andrew at AUDIOSPEECH.UBC.CA (Andrew Dimitrijevic) Date: Mon, 26 Sep 2005 09:26:36 -0700 Subject: beginner problems Message-ID: Hi, I just downloaded fieldtrip and I'm trying the "Example MATLAB scripts" off the website I'm using matlab 7, the data "subject01.ds" is an unzipped folder in the main fieldtrip folder. (I guess CTF data is a folder?... I usually use Neuroscan CNT files.... but I'm guessing thats how CTF saves thier data) Here's the diary output: cfg = []; cfg.channel = {'MEG' 'STIM'}; cfg.dataset = 'Subject01.ds'; cfg.trialdef.excludeConditions = {'BAD'}; cfg.trialdef.includeTrigger = 3; % Define trigger cfg.blc = 'yes'; % baseline correction cfg.blcwindow = [-0.2 0]; % baseline correction window cfg.lpfilter = 'yes' % low-pass filter cfg = channel: {'MEG' 'STIM'} dataset: 'Subject01.ds' trialdef: [1x1 struct] blc: 'yes' blcwindow: [-0.2000 0] lpfilter: 'yes' cfg.lpfreq = 35; % low-pass filter of 35 Hertz cfg.padding = 0; % do not pad trials dataFIC = preprocessing(cfg); % process... evaluating trialfunction 'trialfun_ctf_epoched' ??? Error using ==> nargout Not a valid M-file. Error in ==> definetrial at 141 num = nargout(cfg.trialfun); Error in ==> preprocessing at 263 [cfg] = definetrial(cfg); Should there be an m-file: 'trialfun_ctf_epoched.m'? - if so I can't find it in any (sub)directories. Thanks Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak at TECHUNIX.TECHNION.AC.IL Tue Sep 27 14:47:00 2005 From: litvak at TECHUNIX.TECHNION.AC.IL (Litvak Vladimir) Date: Tue, 27 Sep 2005 15:47:00 +0300 Subject: Custom layout Message-ID: Hi, I'm working on some data recorded with custom EEG cap (electrodes locations in two formats attached). Can you please make for me or tell me how to make a layout file for topoplot functions out of this? Thanks, Vladimir -------------- next part -------------- A non-text attachment was scrubbed... Name: fin.sfp Type: application/octet-stream Size: 2598 bytes Desc: URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fin.elp Type: application/octet-stream Size: 1550 bytes Desc: URL: From r.oostenveld at FCDONDERS.RU.NL Thu Sep 29 09:31:41 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Sep 2005 09:31:41 +0200 Subject: Current of source In-Reply-To: Message-ID: Hi Mikhail On 19-sep-2005, at 17:38, Mikhail Zvyagintsev wrote: > as I found dipolefitting.m calculates just dipole moment. Do you > have any > routines to transform dipole moment to the electrical current? I > looked > through the FieldTrip, but I did not find it. Current in the brain is not like current through a wire, therefore you cannot express it in Ampere alone. You can either express it as current density (i.e. current per unit of volume) if you compute a distributed source reconstruction or as dipole moment for a sparse source reconstruction. A current dipole consists of a source at the dendrite and a sink at the soma (or the other way around, depending on whether it is an exitatory or inhibitory synaps). The current source and sink together form the dipole. The distance between source and sink determine the impact that the current generator has on the secondary currents in the surrounding tissue. E.g. if the distance were zero, there would be no impact at all. Therefore the current is normalised for the distance between the two, i.e. source strenght is expressed in Ampere times meter. If you make the distance twice as small, and the current flowing from the source to the sink twice as large, the impact on the secondary currents in the surrounding tissue remains the same, just as the dipole moment. > Accordingly to my previous question (I mean how to deal with > dipolefitting.m > and dataset from example) - it works now, but I would still wait > for your > recomendation how to use it properly in this special case. > Another question is - how would you recommend to estimate activity of > auditoria dipoles? Does nonlinear algorithm make any difference if > I would > do it separately - one after another one or it is always better to > estimate > them both in the same time? Some time they are not in exactly > simmetrical > positions... And if I estimate them one after another one, how > should I > project out the contribution of the first source from the measured > signal? In EEG (AEPs), you are required to estimate them simultaneously, since they both project to a vertex extremum. In MEG, you can try to estimate them separate, by taking subselections of sensors over both hemispheres. Even then, about 10% of the field of the left auditory dipole is still visible over the right hemisphere (if I recall correctly). That means that in MEG you better also estimate them simultaneously. You can start the estimation with a symemtry constraint, and then use the positions of the symmetric dipole pair as the initial guess in an unconstrained optimalisation. If you have a single dipole model for your data, you can subtract the model field distribution from the observed, and then continue with the residual field. However, that is not optimal, since the field of the first dipole is not orthogonal to the second dipole, and hence you are subtracting part of the activity of the second dipole as well. best regards, Robert ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From r.oostenveld at FCDONDERS.RU.NL Thu Sep 29 09:46:55 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Sep 2005 09:46:55 +0200 Subject: Custom layout In-Reply-To: Message-ID: Hi Vladimir, On 27-sep-2005, at 14:47, Litvak Vladimir wrote: > I'm working on some data recorded with custom EEG cap (electrodes > locations in > two formats attached). Can you please make for me or tell me how to > make a > layout file for topoplot functions out of this? The BESA sfp format is supported by Fieldtrip. You can use read_fcdc_elec on that file, or in this case, you can specify cfg.layout='fin.sfp' in the plotting functions. For an optimal layout, especially for the multiplotXX functions, you probably should make a *.lay file manually (the layout file specifies the 2D location and the size of each subplot), but for topoplotXXX the automatic layout that you get with cfg.layout='fin.sfp' probably will be sufficient. best Robert From r.oostenveld at FCDONDERS.RU.NL Thu Sep 29 09:51:17 2005 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 29 Sep 2005 09:51:17 +0200 Subject: sourcestatistics: another bug/problem In-Reply-To: <000001c5c2a3$e884c400$e516bc93@universi8ef8be> Message-ID: Hi Ho Fei, You have to specify the experimental design in cfg.design, similar to the design matrix in SPM. You have multiple source volumes, one for each subject and condition. For each source volume you have to give the condition label (as a number), i.e. the length of cfg.design equals the number of source volumes and the number of unique elements equals the number of conditions. You can also use more elaborate design matrices with multiple rows, one row for one each factor, but it you are not familiar with design matrices, I would not try that immediately. best regards, Robert On 26-sep-2005, at 16:09, Hoi Fei Kwok wrote: > Dear Robert, > > Thanks. I have changed line 65 of the statistic_wrapper.m but > encountered > the following error: > > ??? Reference to non-existent field 'design'. > > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 > design = cfg.design; > > Error in ==> sourcestatistics at 86 > stat = statistics_wrapper(cfg, varargin{:}); > > The problem seems to arise from the fact that while calling the > source_statistics, 'design' is not one of the fields that one has to > specify. > > Regards, > Hoi Fei > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Robert Oostenveld > Sent: 26 September 2005 14:33 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] sourcestatistics > > Hi Ho Fei > > On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > >> We've been trying to use sourcestatistics.m but I found that first >> of all a >> few private functions are missing. These include: >> sourcestatistics_parametric.m >> sourcestatistics_randomization.m >> and sourcestatistics_randcluster.m >> > > There are different methods available for statistical assesements of > differences between conditions, most of them are implemented for all > different data types, namely ERPs TFRs and source reconstructions. > These are implemented as submethods of the sourcestatistics, > freqstatistics and timelockstatistics functions. These functions will > call the appropritate subfunction, and these are missing. Some of the > subfunctions are still work in progress and are not part of the > release version of fieldtrip (because of scientific novelty). > However, there are also a few subfunctions that are supposed to be > part of the release version. I just checked and they are indeed not > part of the current zip file any more. I will make sure to include > them in the upcoming daily version. Furthermore, I will also send > them to you as attachement in a separate mail (probably tomorrow). > > >> Another problem occurred when we tried to set the cfg.approach to >> 'stat': >> ... >> Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 >> if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos) >> ~=length >> (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) >> > > That is indeed a bug. Please change the last part of the statement > from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos > (:)==varargin{1}.pos(:))". I will fix it in the official version as > well. > > best regards, > Robert > > PS Sorry for my late reply, I was on the SPR conference. > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From h.f.kwok at BHAM.AC.UK Thu Sep 29 10:10:14 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Thu, 29 Sep 2005 09:10:14 +0100 Subject: sourcestatistics: another bug/problem In-Reply-To: <47B77A8E-50C4-4242-A132-A2223D98C664@fcdonders.ru.nl> Message-ID: Thanks, Robert, I raised this partly because in the help documentation of the file sourcestatistics, the field 'design' wasn't mentioned. Perhaps it will be clearer for the users if this is explicitly mentioned. By the way, what are the allowable values for the field 'design'? Regards, Hoi Fei -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: 29 September 2005 08:51 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] sourcestatistics: another bug/problem Hi Ho Fei, You have to specify the experimental design in cfg.design, similar to the design matrix in SPM. You have multiple source volumes, one for each subject and condition. For each source volume you have to give the condition label (as a number), i.e. the length of cfg.design equals the number of source volumes and the number of unique elements equals the number of conditions. You can also use more elaborate design matrices with multiple rows, one row for one each factor, but it you are not familiar with design matrices, I would not try that immediately. best regards, Robert On 26-sep-2005, at 16:09, Hoi Fei Kwok wrote: > Dear Robert, > > Thanks. I have changed line 65 of the statistic_wrapper.m but > encountered > the following error: > > ??? Reference to non-existent field 'design'. > > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 > design = cfg.design; > > Error in ==> sourcestatistics at 86 > stat = statistics_wrapper(cfg, varargin{:}); > > The problem seems to arise from the fact that while calling the > source_statistics, 'design' is not one of the fields that one has to > specify. > > Regards, > Hoi Fei > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Robert Oostenveld > Sent: 26 September 2005 14:33 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] sourcestatistics > > Hi Ho Fei > > On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > >> We've been trying to use sourcestatistics.m but I found that first >> of all a >> few private functions are missing. These include: >> sourcestatistics_parametric.m >> sourcestatistics_randomization.m >> and sourcestatistics_randcluster.m >> > > There are different methods available for statistical assesements of > differences between conditions, most of them are implemented for all > different data types, namely ERPs TFRs and source reconstructions. > These are implemented as submethods of the sourcestatistics, > freqstatistics and timelockstatistics functions. These functions will > call the appropritate subfunction, and these are missing. Some of the > subfunctions are still work in progress and are not part of the > release version of fieldtrip (because of scientific novelty). > However, there are also a few subfunctions that are supposed to be > part of the release version. I just checked and they are indeed not > part of the current zip file any more. I will make sure to include > them in the upcoming daily version. Furthermore, I will also send > them to you as attachement in a separate mail (probably tomorrow). > > >> Another problem occurred when we tried to set the cfg.approach to >> 'stat': >> ... >> Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 >> if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos) >> ~=length >> (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) >> > > That is indeed a bug. Please change the last part of the statement > from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos > (:)==varargin{1}.pos(:))". I will fix it in the official version as > well. > > best regards, > Robert > > PS Sorry for my late reply, I was on the SPR conference. > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ From h.f.kwok at BHAM.AC.UK Thu Sep 29 10:13:42 2005 From: h.f.kwok at BHAM.AC.UK (Hoi Fei Kwok) Date: Thu, 29 Sep 2005 09:13:42 +0100 Subject: sourcestatistics: another bug/problem In-Reply-To: <47B77A8E-50C4-4242-A132-A2223D98C664@fcdonders.ru.nl> Message-ID: Hi, Robert, Sorry about this but after I've sent my previous post, I noticed from your post that it seems a bit clearer now the field 'design' refers to the design matrix and not the type of the design. Thanks. Hoi Fei -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Robert Oostenveld Sent: 29 September 2005 08:51 To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] sourcestatistics: another bug/problem Hi Ho Fei, You have to specify the experimental design in cfg.design, similar to the design matrix in SPM. You have multiple source volumes, one for each subject and condition. For each source volume you have to give the condition label (as a number), i.e. the length of cfg.design equals the number of source volumes and the number of unique elements equals the number of conditions. You can also use more elaborate design matrices with multiple rows, one row for one each factor, but it you are not familiar with design matrices, I would not try that immediately. best regards, Robert On 26-sep-2005, at 16:09, Hoi Fei Kwok wrote: > Dear Robert, > > Thanks. I have changed line 65 of the statistic_wrapper.m but > encountered > the following error: > > ??? Reference to non-existent field 'design'. > > Error in ==> fieldtrip-20050901\private\statistics_wrapper at 98 > design = cfg.design; > > Error in ==> sourcestatistics at 86 > stat = statistics_wrapper(cfg, varargin{:}); > > The problem seems to arise from the fact that while calling the > source_statistics, 'design' is not one of the fields that one has to > specify. > > Regards, > Hoi Fei > > > -----Original Message----- > From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] > On Behalf > Of Robert Oostenveld > Sent: 26 September 2005 14:33 > To: FIELDTRIP at NIC.SURFNET.NL > Subject: Re: [FIELDTRIP] sourcestatistics > > Hi Ho Fei > > On 16-sep-2005, at 12:08, Hoi Fei Kwok wrote: > >> We've been trying to use sourcestatistics.m but I found that first >> of all a >> few private functions are missing. These include: >> sourcestatistics_parametric.m >> sourcestatistics_randomization.m >> and sourcestatistics_randcluster.m >> > > There are different methods available for statistical assesements of > differences between conditions, most of them are implemented for all > different data types, namely ERPs TFRs and source reconstructions. > These are implemented as submethods of the sourcestatistics, > freqstatistics and timelockstatistics functions. These functions will > call the appropritate subfunction, and these are missing. Some of the > subfunctions are still work in progress and are not part of the > release version of fieldtrip (because of scientific novelty). > However, there are also a few subfunctions that are supposed to be > part of the release version. I just checked and they are indeed not > part of the current zip file any more. I will make sure to include > them in the upcoming daily version. Furthermore, I will also send > them to you as attachement in a separate mail (probably tomorrow). > > >> Another problem occurred when we tried to set the cfg.approach to >> 'stat': >> ... >> Error in ==> fieldtrip-20050901\private\statistics_wrapper at 65 >> if isfield(varargin{1}, 'pos') && (length(varargin{i}.pos) >> ~=length >> (varargin{1}.pos) || ~all(varargin{i}.pos==varargin{1}.pos)) >> > > That is indeed a bug. Please change the last part of the statement > from "all(varargin{i}.pos==varargin{1}.pos)" into "all(varargin{i}.pos > (:)==varargin{1}.pos(:))". I will fix it in the official version as > well. > > best regards, > Robert > > PS Sorry for my late reply, I was on the SPR conference. > > ======================================================= Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/