From roberto at SMI.AUC.DK Mon Nov 1 09:15:41 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Mon, 1 Nov 2004 09:15:41 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FC9A1@nihexchange17.nih.gov> Message-ID: Dear Masao I cannot give a recoomendation for the interpolation method to use to compute the planar gradients. Most people at the Donders are using 'orig, buy I found myself that the 'sincos' seemed to be the most accurate. I expect that the 'fitplane' will work less wel at the boundary of the helmet. The proper way to evaluate these different methods would be to use them on simulated data, since it probably will depend on the source location and amount of noise. Important to realise is that they all do something with your data which migh or might not be desirable. It makes the topographic display of the data easier to interpret (desirable), but makes it also more noise sensitive and introduces linear dependencies in neighbouring channels which were not neccessary present in the original data (undesirable). When possible, I personally try to avoid it. But people who are used to the Neuromag system probably will be biassed the other way around, and try to use it whenever possible. best regards, Robert On 31 Oct 2004, at 20:32, Matsuhashi, Masao (NIH/NINDS) wrote: > 2. Do you have any suggestion which of three simple interpolation > method > ('orig' | 'sincos' | 'fitplane') to use in megplanar? > The 'orig' method requires less memory, but seems less reliable.... I > checked with SEF N20m data and the 'orig' method produced four peaks > in the > gradient contour map. The 'fitplane' seems best among the three in this > respect, am I right? > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From t.montez at VUMC.NL Tue Nov 2 16:54:46 2004 From: t.montez at VUMC.NL (Montez, T.) Date: Tue, 2 Nov 2004 16:54:46 +0100 Subject: resampledata Message-ID: Hi, Using the code: addpath E:\Matlab\fieldtrip-0.9.2 % READING THE DATA hdr = read_fcdc_header('E:\Matlab\Data\A012-4channels.ds\A012-4channels.res4'); dat = read_fcdc_data('E:\Matlab\Data\A012-4channels.ds\A012-4channels.meg4', hdr, 1, 4096); cfg = []; cfg.dataset = 'E:\Matlab\Data\A012-4channels.ds' cfg.trl=[1 4096 0] cfg.channel='MEG' datatest = preprocessing(cfg) save ('E:\Matlab\Data\Test\datatest') % FILTERING AND RESAMPLE cfg.lpfreq = 13 cfg.resamplefs = 250 datatest_filtered = resampledata(cfg, datatest) cfg.hpfreq = 8 datatest_filtered = preprocessing(cfg) save ('E:\Matlab\Data\Test\datatest_filtered') I get the error: % ??? Error using ==> preprocessing % resampling is not supported any more, see RESAMPLEDATA However it seem to work: >> datatest_filtered datatest_filtered = cfg: [1x1 struct] hdr: [1x1 struct] label: {4x1 cell} trial: {[4x1639 double]} offset: 0 time: {[1x1639 double]} fsample: 250 grad: [1x1 struct] origfsample: 625 origoffset: 0 origtime: {[1x4096 double]} >> cfg cfg = dataset: 'E:\Matlab\Data\A012-4channels.ds' trl: [1 4096 0] channel: 'MEG' lpfreq: 13 resamplefs: 250 hpfreq: 8 I am skipping cfg.detrend ='yes' because it is the default. Should I use cfg.downsample=X; instead of resampledata? The file resampledata.m does not appear in the reference documentation list of the FieldTrip webpage. Thanks, Teresa Montez From roberto at SMI.AUC.DK Tue Nov 2 17:56:18 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Tue, 2 Nov 2004 17:56:18 +0100 Subject: resampledata In-Reply-To: <04Nov2.165722cet.334410@nucleus.azvu.nl> Message-ID: Hi Teresa Reading through your screen output, I notice that you are reusing the same variable name. I.e. you are doing cfg = something datatest = preprocessing, no problem datatest_filtered = resampledata, also works fine then you do cfg = something else, including resamplefs datatest_filtered = preprocessing -> gives error Subsequently you appear supprised that datatest_filtered exists, but it was the result of the first call to resampledata, and not to the second call to preprocessing. The 2nd preprocessing gave an error and did not overwrite the variable. In the old days, resampling used to be done inside preprocessing, but it actually was a separate function right from its initial implementation. Conceptually it makes sense to think of resampling/downsampling as part of the preprocessing, but it never was implemented optimally in preprocessing. Therefore it was taken out of the preprocessing. To ensure that people with old configurations do not incorrectly assume that their preprocessed data is downsampled, it gives an error if you try to resample/downsample with the preprocessing function. Instead you should call preprocessing, and then call resampledata like cfgpre = something data = preprocessing(cfgpre); cfgdwn = [] cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, data); clear data or in one line as cfgpre = something cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, preprocessing(cfgpre)); Another hint: if you want to check what configuration was really used in any fieldtrip analysis step, you should look at the configuration that is contained in the output data. I will try to implement a more thorough warning/error system for configuration fields that are not being used by a specific function. > I am skipping cfg.detrend ='yes' because it is the default. The default (of any fieldtrip function) is not neccesary what you want. Please think about what you want and specify it. Also remember that defaults can change between versions. For ERPs you probably do not want to detrend the data prior to downsampling (but you do want to baselinecorrect with the proper baseline window), for TFRs it does not really matter too much and it might be advantageous to detrend. Actually, I don't think that in this case the default is the best option in general. > Should I use cfg.downsample=X; instead of resampledata? No, that is not an option for preprocessing, nor for resampledata. > The file resampledata.m does not appear in the reference documentation > list > of the FieldTrip webpage. I'll add it in a future version of the documentation. Thanks for letting me know. You get the most up to date documentation of any fieldtrip function by typing "help functionname". You will see from the documentation that cfg.resamplefs is NOT an option for preprocessing, and also that cfg.lpfreq is not an option for resampledata (you specified it incorerctly in the cfg in your mail). best regards, Robert PS Attached you will find the most recent version of resampledata, a small bug in the re-computation of the time axis has been fixed. Also the help has been updated. -------------- next part -------------- A non-text attachment was scrubbed... Name: resampledata.m Type: application/octet-stream Size: 2567 bytes Desc: not available URL: -------------- next part -------------- On 2 Nov 2004, at 16:54, Montez, T. wrote: > Hi, > > Using the code: > > > addpath E:\Matlab\fieldtrip-0.9.2 > > % READING THE DATA > > hdr = > read_fcdc_header('E:\Matlab\Data\A012-4channels.ds\A012 > -4channels.res4'); > dat = > read_fcdc_data('E:\Matlab\Data\A012-4channels.ds\A012-4channels.meg4', > hdr, 1, 4096); > > cfg = []; > > cfg.dataset = 'E:\Matlab\Data\A012-4channels.ds' > cfg.trl=[1 4096 0] > > cfg.channel='MEG' > > datatest = preprocessing(cfg) > save ('E:\Matlab\Data\Test\datatest') > > % FILTERING AND RESAMPLE > > cfg.lpfreq = 13 > > cfg.resamplefs = 250 > datatest_filtered = resampledata(cfg, datatest) > > cfg.hpfreq = 8 > > datatest_filtered = preprocessing(cfg) > save ('E:\Matlab\Data\Test\datatest_filtered') > > > I get the error: > > > % ??? Error using ==> preprocessing > % resampling is not supported any more, see RESAMPLEDATA > > > > However it seem to work: > > >>> datatest_filtered > > datatest_filtered = > > cfg: [1x1 struct] > hdr: [1x1 struct] > label: {4x1 cell} > trial: {[4x1639 double]} > offset: 0 > time: {[1x1639 double]} > fsample: 250 > grad: [1x1 struct] > origfsample: 625 > origoffset: 0 > origtime: {[1x4096 double]} > >>> cfg > > cfg = > > dataset: 'E:\Matlab\Data\A012-4channels.ds' > trl: [1 4096 0] > channel: 'MEG' > lpfreq: 13 > resamplefs: 250 > hpfreq: 8 > > > I am skipping cfg.detrend ='yes' because it is the default. > > Should I use cfg.downsample=X; instead of resampledata? > > The file resampledata.m does not appear in the reference documentation > list > of the FieldTrip webpage. > > > Thanks, > Teresa Montez > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From rajamoni at CCS.FAU.EDU Wed Nov 3 15:48:50 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Wed, 3 Nov 2004 09:48:50 -0500 Subject: Coherent sources Message-ID: Is it possible to compute coherence (sources) for more than one reference dipoles (i.e, network) using Fieltrip? ______________________________________________ R. Sreenivasan, Ph.D. Center for Complex Systems & Brain Sciences 777 Glades Road, Florida Atlantic University Boca Raton, FL 33431 Phone: 561-297-0111 (off) 561-367-0857 (home) Fax: 561-297-3634 e-mail: rajamoni at ccs.fau.edu ______________________________________________ From matsuham at NINDS.NIH.GOV Thu Nov 4 04:06:03 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Wed, 3 Nov 2004 22:06:03 -0500 Subject: freqdescriptives Message-ID: Dear Robert, Thank you for the comment. This kind of information is very helpful. Since I was grown up with Neuromag122 but now using Omega, I have to try not to be biased as such. The simulation is certainly one important thing to do. I will ask our MEG scientist. Additional question. What is the unit/dimension of the source activity calculated by sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate->sliceinterp? It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar showed something like 0 to 20 and 0 to 140. It seems like absolute or power of cross-spectra.... Regards, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From tomh at KURAGE.NIMH.NIH.GOV Thu Nov 4 05:07:41 2004 From: tomh at KURAGE.NIMH.NIH.GOV (Tom Holroyd) Date: Wed, 3 Nov 2004 23:07:41 -0500 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCD6B@nihexchange17.nih.gov> Message-ID: > The simulation is certainly one important thing to do. I will ask our MEG > scientist. Hmm. I guess that's me. :-) I may as well mention here, that there's a VSM(CTF) program called "dsim" which can add a given simulated dipole (or several) to an existing dataset. You can either start with an empty sensor noise recording, or live data. Then see if you can find it again. :-) See also dsim -help. Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce From roberto at SMI.AUC.DK Thu Nov 4 09:35:00 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:35:00 +0100 Subject: Coherent sources In-Reply-To: <004101c4c1b4$3b3a0a30$3c1e5b83@vasan> Message-ID: Hi, On 3 Nov 2004, at 15:48, R. Sreenivasan wrote: > Is it possible to compute coherence (sources) for more than one > reference > dipoles (i.e, network) using Fieltrip? It is not possible to compute it with the frequency implementation of the beamformer (i.e. DICS). However, you could use the following approach - PREPROCESSING - TIMELOCKANALYSIS using a bandpass filter (which is a hidden option) in the frequency band of interest (not too narrow), with covariance=yes and keeptrials=yes - SOURCEANALYSIS with method=lcmv and singletrial=yes, with cfg.grid.pos equal to the locations of interest - FREQANALYSIS on the output of sourceanalysis, i.e. analyze the virtual channel that was constructed on each location of interest with output=powandcsd - FREQDESCRIPTIVES The sourceanalysis with method=lcmv and singletrial=yes will compute the average covariance matrix from your data and use that to construct the spatial filter. Subsequently the spatial filter is applied to each trial seperately. The reason for averaging the trials prior to applying the filters to the individual trials is that each individual trial covariance is probably rank deficient, and will at least be pooirly estimated resulting in poorly defined spatial filters. However, the spatial filter can be determined robustly from the average. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Thu Nov 4 09:49:14 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:49:14 +0100 Subject: freqdescriptives In-Reply-To: Message-ID: Hi Tom, Thanks for the hint. There is also a DIPOLESIMULATION function in FieldTrip. You probably will want to look into "private/axial2planar" as well. I suppose that the most meaningfull simulation will be one in which you compute forward on a axial gradiometer system, and on a planar system. Then try MEGPLANAR to convert the axial data to estimated planar data, and compare with real planar data. See the attached script, which basically does it all... I am curious as to what it will bring for different source parameters and levels of simulated and real physiological (i.e. spatially correlated) noise. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: test_RO_014.m Type: application/octet-stream Size: 2227 bytes Desc: not available URL: -------------- next part -------------- On 4 Nov 2004, at 5:07, Tom Holroyd wrote: >> The simulation is certainly one important thing to do. I will ask our >> MEG >> scientist. > > Hmm. I guess that's me. :-) I may as well mention here, that > there's a VSM(CTF) program called "dsim" which can add a given > simulated dipole (or several) to an existing dataset. You can > either start with an empty sensor noise recording, or live data. > Then see if you can find it again. :-) > > See also dsim -help. From roberto at SMI.AUC.DK Thu Nov 4 09:21:31 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:21:31 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCD6B@nihexchange17.nih.gov> Message-ID: Hi Masao, On 4 Nov 2004, at 4:06, Matsuhashi, Masao (NIH/NINDS) wrote: > Additional question. What is the unit/dimension of the source activity > calculated by > sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate- > >sliceinterp? > It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar > showed something like 0 to 20 and 0 to 140. It seems like absolute or > power > of cross-spectra.... The unit depends on what estimated source parameter you are looking at: source.avg.pow is dipole power, which is expressible in (nAm)^2. But since Fieldtrip is unaware of the physical units of all the "dataobjects" (volume conductor, data, sensor geometry) that go into the computation, the result should be interpreted as arbitrary units. source.avg.coh is the coherence, which is equal to the squared coherency. Both coherence and coherency are between 0 and 1. source.avg.noise is the estimated projected noise, where the noise is assumed to be uncorrelated and of equal magnitude between channels and where the amplitude of the noise is scaled with the smallest singular value of the cross-spectral density matrix. The projected noise has the same units as the power, i.e. arbitrary units in principle. After sourcedecriptives, source.avg.nai equals the neural activity index, which is defined as pow/noise. It is dimensionless and always >=0. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From Johannes.Sarnthein at USZ.CH Thu Nov 4 10:35:35 2004 From: Johannes.Sarnthein at USZ.CH (Sarnthein Johannes) Date: Thu, 4 Nov 2004 10:35:35 +0100 Subject: AW: [FIELDTRIP] freqdescriptives Message-ID: Dear Robert, there is too much traffic, please unsubscribe me from the fieldtrip list. I enjoy using your dipfit with EEGLAB. Looking forward to your comments in the EEGLAB list. Best, Johannes -----Ursprüngliche Nachricht----- Von: Robert Oostenveld [mailto:roberto at SMI.AUC.DK] Gesendet: Donnerstag, 4. November 2004 09:22 An: FIELDTRIP at nic.surfnet.nl Betreff: Re: [FIELDTRIP] freqdescriptives Hi Masao, On 4 Nov 2004, at 4:06, Matsuhashi, Masao (NIH/NINDS) wrote: > Additional question. What is the unit/dimension of the source activity > calculated by > sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate- > >sliceinterp? > It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar > showed something like 0 to 20 and 0 to 140. It seems like absolute or > power > of cross-spectra.... The unit depends on what estimated source parameter you are looking at: source.avg.pow is dipole power, which is expressible in (nAm)^2. But since Fieldtrip is unaware of the physical units of all the "dataobjects" (volume conductor, data, sensor geometry) that go into the computation, the result should be interpreted as arbitrary units. source.avg.coh is the coherence, which is equal to the squared coherency. Both coherence and coherency are between 0 and 1. source.avg.noise is the estimated projected noise, where the noise is assumed to be uncorrelated and of equal magnitude between channels and where the amplitude of the noise is scaled with the smallest singular value of the cross-spectral density matrix. The projected noise has the same units as the power, i.e. arbitrary units in principle. After sourcedecriptives, source.avg.nai equals the neural activity index, which is defined as pow/noise. It is dimensionless and always >=0. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Thu Nov 4 11:00:43 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 11:00:43 +0100 Subject: AW: [FIELDTRIP] freqdescriptives In-Reply-To: <2B9546F31DBA5A41A7C0F5D70A31999002422F0A@DS-00181.usz.ch> Message-ID: Dear Johannes (and other subscribers) On http://nic.surfnet.nl/archives/fieldtrip.html you can unsubscribe yourself or, alternatively, you can switch to digest mode. Also other configuration options can be set there, and help is provided for the different list options. best regards, Robert On 4 Nov 2004, at 10:35, Sarnthein Johannes wrote: > Dear Robert, > there is too much traffic, please unsubscribe me from the fieldtrip > list. > I enjoy using your dipfit with EEGLAB. > Looking forward to your comments in the EEGLAB list. > Best, > Johannes From rajamoni at CCS.FAU.EDU Thu Nov 4 20:57:09 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Thu, 4 Nov 2004 14:57:09 -0500 Subject: Coherent sources Message-ID: Hi Robert, I find it difficult to figure out the hidden option of the frequency in timelockanalysis. Would you please send me a sample script? Thanks Best regards, Sreenivasan ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Thursday, November 04, 2004 3:35 AM Subject: Re: [FIELDTRIP] Coherent sources > Hi, > > On 3 Nov 2004, at 15:48, R. Sreenivasan wrote: > > > Is it possible to compute coherence (sources) for more than one > > reference > > dipoles (i.e, network) using Fieltrip? > > It is not possible to compute it with the frequency implementation of > the beamformer (i.e. DICS). However, you could use the following > approach > > - PREPROCESSING > - TIMELOCKANALYSIS using a bandpass filter (which is a hidden option) > in the frequency band of interest (not too narrow), with covariance=yes > and keeptrials=yes > - SOURCEANALYSIS with method=lcmv and singletrial=yes, with > cfg.grid.pos equal to the locations of interest > - FREQANALYSIS on the output of sourceanalysis, i.e. analyze the > virtual channel that was constructed on each location of interest with > output=powandcsd > - FREQDESCRIPTIVES > > The sourceanalysis with method=lcmv and singletrial=yes will compute > the average covariance matrix from your data and use that to construct > the spatial filter. Subsequently the spatial filter is applied to each > trial seperately. The reason for averaging the trials prior to applying > the filters to the individual trials is that each individual trial > covariance is probably rank deficient, and will at least be pooirly > estimated resulting in poorly defined spatial filters. However, the > spatial filter can be determined robustly from the average. > > > best regards, > Robert > > ---------------------------------------------------------------------- > Robert Oostenveld, PhD > Center for Sensory-Motor Interaction (SMI) > Aalborg University, Denmark > > and > > F.C. Donders Centre for Cognitive Neuroimaging > University Nijmegen > P.O. Box 9101 > NL-6500 AH Nijmegen > The Netherlands > > Tel: +31 (0)24 3619695 > Fax: +31 (0)24 3610989 > ---------------------------------------------------------------------- > N.B. Starting from 1 September 2004, the University of Nijmegen has > changed its name to Radboud University Nijmegen. All web- and > email-addresses ending in ".kun.nl" should therefore be changed into > ".ru.nl". Please update your address book and links. From matsuham at NINDS.NIH.GOV Fri Nov 5 01:16:44 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Thu, 4 Nov 2004 19:16:44 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, Let the output of sourceinterpolate as SI, then the SI.avg contains only one field, 'coh'. The elements of SI.avg.coh are way larger than 1, so they must be the neural activity index, am I correct? Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From matsuham at NINDS.NIH.GOV Fri Nov 5 01:21:37 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Thu, 4 Nov 2004 19:21:37 -0500 Subject: freqdescriptives Message-ID: Hi Robert, Tom said that we do not have the read_ctf_res4.m script that is called in your test_RO_014.m script. Would you tell us how can we get one, or any replacements? Regards, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From roberto at SMI.AUC.DK Fri Nov 5 08:49:02 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:49:02 +0100 Subject: Coherent sources In-Reply-To: <005201c4c2a8$7822d720$3c1e5b83@vasan> Message-ID: Hi Sreenivasan The bandpass filter options in timelockanalysis have the same config as those in preprocessing. If you open timelockanalysis in the editor, and jump to the first comments after the initial help block (in my version it is around line 42), you will see % Undocumented options: % cfg.blc = 'no' or 'yes' % cfg.blcwindow = [begin end] % cfg.bpfilter = 'no' or 'yes' % cfg.bpfreq = [low high] % cfg.bpfiltord = number giving the filter order % cfg.bpfilttype = 'but' or 'fir' % The filtering options are supported here only to compute the covariance % matrix in a specific frequency band while avoiding to do the preprocessing many times. I guess that that should suffice as explanation. Maybe some extra words on why they are hidden as option: in preprocessing you can pad the trial data with some extra data that also is read from the (continuous) file. After this (optional) padding, the data is filtered. That means that any filter artifacts will occur in the padded begin and end of the datasegment, and those "pads" are again removed after filtering. In timelockanalysis it is not possible to pad the data any more, hence filtering should preferably done when as much of the data is present. best regards, Robert On 4 Nov 2004, at 20:57, R. Sreenivasan wrote: > Hi Robert, > > I find it difficult to figure out the hidden option of the frequency in > timelockanalysis. Would you please send me a sample script? > > Thanks > Best regards, Sreenivasan ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From r.oostenveld at FCDONDERS.RU.NL Fri Nov 5 08:53:44 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:53:44 +0100 Subject: sourceinterpolate In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCE2F@nihexchange17.nih.gov> Message-ID: On 5 Nov 2004, at 1:16, Matsuhashi, Masao (NIH/NINDS) wrote: > Let the output of sourceinterpolate as SI, then the SI.avg contains > only one > field, 'coh'. The elements of SI.avg.coh are way larger than 1, so > they must > be the neural activity index, am I correct? For sourceinterpolate you have specified which parameter you wanted to be interpolated, i.e. you will have done cfg.parameter='coh'. Then only coherence is interpolated. If you do cfg.parameter='all', also power and nai (if present) will be interpolated. S1.avg.coh is coherence, and not nai. It being larger than one looks like a bug or an interpolation artifact. Can you check whether it is also larger than one in the non-interpolated source reconstruction? What version of fieldtrip, and specifically sourceanalysis are you using? Please look at source.cfg.version or S1.cfg.previous.version (i.e. the version of the previous step before interpolation). And what version of sourceinterpolate (S1.cfg.version)? Robert ---------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Fri Nov 5 08:55:36 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:55:36 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCE30@nihexchange17.nih.gov> Message-ID: Hi Masao, You will find it in fieldtrip/private. Just copy it from there to your working directory. Also copy the read_ctgf_res4.p file along (they go together). Robert On 5 Nov 2004, at 1:21, Matsuhashi, Masao (NIH/NINDS) wrote: > Tom said that we do not have the read_ctf_res4.m script that is called > in > your test_RO_014.m script. Would you tell us how can we get one, or any > replacements? ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From t.montez at VUMC.NL Fri Nov 5 15:36:43 2004 From: t.montez at VUMC.NL (Montez, T.) Date: Fri, 5 Nov 2004 15:36:43 +0100 Subject: resampledata/offset2time Message-ID: Hi Robert, After doing the changes you proposed: cfgpre = something data = preprocessing(cfgpre); cfgdwn = [] cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, data); I get the error message: ??? Undefined function or variable 'offset2time'. Error in ==> E:\Matlab\fieldtrip-0.9.2\resampledata.m On line 65 ==> data.time{itr} = offset2time(data.offset(itr), data.fsample, size(data.trial{itr},2)); Do I need the offset2time.m ? Best regards, Teresa From roberto at SMI.AUC.DK Fri Nov 5 16:28:12 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 16:28:12 +0100 Subject: resampledata/offset2time In-Reply-To: <04Nov5.153906cet.334940@nucleus.azvu.nl> Message-ID: On 5 Nov 2004, at 15:36, Montez, T. wrote: > ??? Undefined function or variable 'offset2time'. > > Do I need the offset2time.m ? Yes. That function should be in private, but it was added to private after release 0.9.2. Please upgrade to the latest version from the website (0.9.4), then copy the resampledata that I sent you as attachment into the fieldtrip directory, then it should work. best regards, Robert From luoj at MAIL.NIH.GOV Fri Nov 5 21:36:35 2004 From: luoj at MAIL.NIH.GOV (Luo, Jessie (NIH/NIMH)) Date: Fri, 5 Nov 2004 15:36:35 -0500 Subject: scanning next week Message-ID: Hi Tom, Thanks so much again for coming over for troubleshooting!! Also tahnks for the approval of our future scanning sessions. Our first scanning session is 1:00-5:00pm next Tuesday. Will you be around to help at that time? Some sujects might need glasses. Is this OK? Thanks, Jessie From matsuham at NINDS.NIH.GOV Sat Nov 6 21:45:03 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Sat, 6 Nov 2004 15:45:03 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, I tried with the following script: ==================================================== % load data segsize=5; % in seconds SampleRate=600; % per second DataLengthInPoints=144600; resolution=1; DS='X:/raid/meg/JATENWNT_track_20041022_01.ds'; mriFile='X:/raid/meg/TY20041022.mri'; localSpheres=[DS,'/localSpheres.hdm']; f=6; d=1; clear data cfg=[]; cfg.dataset=DS; cfg.trl=[[1:segsize*SampleRate:DataLengthInPoints-segsize*SampleRate+1]',... [segsize*SampleRate:segsize*SampleRate:DataLengthInPoints]',... zeros(fix(DataLengthInPoints/SampleRate/segsize),1)] cfg.channel='MEG' cfg.detrend='yes' data=preprocessing(cfg) %take some time, so do it only neccesory. drawnow % combine with ref signal w{dataset}(time,stim) load w; for loop = 1:length(data.trial) data.trial{loop}=[data.trial{loop};w{1}([1:segsize*SampleRate]+segsize*Sampl eRate*(loop-1),1)']; end data.label=[data.label;{'REF1'}]; % DICS step1 fourier transform cfg=[]; cfg.method = 'fft'; cfg.output = 'powandcsd' cfg.tapsmofrq=0.5; cfg.pad='maxperlen'; cfg.keeptrials = 'yes'; cfg.foilim = [f-0.2,f+0.2]; cfg.sgncmb = channelcombination({'MEG' 'MEG';'MEG' 'REF1'},data.label); [freqDICS01_060] = freqanalysis(cfg, data) drawnow % DICS step 2 source analysis cfg=[]; cfg.refchannel ='REF1'; cfg.method = 'coh_refchan'; cfg.projectnoise='yes'; cfg.hdmfile=localSpheres; cfg.frequency=f; cfg.lambda=1e-31; cfg.xgrid='auto'; cfg.ygrid='auto'; cfg.zgrid='auto'; cfg.resolution=resolution; cfg.keepleadfield='no'; source01_060=sourceanalysis(cfg,freqDICS01_060) drawnow sourceC01_060=sourcedescriptives(cfg,source01_060) drawnow % DICS step3 display cfg.downsample=2; cfg.parameter='coh'; cfg.funparameter='coh'; sourceInterp01_060=sourceinterpolate(cfg,source01_060,mriFile); drawnow figure; sliceinterp(cfg,sourceInterp01_060); set(gcf,'name',['DICS, Dataset ',d,', ',num2str(f),'Hz'],'NumberTitle','off') text(0,-20,['DICS, Dataset ',d,', ',num2str(f),'Hz']) cfg.parameter='coh'; sourceInterpC01_060=sourceinterpolate(cfg,sourceC01_060,mriFile); drawnow figure; sliceinterp(cfg,sourceInterpC01_060); set(gcf,'name',['DICS, Dataset ',d,', ',num2str(f),'Hz'],'NumberTitle','off') text(0,-20,['DICS, Dataset ',d,', ',num2str(f),'Hz']) ========================================== With FieldTrip 0.92, the resultant .coh is clearly above 1. ========================================== >> version ans = 7.0.0.19920 (R14) >> source01_060.avg ans = pow: [1x34580 double] coh: [1x34580 double] noise: [1x34580 double] >> source01_060.avg.coh(2000) ans = 9.6989 >> sourceC01_060.avg %% after sourcedescriptives ans = pow: [1x34580 double] coh: [1x34580 double] noise: [1x34580 double] nai: [1x34580 double] >> sourceC01_060.avg.coh(2000) ans = 9.6989 >> sourceC01_060.avg.nai(2000) ans = 2.1569e+012 >> sourceInterpC01_060.avg ans = coh: [128x128x128 double] >> sourceInterpC01_060.avg.coh(64,64,64) ans = 31.4140 >> sourceInterpC01_060.cfg.version ans = name: 'C:\MATLAB\fieldtrip\sourceinterpolate' id: '$Id: sourceinterpolate.m,v 1.15 2004/08/27 11:21:48 roboos Exp $' >> sourceInterpC01_060.cfg.previous{1}.version ans = name: 'C:\MATLAB\fieldtrip\sourcedescriptives' id: '$Id: sourcedescriptives.m,v 1.4.2.1 2004/09/03 07:17:41 roboos Exp $' ========================================== With FieldTrip 0.94, I had following error. ========================================== .... reading headmodel from file X:/raid/meg/JATENWNT_track_20041022_01.ds/localSpheres.hdm using gradiometers specified in the data selecting 274 first-order gradiometers creating headsurface based on multisphere model and gradiometers 2886 dipoles inside, 31694 dipoles outside brain ??? Undefined command/function 'mbrealvector'. Error in ==> fieldtrip\private\nearest at 14 mbrealvector(array) Error in ==> fieldtrip\private\prepare_freq_matrices at 68 fbin = nearest(freq.foi, cfg.frequency); Error in ==> sourceanalysis at 333 [Cf, Cr, Pr, Ntrials] = prepare_freq_matrices(cfg, freq); Error in ==> doDICS_simple at 52 source01_060=sourceanalysis(cfg,freqDICS01_060) ========================================== Thanks, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From r.oostenveld at FCDONDERS.RU.NL Mon Nov 8 08:59:19 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 8 Nov 2004 08:59:19 +0100 Subject: sourceinterpolate In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCF5C@nihexchange17.nih.gov> Message-ID: Hi Masao On 6 Nov 2004, at 21:45, Matsuhashi, Masao (NIH/NINDS) wrote: > ??? Undefined command/function 'mbrealvector'. Thanks for reporting that bug, I will take care that it is fixed in the upcoming update of fieldtrip. In the meantime, please put the attached mbXXX functions in the private subdirectory of fieldtrip. About the beamed coherence being larger than one, I will contact you directly in a separate email. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: mbvector.m Type: application/octet-stream Size: 128 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbscalar.m Type: application/octet-stream Size: 95 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbrealvector.m Type: application/octet-stream Size: 51 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbrealscalar.m Type: application/octet-stream Size: 50 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbreal.m Type: application/octet-stream Size: 83 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbmatrix.m Type: application/octet-stream Size: 75 bytes Desc: not available URL: -------------- next part -------------- ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From matsuham at NINDS.NIH.GOV Mon Nov 8 21:42:48 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Mon, 8 Nov 2004 15:42:48 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, Thank you. Now the 0.9.4 works and produces the same result (that is still a question :-) ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From matsuham at NINDS.NIH.GOV Mon Nov 8 22:33:12 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Mon, 8 Nov 2004 16:33:12 -0500 Subject: freqdescriptives Message-ID: Hello Robert, I also copied the axial2planar.m and modified the number of gradiometers from 151 to 274, and now it works. The result in our condition is ================ method 1: 0.715570 method 2: 0.923964 method 3: 0.929785 method 4: 0.977297 method 5: 0.715570 ================ Actually, the result of 'orig' method is flower-like and so different from the original. While doing this, I got the following warning message. Is this ok? ================ Warning: higher order synthetic gradiometer configuration(?) > In fieldtrip\private\prepare_vol_sens at 145 In dipolesimulation at 35 ================ Another question: what is the unit of cfg.dip.mom to give to dipolesimulation(). With the unit vector [1,0,0] as in the above test script, the output (axial.trial) is in the order of 1e-9, where the actual recorded signal is usually less than 1e-11. Therefore it is not likely nAm. I am thinking of mixing the simulated data to the real brain background activity. ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From rajamoni at CCS.FAU.EDU Mon Nov 8 22:45:25 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Mon, 8 Nov 2004 16:45:25 -0500 Subject: single-trials data Message-ID: Hi Robert, Would you please tell me the way to generate single-trials source(s) time series data from raw MEG dataset? Thanks and best regards, Sreenivasan From roberto at SMI.AUC.DK Tue Nov 9 09:49:43 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Tue, 9 Nov 2004 09:49:43 +0100 Subject: single-trials data In-Reply-To: <00a301c4c5dc$415a2400$3c1e5b83@vasan> Message-ID: Hi Sreenivasan, On 8 Nov 2004, at 22:45, R. Sreenivasan wrote: > Would you please tell me the way to generate single-trials source(s) > time > series data from raw MEG dataset? sourceanalysis with cfg.method=lcmv and cfg.singletrial=yes. That will use the full data to construct the spatial filter, and apply that filter to each individual trial. It will result in a source structure with source.avg and source.trial. The dipole moment of the single-trial source reconstructions are in source.trial.mom. Source.trial.mom{N} contains the moment for the dipole on position source.pos(N,:). Robert From r.oostenveld at FCDONDERS.RU.NL Tue Nov 9 10:26:10 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 9 Nov 2004 10:26:10 +0100 Subject: planar gradients compared In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FD06F@nihexchange17.nih.gov> Message-ID: Hi MAsao, On 8 Nov 2004, at 22:33, Matsuhashi, Masao (NIH/NINDS) wrote: > I also copied the axial2planar.m and modified the number of > gradiometers > from 151 to 274, and now it works. Could you send me the updated version, so that I can include it in the next release? > The result in our condition is > > ================ > method 1: 0.715570 > method 2: 0.923964 > method 3: 0.929785 > method 4: 0.977297 > method 5: 0.715570 > ================ > > Actually, the result of 'orig' method is flower-like and so different > from > the original. These numbers are the correlation coefficient, and method1 or 'orig', which is the default(!) in fieldtrip is clearly not the best. Btw. 'orig' means that it was the original implementation of the planar gradient computation by Ole Jensen, and does not mean that it is the original axial data. If you plot the amplitude of the planar gradients computed with 'orig', these should _not_ look like the original topoplot. Planar gradient amplitudes are conceptually different from axial gradients (e.g. amplitude is always a positive number, whereas the original data is both positive and negative). Did you check this for different dipole locations? And for different noise levels? The idea was not just to run the script that I sent you, but also to explore it to see how these parameters affect the planar gradient estimation from the axial data. > While doing this, I got the following warning message. Is this ok? > > ================ > Warning: higher order synthetic gradiometer configuration(?) >> In fieldtrip\private\prepare_vol_sens at 145 > In dipolesimulation at 35 > ================ It indicates a potential problem. Fieldtrip is not yet 100% capable of handling the CTF higher order synthetic gradients correctly. At the Donders, we useually do not use the higher order gradients and therefore they have not been implemented completely yet. The problem that I face is that I cannot read the coefficients in a decent fashion (i.e. from the res4 files). In this case (computation of planar gradients) I guess that it does not matter, but for forward and inverse computations the warning is more serious. > Another question: what is the unit of cfg.dip.mom to give to > dipolesimulation(). With the unit vector [1,0,0] as in the above test > script, the output (axial.trial) is in the order of 1e-9, where the > actual > recorded signal is usually less than 1e-11. Therefore it is not likely > nAm. > I am thinking of mixing the simulated data to the real brain background > activity. It is arbitrary units. It depends on the units of your other objects, i.e. whether the volume conductor model is specified in cm or in m, etc. Robert From rajamoni at CCS.FAU.EDU Tue Nov 9 21:32:00 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Tue, 9 Nov 2004 15:32:00 -0500 Subject: single-trials data Message-ID: Hi Robert, Attached is the script that I used for generating single-trial time series data for two dipoles. Then I want to do the freqanalysis on those source time-series data. Unfortunately, I amn't getting it ...Would you please check? Sreenivasan ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Tuesday, November 09, 2004 3:49 AM Subject: Re: [FIELDTRIP] single-trials data > Hi Sreenivasan, > > On 8 Nov 2004, at 22:45, R. Sreenivasan wrote: > > > Would you please tell me the way to generate single-trials source(s) > > time > > series data from raw MEG dataset? > > sourceanalysis with cfg.method=lcmv and cfg.singletrial=yes. That will > use the full data to construct the spatial filter, and apply that > filter to each individual trial. > > It will result in a source structure with source.avg and source.trial. > The dipole moment of the single-trial source reconstructions are in > source.trial.mom. Source.trial.mom{N} contains the moment for the > dipole on position source.pos(N,:). > > Robert -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: singletrial_patch.m URL: From r.oostenveld at FCDONDERS.RU.NL Wed Nov 10 18:38:16 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 10 Nov 2004 18:38:16 +0100 Subject: single-trials data In-Reply-To: <009e01c4c69b$2afc39e0$3c1e5b83@vasan> Message-ID: Hi Sreenivasan On 9 Nov 2004, at 21:32, R. Sreenivasan wrote: > Hi Robert, > > Attached is the script that I used for generating single-trial time > series > data for two dipoles. Then I want to do the freqanalysis on those > source > time-series data. > Unfortunately, I amn't getting it ...Would you please check? > > cfg.vartrllength = 2; This has no effect, since you are not doing partial artifact rejection. Hence all your trials have the same length. > cfg.blc = 'no' > cfg.blcwindow = [-0.0 0.25] This has no effect. > cfg.bpfreq = [8 14] > fg.bpfiltord = 4 > cfg.bpfilttype = 'fir' This will result in a very sloppy filter. > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.pos = [1 4 1; 6 1 2]; > %cfg.singletrial = 'yes'; > cfg.rawtrial = 'yes' > cfg.keepfilter = 'yes' > cfg.hdmfile = strcat(ds, '/localSpheres.hdm'); > [source] = sourceanalysis(cfg, timelock) Your single trial covariances are computed on only a 250ms time window of the filtered data (see timelockanalysis cfg). Therefore each single trial covariance is very poorly estimated and might even be rank deficient (this is something that sourceanalysis will warn you about). You should do singletrial=yes and rawtrial=no. Just to be sure you should also do keepmom=yes. > cfg = []; > cfg.method = 'fft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = smo; > cfg.foilim = [f1 f2]; > %cfg.pad = 2.; > %cfg.keeptrials = 'yes'; > cfg.sgncmb = 'all'; > [freq] = freqanalysis(cfg, source); Freqanalysis is not so smart that it immediately knows how to do its analysis on source data. You'll have to reformat the source data, and especially source.trial.mom (i.e. the estimated dipole moment for each trial) into something that looks like it comes from preprocessing. datasrc = []; datasrc.fsample = data.fsample; datasrc.cfg = source.cfg; for i=1:length(datasrc.time) datasrc.time{i} = timelock.time; datasrc.trial{i} = xxx; % something with source.trial(i).mom{1} and mom{2}; end datasrc.label = xxx; % perhaps {'dip1', 'dip2'}? You'll have to fill out the xxx'es youself and especially you should tink of how you want to treat the 3D dipole moment (i.e. regional source strength with x, y, and z-component), i.e. as three virtual channels or as one virtual channel. Maybe it is first better to have a look at the moments of each dipole in a given trial by just plotting it. Using SVD, you can for example extract the moment strength and orientation along the most dominant direction. Try something like [u, s, v] = svd(source.trial(1).mom{1}); mom = s*v; plot(time, mom); I hope this helps, Robert PS plotting virtual channels with sourceinterpolate and sliceinterpolate won't work, but you already have that commented out. From mariast at ROCKETMAIL.COM Fri Nov 12 11:13:07 2004 From: mariast at ROCKETMAIL.COM (Maria Stavrinou) Date: Fri, 12 Nov 2004 02:13:07 -0800 Subject: importing .eeg data files In-Reply-To: <4D858803-333F-11D9-B0CB-000A95DBB2CC@fcdonders.ru.nl> Message-ID: Hi, I am trying to import .eeg datafile from Neuroscan using the command read_fcdc_data in this sense: dat = read_fcdc_data('dataset_test.eeg', hdr, 1, number_of_trials*number_of_points_in_one_trial*num_channels, chanindx) However i would like to import all 62 channels -could you give me also a hint what to write to chanindx? and the answer i get is: Error using ==> read_fcdc_data cannot read beyond epoch boundary in Neuroscan *.eeg file Thanks Maria Stavrinou --------------------------------- Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Mon Nov 15 09:15:18 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Nov 2004 09:15:18 +0100 Subject: importing .eeg data files In-Reply-To: <20041112101307.18997.qmail@web12609.mail.yahoo.com> Message-ID: Hi Maria, On 12 Nov 2004, at 11:13, Maria Stavrinou wrote: > I am trying to import .eeg datafile from Neuroscan using the command > read_fcdc_data in this sense: > dat = read_fcdc_data('dataset_test.eeg', hdr, 1, > number_of_trials*number_of_points_in_one_trial*num_channels, chanindx) > However i would like to import all 62 channels -could you give me also > a hint what to write to chanindx? > and the answer i get is: > > Error using ==> read_fcdc_data > cannot read beyond epoch boundary in Neuroscan *.eeg file The error is not with chanindx, but with the fact that you are trying to read a very long continuous block of data from a file that contains only epochs. It cannot read data beyond the boundaries between the epochs. In principle you should not be using the read_fcdc_data function to get the data into Fieldtrip, since it is a low-level function. You should use the "preprocessing" function. See "help preprocessing" and "help definetrial". Probably the following configuration will do the trick cfg = [] cfg.datafile = 'dataset_test.eeg' cfg.headerfile = 'dataset_test.eeg' cfg.channel = 'all' raw = preprocessing(cfg) I hope this helps, Robert From rajamoni at CCS.FAU.EDU Tue Nov 16 16:47:28 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Tue, 16 Nov 2004 10:47:28 -0500 Subject: min-norm Message-ID: Hi Robert, I understand that the Fieldtrip uses LCMV method for source analysis. Do you have any routine(s) that uses min-norm option? Thank you Sreenivasan From r.oostenveld at FCDONDERS.RU.NL Wed Nov 17 14:19:15 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 17 Nov 2004 14:19:15 +0100 Subject: min-norm In-Reply-To: <003301c4cbf3$93515950$3c1e5b83@vasan> Message-ID: Hi Sreenivasan, There are different source analysis options implemented in FieldTrip, namely LCMV, DICS and single or multiple spatiotemporal dipole fitting. Minimum current or minimum norm solutions based on a distributed source model are not implemented. Ii principle implementing a minimum norm solution would be very easy, but it is quite difficult to implement a good regularization method. Furthermore, implementing a good and robust distributed source model (based on the cortical surface) is quite some work. best regards, Robert On 16 Nov 2004, at 16:47, R. Sreenivasan wrote: > Hi Robert, > > I understand that the Fieldtrip uses LCMV method for source analysis. > Do you > have any routine(s) that uses min-norm option? > > Thank you > Sreenivasan > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From rajamoni at CCS.FAU.EDU Thu Nov 18 00:00:39 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Wed, 17 Nov 2004 18:00:39 -0500 Subject: co-ordinate Message-ID: Hi Robert, Is there any function in Fieldtrip to translate the Freesurfer-RAS or Talairach co-ordinate system to the system that Fieldtrip uses? (e.g. giving the dipole position - cfg.grid.pos = [x y z] for source analysis) The other question is related to extracting source single-trial data. Earlier You suggested that the source signal could be extracted by the following way: ([u,s,v]=svd(dipole.moment)) and s*v produces 3 components of source. Instead can we compute from the dipole (3D) moment by sqrt(x^2+y^2+z^2) for each trial? Thank you, Best regards, Sreenivasan From r.oostenveld at FCDONDERS.RU.NL Thu Nov 18 12:30:55 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 18 Nov 2004 12:30:55 +0100 Subject: co-ordinate In-Reply-To: <017401c4ccf9$419d3000$3c1e5b83@vasan> Message-ID: Hi Sreenivasan On 18 Nov 2004, at 0:00, R. Sreenivasan wrote: > Is there any function in Fieldtrip to translate the Freesurfer-RAS or > Talairach co-ordinate system to the system that Fieldtrip uses? (e.g. > giving > the dipole position - cfg.grid.pos = [x y z] for source analysis) Fieldtrip does not use it's own intrinsic coordinate system. Instead, if you read in geometrical information from a CTF file (dataset or mri), that geometrical information such as sensor positions or voxels will be represented in Matlab memory in CTF coordinates. For other types of input data (e.g. Neuromag MEG or SPM/analyze MRI's) the coordinate system can be different. As the user it is your own responsibility to ensure that coordinate systems of the different input objects/datafiles match. Of course it is possible to "convert from one to the other coordinate system". But conceptually one does not convert the coordinate system, instead the geometrical description of the data is converted: i.e. a [x y z] point in one coordinate system is converted to [x' y' z'] in another coordinate system. Please have a look at http://www2.ru.nl/fcdonders/fieldtrip/faq.html#q4 http://www2.ru.nl/fcdonders/fieldtrip/faq.html#q5 to see the Fieldtrip specific details. Furthermore, I suggest that you have a look at http://bishopw.loni.ucla.edu/AIR5/homogenous.html to get an understanding for the general concept of a "homogenous coordinate transformation", which is used in Fieldtrip. Basically the problem boils down to obtaining a mathematical description of the coordinate transformation that relates your data (in CTF coordinates I guess) to Freesurfer-RAS or Talairach coordinates. I don't know what Freesurfer-RAS uses, but Talairach and CTF cannot be linked easily together with this homogenous transformation. E.g. SPM uses nonlinear spatial normalization to align an individual MRI to a standard MRI. This SPM approach of spatially realigning or normalizing volume data will become part of Fieldtrip in the future. > The other question is related to extracting source single-trial data. > > Earlier You suggested that the source signal could be extracted by the > following way: ([u,s,v]=svd(dipole.moment)) and s*v produces 3 > components > of source. Instead can we compute from the dipole (3D) moment by > sqrt(x^2+y^2+z^2) for each trial? Yes, but that is the magnitude of the rotating dipole moment instead of its strength along a specified direction (which you would gvet with the svd trick). The magnitude is always positive, the strength along one direction is both positive and negative. You can use whichever you think best captures the activity at that particular location, but personally I prefer the dipole moment amplitude along a specific direction because of its more clear physical interpretation. best regards, Robert Oostenveld From Thomas.Koelewijn at FCDONDERS.RU.NL Mon Nov 29 12:39:38 2004 From: Thomas.Koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 29 Nov 2004 12:39:38 +0100 Subject: multiplotER In-Reply-To: <4F9B5B2E-3955-11D9-A77D-000A95DBB2CC@fcdonders.ru.nl> Message-ID: Dear all, I'm trying to use the multiplotER function as described in the fieldtrip tutorial. cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; clf; multiplotER (cfg, avgFIC); But the I get this reply. ??? Attempt to execute SCRIPT dataread as a function. Error in ==> C:\MATLAB6p5p1\toolbox\matlab\iofun\textread.m On line 172 ==> [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> h:\common\matlab\fieldtrip\multiplotER.m On line 138 ==> [chNum,X,Y,Width,Height,Lbl] = textread(cfg.layoutname,'%f %f %f %f %f %s'); Are there any changes made in this function? Gr. Thomas From Thomas.Koelewijn at FCDONDERS.RU.NL Mon Nov 29 13:36:55 2004 From: Thomas.Koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 29 Nov 2004 13:36:55 +0100 Subject: multiplotER In-Reply-To: Message-ID: Dear all, I made a stupid mistake, sorry for bothering you It's all fixed now Gr. Thomas -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Thomas Koelewijn Sent: maandag 29 november 2004 12:40 To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] multiplotER Dear all, I'm trying to use the multiplotER function as described in the fieldtrip tutorial. cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; clf; multiplotER (cfg, avgFIC); But the I get this reply. ??? Attempt to execute SCRIPT dataread as a function. Error in ==> C:\MATLAB6p5p1\toolbox\matlab\iofun\textread.m On line 172 ==> [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> h:\common\matlab\fieldtrip\multiplotER.m On line 138 ==> [chNum,X,Y,Width,Height,Lbl] = textread(cfg.layoutname,'%f %f %f %f %f %s'); Are there any changes made in this function? Gr. Thomas From roberto at SMI.AUC.DK Mon Nov 1 09:15:41 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Mon, 1 Nov 2004 09:15:41 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FC9A1@nihexchange17.nih.gov> Message-ID: Dear Masao I cannot give a recoomendation for the interpolation method to use to compute the planar gradients. Most people at the Donders are using 'orig, buy I found myself that the 'sincos' seemed to be the most accurate. I expect that the 'fitplane' will work less wel at the boundary of the helmet. The proper way to evaluate these different methods would be to use them on simulated data, since it probably will depend on the source location and amount of noise. Important to realise is that they all do something with your data which migh or might not be desirable. It makes the topographic display of the data easier to interpret (desirable), but makes it also more noise sensitive and introduces linear dependencies in neighbouring channels which were not neccessary present in the original data (undesirable). When possible, I personally try to avoid it. But people who are used to the Neuromag system probably will be biassed the other way around, and try to use it whenever possible. best regards, Robert On 31 Oct 2004, at 20:32, Matsuhashi, Masao (NIH/NINDS) wrote: > 2. Do you have any suggestion which of three simple interpolation > method > ('orig' | 'sincos' | 'fitplane') to use in megplanar? > The 'orig' method requires less memory, but seems less reliable.... I > checked with SEF N20m data and the 'orig' method produced four peaks > in the > gradient contour map. The 'fitplane' seems best among the three in this > respect, am I right? > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From t.montez at VUMC.NL Tue Nov 2 16:54:46 2004 From: t.montez at VUMC.NL (Montez, T.) Date: Tue, 2 Nov 2004 16:54:46 +0100 Subject: resampledata Message-ID: Hi, Using the code: addpath E:\Matlab\fieldtrip-0.9.2 % READING THE DATA hdr = read_fcdc_header('E:\Matlab\Data\A012-4channels.ds\A012-4channels.res4'); dat = read_fcdc_data('E:\Matlab\Data\A012-4channels.ds\A012-4channels.meg4', hdr, 1, 4096); cfg = []; cfg.dataset = 'E:\Matlab\Data\A012-4channels.ds' cfg.trl=[1 4096 0] cfg.channel='MEG' datatest = preprocessing(cfg) save ('E:\Matlab\Data\Test\datatest') % FILTERING AND RESAMPLE cfg.lpfreq = 13 cfg.resamplefs = 250 datatest_filtered = resampledata(cfg, datatest) cfg.hpfreq = 8 datatest_filtered = preprocessing(cfg) save ('E:\Matlab\Data\Test\datatest_filtered') I get the error: % ??? Error using ==> preprocessing % resampling is not supported any more, see RESAMPLEDATA However it seem to work: >> datatest_filtered datatest_filtered = cfg: [1x1 struct] hdr: [1x1 struct] label: {4x1 cell} trial: {[4x1639 double]} offset: 0 time: {[1x1639 double]} fsample: 250 grad: [1x1 struct] origfsample: 625 origoffset: 0 origtime: {[1x4096 double]} >> cfg cfg = dataset: 'E:\Matlab\Data\A012-4channels.ds' trl: [1 4096 0] channel: 'MEG' lpfreq: 13 resamplefs: 250 hpfreq: 8 I am skipping cfg.detrend ='yes' because it is the default. Should I use cfg.downsample=X; instead of resampledata? The file resampledata.m does not appear in the reference documentation list of the FieldTrip webpage. Thanks, Teresa Montez From roberto at SMI.AUC.DK Tue Nov 2 17:56:18 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Tue, 2 Nov 2004 17:56:18 +0100 Subject: resampledata In-Reply-To: <04Nov2.165722cet.334410@nucleus.azvu.nl> Message-ID: Hi Teresa Reading through your screen output, I notice that you are reusing the same variable name. I.e. you are doing cfg = something datatest = preprocessing, no problem datatest_filtered = resampledata, also works fine then you do cfg = something else, including resamplefs datatest_filtered = preprocessing -> gives error Subsequently you appear supprised that datatest_filtered exists, but it was the result of the first call to resampledata, and not to the second call to preprocessing. The 2nd preprocessing gave an error and did not overwrite the variable. In the old days, resampling used to be done inside preprocessing, but it actually was a separate function right from its initial implementation. Conceptually it makes sense to think of resampling/downsampling as part of the preprocessing, but it never was implemented optimally in preprocessing. Therefore it was taken out of the preprocessing. To ensure that people with old configurations do not incorrectly assume that their preprocessed data is downsampled, it gives an error if you try to resample/downsample with the preprocessing function. Instead you should call preprocessing, and then call resampledata like cfgpre = something data = preprocessing(cfgpre); cfgdwn = [] cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, data); clear data or in one line as cfgpre = something cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, preprocessing(cfgpre)); Another hint: if you want to check what configuration was really used in any fieldtrip analysis step, you should look at the configuration that is contained in the output data. I will try to implement a more thorough warning/error system for configuration fields that are not being used by a specific function. > I am skipping cfg.detrend ='yes' because it is the default. The default (of any fieldtrip function) is not neccesary what you want. Please think about what you want and specify it. Also remember that defaults can change between versions. For ERPs you probably do not want to detrend the data prior to downsampling (but you do want to baselinecorrect with the proper baseline window), for TFRs it does not really matter too much and it might be advantageous to detrend. Actually, I don't think that in this case the default is the best option in general. > Should I use cfg.downsample=X; instead of resampledata? No, that is not an option for preprocessing, nor for resampledata. > The file resampledata.m does not appear in the reference documentation > list > of the FieldTrip webpage. I'll add it in a future version of the documentation. Thanks for letting me know. You get the most up to date documentation of any fieldtrip function by typing "help functionname". You will see from the documentation that cfg.resamplefs is NOT an option for preprocessing, and also that cfg.lpfreq is not an option for resampledata (you specified it incorerctly in the cfg in your mail). best regards, Robert PS Attached you will find the most recent version of resampledata, a small bug in the re-computation of the time axis has been fixed. Also the help has been updated. -------------- next part -------------- A non-text attachment was scrubbed... Name: resampledata.m Type: application/octet-stream Size: 2567 bytes Desc: not available URL: -------------- next part -------------- On 2 Nov 2004, at 16:54, Montez, T. wrote: > Hi, > > Using the code: > > > addpath E:\Matlab\fieldtrip-0.9.2 > > % READING THE DATA > > hdr = > read_fcdc_header('E:\Matlab\Data\A012-4channels.ds\A012 > -4channels.res4'); > dat = > read_fcdc_data('E:\Matlab\Data\A012-4channels.ds\A012-4channels.meg4', > hdr, 1, 4096); > > cfg = []; > > cfg.dataset = 'E:\Matlab\Data\A012-4channels.ds' > cfg.trl=[1 4096 0] > > cfg.channel='MEG' > > datatest = preprocessing(cfg) > save ('E:\Matlab\Data\Test\datatest') > > % FILTERING AND RESAMPLE > > cfg.lpfreq = 13 > > cfg.resamplefs = 250 > datatest_filtered = resampledata(cfg, datatest) > > cfg.hpfreq = 8 > > datatest_filtered = preprocessing(cfg) > save ('E:\Matlab\Data\Test\datatest_filtered') > > > I get the error: > > > % ??? Error using ==> preprocessing > % resampling is not supported any more, see RESAMPLEDATA > > > > However it seem to work: > > >>> datatest_filtered > > datatest_filtered = > > cfg: [1x1 struct] > hdr: [1x1 struct] > label: {4x1 cell} > trial: {[4x1639 double]} > offset: 0 > time: {[1x1639 double]} > fsample: 250 > grad: [1x1 struct] > origfsample: 625 > origoffset: 0 > origtime: {[1x4096 double]} > >>> cfg > > cfg = > > dataset: 'E:\Matlab\Data\A012-4channels.ds' > trl: [1 4096 0] > channel: 'MEG' > lpfreq: 13 > resamplefs: 250 > hpfreq: 8 > > > I am skipping cfg.detrend ='yes' because it is the default. > > Should I use cfg.downsample=X; instead of resampledata? > > The file resampledata.m does not appear in the reference documentation > list > of the FieldTrip webpage. > > > Thanks, > Teresa Montez > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From rajamoni at CCS.FAU.EDU Wed Nov 3 15:48:50 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Wed, 3 Nov 2004 09:48:50 -0500 Subject: Coherent sources Message-ID: Is it possible to compute coherence (sources) for more than one reference dipoles (i.e, network) using Fieltrip? ______________________________________________ R. Sreenivasan, Ph.D. Center for Complex Systems & Brain Sciences 777 Glades Road, Florida Atlantic University Boca Raton, FL 33431 Phone: 561-297-0111 (off) 561-367-0857 (home) Fax: 561-297-3634 e-mail: rajamoni at ccs.fau.edu ______________________________________________ From matsuham at NINDS.NIH.GOV Thu Nov 4 04:06:03 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Wed, 3 Nov 2004 22:06:03 -0500 Subject: freqdescriptives Message-ID: Dear Robert, Thank you for the comment. This kind of information is very helpful. Since I was grown up with Neuromag122 but now using Omega, I have to try not to be biased as such. The simulation is certainly one important thing to do. I will ask our MEG scientist. Additional question. What is the unit/dimension of the source activity calculated by sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate->sliceinterp? It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar showed something like 0 to 20 and 0 to 140. It seems like absolute or power of cross-spectra.... Regards, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From tomh at KURAGE.NIMH.NIH.GOV Thu Nov 4 05:07:41 2004 From: tomh at KURAGE.NIMH.NIH.GOV (Tom Holroyd) Date: Wed, 3 Nov 2004 23:07:41 -0500 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCD6B@nihexchange17.nih.gov> Message-ID: > The simulation is certainly one important thing to do. I will ask our MEG > scientist. Hmm. I guess that's me. :-) I may as well mention here, that there's a VSM(CTF) program called "dsim" which can add a given simulated dipole (or several) to an existing dataset. You can either start with an empty sensor noise recording, or live data. Then see if you can find it again. :-) See also dsim -help. Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce From roberto at SMI.AUC.DK Thu Nov 4 09:35:00 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:35:00 +0100 Subject: Coherent sources In-Reply-To: <004101c4c1b4$3b3a0a30$3c1e5b83@vasan> Message-ID: Hi, On 3 Nov 2004, at 15:48, R. Sreenivasan wrote: > Is it possible to compute coherence (sources) for more than one > reference > dipoles (i.e, network) using Fieltrip? It is not possible to compute it with the frequency implementation of the beamformer (i.e. DICS). However, you could use the following approach - PREPROCESSING - TIMELOCKANALYSIS using a bandpass filter (which is a hidden option) in the frequency band of interest (not too narrow), with covariance=yes and keeptrials=yes - SOURCEANALYSIS with method=lcmv and singletrial=yes, with cfg.grid.pos equal to the locations of interest - FREQANALYSIS on the output of sourceanalysis, i.e. analyze the virtual channel that was constructed on each location of interest with output=powandcsd - FREQDESCRIPTIVES The sourceanalysis with method=lcmv and singletrial=yes will compute the average covariance matrix from your data and use that to construct the spatial filter. Subsequently the spatial filter is applied to each trial seperately. The reason for averaging the trials prior to applying the filters to the individual trials is that each individual trial covariance is probably rank deficient, and will at least be pooirly estimated resulting in poorly defined spatial filters. However, the spatial filter can be determined robustly from the average. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Thu Nov 4 09:49:14 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:49:14 +0100 Subject: freqdescriptives In-Reply-To: Message-ID: Hi Tom, Thanks for the hint. There is also a DIPOLESIMULATION function in FieldTrip. You probably will want to look into "private/axial2planar" as well. I suppose that the most meaningfull simulation will be one in which you compute forward on a axial gradiometer system, and on a planar system. Then try MEGPLANAR to convert the axial data to estimated planar data, and compare with real planar data. See the attached script, which basically does it all... I am curious as to what it will bring for different source parameters and levels of simulated and real physiological (i.e. spatially correlated) noise. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: test_RO_014.m Type: application/octet-stream Size: 2227 bytes Desc: not available URL: -------------- next part -------------- On 4 Nov 2004, at 5:07, Tom Holroyd wrote: >> The simulation is certainly one important thing to do. I will ask our >> MEG >> scientist. > > Hmm. I guess that's me. :-) I may as well mention here, that > there's a VSM(CTF) program called "dsim" which can add a given > simulated dipole (or several) to an existing dataset. You can > either start with an empty sensor noise recording, or live data. > Then see if you can find it again. :-) > > See also dsim -help. From roberto at SMI.AUC.DK Thu Nov 4 09:21:31 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:21:31 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCD6B@nihexchange17.nih.gov> Message-ID: Hi Masao, On 4 Nov 2004, at 4:06, Matsuhashi, Masao (NIH/NINDS) wrote: > Additional question. What is the unit/dimension of the source activity > calculated by > sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate- > >sliceinterp? > It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar > showed something like 0 to 20 and 0 to 140. It seems like absolute or > power > of cross-spectra.... The unit depends on what estimated source parameter you are looking at: source.avg.pow is dipole power, which is expressible in (nAm)^2. But since Fieldtrip is unaware of the physical units of all the "dataobjects" (volume conductor, data, sensor geometry) that go into the computation, the result should be interpreted as arbitrary units. source.avg.coh is the coherence, which is equal to the squared coherency. Both coherence and coherency are between 0 and 1. source.avg.noise is the estimated projected noise, where the noise is assumed to be uncorrelated and of equal magnitude between channels and where the amplitude of the noise is scaled with the smallest singular value of the cross-spectral density matrix. The projected noise has the same units as the power, i.e. arbitrary units in principle. After sourcedecriptives, source.avg.nai equals the neural activity index, which is defined as pow/noise. It is dimensionless and always >=0. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From Johannes.Sarnthein at USZ.CH Thu Nov 4 10:35:35 2004 From: Johannes.Sarnthein at USZ.CH (Sarnthein Johannes) Date: Thu, 4 Nov 2004 10:35:35 +0100 Subject: AW: [FIELDTRIP] freqdescriptives Message-ID: Dear Robert, there is too much traffic, please unsubscribe me from the fieldtrip list. I enjoy using your dipfit with EEGLAB. Looking forward to your comments in the EEGLAB list. Best, Johannes -----Ursprüngliche Nachricht----- Von: Robert Oostenveld [mailto:roberto at SMI.AUC.DK] Gesendet: Donnerstag, 4. November 2004 09:22 An: FIELDTRIP at nic.surfnet.nl Betreff: Re: [FIELDTRIP] freqdescriptives Hi Masao, On 4 Nov 2004, at 4:06, Matsuhashi, Masao (NIH/NINDS) wrote: > Additional question. What is the unit/dimension of the source activity > calculated by > sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate- > >sliceinterp? > It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar > showed something like 0 to 20 and 0 to 140. It seems like absolute or > power > of cross-spectra.... The unit depends on what estimated source parameter you are looking at: source.avg.pow is dipole power, which is expressible in (nAm)^2. But since Fieldtrip is unaware of the physical units of all the "dataobjects" (volume conductor, data, sensor geometry) that go into the computation, the result should be interpreted as arbitrary units. source.avg.coh is the coherence, which is equal to the squared coherency. Both coherence and coherency are between 0 and 1. source.avg.noise is the estimated projected noise, where the noise is assumed to be uncorrelated and of equal magnitude between channels and where the amplitude of the noise is scaled with the smallest singular value of the cross-spectral density matrix. The projected noise has the same units as the power, i.e. arbitrary units in principle. After sourcedecriptives, source.avg.nai equals the neural activity index, which is defined as pow/noise. It is dimensionless and always >=0. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Thu Nov 4 11:00:43 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 11:00:43 +0100 Subject: AW: [FIELDTRIP] freqdescriptives In-Reply-To: <2B9546F31DBA5A41A7C0F5D70A31999002422F0A@DS-00181.usz.ch> Message-ID: Dear Johannes (and other subscribers) On http://nic.surfnet.nl/archives/fieldtrip.html you can unsubscribe yourself or, alternatively, you can switch to digest mode. Also other configuration options can be set there, and help is provided for the different list options. best regards, Robert On 4 Nov 2004, at 10:35, Sarnthein Johannes wrote: > Dear Robert, > there is too much traffic, please unsubscribe me from the fieldtrip > list. > I enjoy using your dipfit with EEGLAB. > Looking forward to your comments in the EEGLAB list. > Best, > Johannes From rajamoni at CCS.FAU.EDU Thu Nov 4 20:57:09 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Thu, 4 Nov 2004 14:57:09 -0500 Subject: Coherent sources Message-ID: Hi Robert, I find it difficult to figure out the hidden option of the frequency in timelockanalysis. Would you please send me a sample script? Thanks Best regards, Sreenivasan ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Thursday, November 04, 2004 3:35 AM Subject: Re: [FIELDTRIP] Coherent sources > Hi, > > On 3 Nov 2004, at 15:48, R. Sreenivasan wrote: > > > Is it possible to compute coherence (sources) for more than one > > reference > > dipoles (i.e, network) using Fieltrip? > > It is not possible to compute it with the frequency implementation of > the beamformer (i.e. DICS). However, you could use the following > approach > > - PREPROCESSING > - TIMELOCKANALYSIS using a bandpass filter (which is a hidden option) > in the frequency band of interest (not too narrow), with covariance=yes > and keeptrials=yes > - SOURCEANALYSIS with method=lcmv and singletrial=yes, with > cfg.grid.pos equal to the locations of interest > - FREQANALYSIS on the output of sourceanalysis, i.e. analyze the > virtual channel that was constructed on each location of interest with > output=powandcsd > - FREQDESCRIPTIVES > > The sourceanalysis with method=lcmv and singletrial=yes will compute > the average covariance matrix from your data and use that to construct > the spatial filter. Subsequently the spatial filter is applied to each > trial seperately. The reason for averaging the trials prior to applying > the filters to the individual trials is that each individual trial > covariance is probably rank deficient, and will at least be pooirly > estimated resulting in poorly defined spatial filters. However, the > spatial filter can be determined robustly from the average. > > > best regards, > Robert > > ---------------------------------------------------------------------- > Robert Oostenveld, PhD > Center for Sensory-Motor Interaction (SMI) > Aalborg University, Denmark > > and > > F.C. Donders Centre for Cognitive Neuroimaging > University Nijmegen > P.O. Box 9101 > NL-6500 AH Nijmegen > The Netherlands > > Tel: +31 (0)24 3619695 > Fax: +31 (0)24 3610989 > ---------------------------------------------------------------------- > N.B. Starting from 1 September 2004, the University of Nijmegen has > changed its name to Radboud University Nijmegen. All web- and > email-addresses ending in ".kun.nl" should therefore be changed into > ".ru.nl". Please update your address book and links. From matsuham at NINDS.NIH.GOV Fri Nov 5 01:16:44 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Thu, 4 Nov 2004 19:16:44 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, Let the output of sourceinterpolate as SI, then the SI.avg contains only one field, 'coh'. The elements of SI.avg.coh are way larger than 1, so they must be the neural activity index, am I correct? Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From matsuham at NINDS.NIH.GOV Fri Nov 5 01:21:37 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Thu, 4 Nov 2004 19:21:37 -0500 Subject: freqdescriptives Message-ID: Hi Robert, Tom said that we do not have the read_ctf_res4.m script that is called in your test_RO_014.m script. Would you tell us how can we get one, or any replacements? Regards, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From roberto at SMI.AUC.DK Fri Nov 5 08:49:02 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:49:02 +0100 Subject: Coherent sources In-Reply-To: <005201c4c2a8$7822d720$3c1e5b83@vasan> Message-ID: Hi Sreenivasan The bandpass filter options in timelockanalysis have the same config as those in preprocessing. If you open timelockanalysis in the editor, and jump to the first comments after the initial help block (in my version it is around line 42), you will see % Undocumented options: % cfg.blc = 'no' or 'yes' % cfg.blcwindow = [begin end] % cfg.bpfilter = 'no' or 'yes' % cfg.bpfreq = [low high] % cfg.bpfiltord = number giving the filter order % cfg.bpfilttype = 'but' or 'fir' % The filtering options are supported here only to compute the covariance % matrix in a specific frequency band while avoiding to do the preprocessing many times. I guess that that should suffice as explanation. Maybe some extra words on why they are hidden as option: in preprocessing you can pad the trial data with some extra data that also is read from the (continuous) file. After this (optional) padding, the data is filtered. That means that any filter artifacts will occur in the padded begin and end of the datasegment, and those "pads" are again removed after filtering. In timelockanalysis it is not possible to pad the data any more, hence filtering should preferably done when as much of the data is present. best regards, Robert On 4 Nov 2004, at 20:57, R. Sreenivasan wrote: > Hi Robert, > > I find it difficult to figure out the hidden option of the frequency in > timelockanalysis. Would you please send me a sample script? > > Thanks > Best regards, Sreenivasan ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From r.oostenveld at FCDONDERS.RU.NL Fri Nov 5 08:53:44 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:53:44 +0100 Subject: sourceinterpolate In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCE2F@nihexchange17.nih.gov> Message-ID: On 5 Nov 2004, at 1:16, Matsuhashi, Masao (NIH/NINDS) wrote: > Let the output of sourceinterpolate as SI, then the SI.avg contains > only one > field, 'coh'. The elements of SI.avg.coh are way larger than 1, so > they must > be the neural activity index, am I correct? For sourceinterpolate you have specified which parameter you wanted to be interpolated, i.e. you will have done cfg.parameter='coh'. Then only coherence is interpolated. If you do cfg.parameter='all', also power and nai (if present) will be interpolated. S1.avg.coh is coherence, and not nai. It being larger than one looks like a bug or an interpolation artifact. Can you check whether it is also larger than one in the non-interpolated source reconstruction? What version of fieldtrip, and specifically sourceanalysis are you using? Please look at source.cfg.version or S1.cfg.previous.version (i.e. the version of the previous step before interpolation). And what version of sourceinterpolate (S1.cfg.version)? Robert ---------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Fri Nov 5 08:55:36 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:55:36 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCE30@nihexchange17.nih.gov> Message-ID: Hi Masao, You will find it in fieldtrip/private. Just copy it from there to your working directory. Also copy the read_ctgf_res4.p file along (they go together). Robert On 5 Nov 2004, at 1:21, Matsuhashi, Masao (NIH/NINDS) wrote: > Tom said that we do not have the read_ctf_res4.m script that is called > in > your test_RO_014.m script. Would you tell us how can we get one, or any > replacements? ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From t.montez at VUMC.NL Fri Nov 5 15:36:43 2004 From: t.montez at VUMC.NL (Montez, T.) Date: Fri, 5 Nov 2004 15:36:43 +0100 Subject: resampledata/offset2time Message-ID: Hi Robert, After doing the changes you proposed: cfgpre = something data = preprocessing(cfgpre); cfgdwn = [] cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, data); I get the error message: ??? Undefined function or variable 'offset2time'. Error in ==> E:\Matlab\fieldtrip-0.9.2\resampledata.m On line 65 ==> data.time{itr} = offset2time(data.offset(itr), data.fsample, size(data.trial{itr},2)); Do I need the offset2time.m ? Best regards, Teresa From roberto at SMI.AUC.DK Fri Nov 5 16:28:12 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 16:28:12 +0100 Subject: resampledata/offset2time In-Reply-To: <04Nov5.153906cet.334940@nucleus.azvu.nl> Message-ID: On 5 Nov 2004, at 15:36, Montez, T. wrote: > ??? Undefined function or variable 'offset2time'. > > Do I need the offset2time.m ? Yes. That function should be in private, but it was added to private after release 0.9.2. Please upgrade to the latest version from the website (0.9.4), then copy the resampledata that I sent you as attachment into the fieldtrip directory, then it should work. best regards, Robert From luoj at MAIL.NIH.GOV Fri Nov 5 21:36:35 2004 From: luoj at MAIL.NIH.GOV (Luo, Jessie (NIH/NIMH)) Date: Fri, 5 Nov 2004 15:36:35 -0500 Subject: scanning next week Message-ID: Hi Tom, Thanks so much again for coming over for troubleshooting!! Also tahnks for the approval of our future scanning sessions. Our first scanning session is 1:00-5:00pm next Tuesday. Will you be around to help at that time? Some sujects might need glasses. Is this OK? Thanks, Jessie From matsuham at NINDS.NIH.GOV Sat Nov 6 21:45:03 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Sat, 6 Nov 2004 15:45:03 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, I tried with the following script: ==================================================== % load data segsize=5; % in seconds SampleRate=600; % per second DataLengthInPoints=144600; resolution=1; DS='X:/raid/meg/JATENWNT_track_20041022_01.ds'; mriFile='X:/raid/meg/TY20041022.mri'; localSpheres=[DS,'/localSpheres.hdm']; f=6; d=1; clear data cfg=[]; cfg.dataset=DS; cfg.trl=[[1:segsize*SampleRate:DataLengthInPoints-segsize*SampleRate+1]',... [segsize*SampleRate:segsize*SampleRate:DataLengthInPoints]',... zeros(fix(DataLengthInPoints/SampleRate/segsize),1)] cfg.channel='MEG' cfg.detrend='yes' data=preprocessing(cfg) %take some time, so do it only neccesory. drawnow % combine with ref signal w{dataset}(time,stim) load w; for loop = 1:length(data.trial) data.trial{loop}=[data.trial{loop};w{1}([1:segsize*SampleRate]+segsize*Sampl eRate*(loop-1),1)']; end data.label=[data.label;{'REF1'}]; % DICS step1 fourier transform cfg=[]; cfg.method = 'fft'; cfg.output = 'powandcsd' cfg.tapsmofrq=0.5; cfg.pad='maxperlen'; cfg.keeptrials = 'yes'; cfg.foilim = [f-0.2,f+0.2]; cfg.sgncmb = channelcombination({'MEG' 'MEG';'MEG' 'REF1'},data.label); [freqDICS01_060] = freqanalysis(cfg, data) drawnow % DICS step 2 source analysis cfg=[]; cfg.refchannel ='REF1'; cfg.method = 'coh_refchan'; cfg.projectnoise='yes'; cfg.hdmfile=localSpheres; cfg.frequency=f; cfg.lambda=1e-31; cfg.xgrid='auto'; cfg.ygrid='auto'; cfg.zgrid='auto'; cfg.resolution=resolution; cfg.keepleadfield='no'; source01_060=sourceanalysis(cfg,freqDICS01_060) drawnow sourceC01_060=sourcedescriptives(cfg,source01_060) drawnow % DICS step3 display cfg.downsample=2; cfg.parameter='coh'; cfg.funparameter='coh'; sourceInterp01_060=sourceinterpolate(cfg,source01_060,mriFile); drawnow figure; sliceinterp(cfg,sourceInterp01_060); set(gcf,'name',['DICS, Dataset ',d,', ',num2str(f),'Hz'],'NumberTitle','off') text(0,-20,['DICS, Dataset ',d,', ',num2str(f),'Hz']) cfg.parameter='coh'; sourceInterpC01_060=sourceinterpolate(cfg,sourceC01_060,mriFile); drawnow figure; sliceinterp(cfg,sourceInterpC01_060); set(gcf,'name',['DICS, Dataset ',d,', ',num2str(f),'Hz'],'NumberTitle','off') text(0,-20,['DICS, Dataset ',d,', ',num2str(f),'Hz']) ========================================== With FieldTrip 0.92, the resultant .coh is clearly above 1. ========================================== >> version ans = 7.0.0.19920 (R14) >> source01_060.avg ans = pow: [1x34580 double] coh: [1x34580 double] noise: [1x34580 double] >> source01_060.avg.coh(2000) ans = 9.6989 >> sourceC01_060.avg %% after sourcedescriptives ans = pow: [1x34580 double] coh: [1x34580 double] noise: [1x34580 double] nai: [1x34580 double] >> sourceC01_060.avg.coh(2000) ans = 9.6989 >> sourceC01_060.avg.nai(2000) ans = 2.1569e+012 >> sourceInterpC01_060.avg ans = coh: [128x128x128 double] >> sourceInterpC01_060.avg.coh(64,64,64) ans = 31.4140 >> sourceInterpC01_060.cfg.version ans = name: 'C:\MATLAB\fieldtrip\sourceinterpolate' id: '$Id: sourceinterpolate.m,v 1.15 2004/08/27 11:21:48 roboos Exp $' >> sourceInterpC01_060.cfg.previous{1}.version ans = name: 'C:\MATLAB\fieldtrip\sourcedescriptives' id: '$Id: sourcedescriptives.m,v 1.4.2.1 2004/09/03 07:17:41 roboos Exp $' ========================================== With FieldTrip 0.94, I had following error. ========================================== .... reading headmodel from file X:/raid/meg/JATENWNT_track_20041022_01.ds/localSpheres.hdm using gradiometers specified in the data selecting 274 first-order gradiometers creating headsurface based on multisphere model and gradiometers 2886 dipoles inside, 31694 dipoles outside brain ??? Undefined command/function 'mbrealvector'. Error in ==> fieldtrip\private\nearest at 14 mbrealvector(array) Error in ==> fieldtrip\private\prepare_freq_matrices at 68 fbin = nearest(freq.foi, cfg.frequency); Error in ==> sourceanalysis at 333 [Cf, Cr, Pr, Ntrials] = prepare_freq_matrices(cfg, freq); Error in ==> doDICS_simple at 52 source01_060=sourceanalysis(cfg,freqDICS01_060) ========================================== Thanks, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From r.oostenveld at FCDONDERS.RU.NL Mon Nov 8 08:59:19 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 8 Nov 2004 08:59:19 +0100 Subject: sourceinterpolate In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCF5C@nihexchange17.nih.gov> Message-ID: Hi Masao On 6 Nov 2004, at 21:45, Matsuhashi, Masao (NIH/NINDS) wrote: > ??? Undefined command/function 'mbrealvector'. Thanks for reporting that bug, I will take care that it is fixed in the upcoming update of fieldtrip. In the meantime, please put the attached mbXXX functions in the private subdirectory of fieldtrip. About the beamed coherence being larger than one, I will contact you directly in a separate email. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: mbvector.m Type: application/octet-stream Size: 128 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbscalar.m Type: application/octet-stream Size: 95 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbrealvector.m Type: application/octet-stream Size: 51 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbrealscalar.m Type: application/octet-stream Size: 50 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbreal.m Type: application/octet-stream Size: 83 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbmatrix.m Type: application/octet-stream Size: 75 bytes Desc: not available URL: -------------- next part -------------- ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From matsuham at NINDS.NIH.GOV Mon Nov 8 21:42:48 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Mon, 8 Nov 2004 15:42:48 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, Thank you. Now the 0.9.4 works and produces the same result (that is still a question :-) ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From matsuham at NINDS.NIH.GOV Mon Nov 8 22:33:12 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Mon, 8 Nov 2004 16:33:12 -0500 Subject: freqdescriptives Message-ID: Hello Robert, I also copied the axial2planar.m and modified the number of gradiometers from 151 to 274, and now it works. The result in our condition is ================ method 1: 0.715570 method 2: 0.923964 method 3: 0.929785 method 4: 0.977297 method 5: 0.715570 ================ Actually, the result of 'orig' method is flower-like and so different from the original. While doing this, I got the following warning message. Is this ok? ================ Warning: higher order synthetic gradiometer configuration(?) > In fieldtrip\private\prepare_vol_sens at 145 In dipolesimulation at 35 ================ Another question: what is the unit of cfg.dip.mom to give to dipolesimulation(). With the unit vector [1,0,0] as in the above test script, the output (axial.trial) is in the order of 1e-9, where the actual recorded signal is usually less than 1e-11. Therefore it is not likely nAm. I am thinking of mixing the simulated data to the real brain background activity. ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From rajamoni at CCS.FAU.EDU Mon Nov 8 22:45:25 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Mon, 8 Nov 2004 16:45:25 -0500 Subject: single-trials data Message-ID: Hi Robert, Would you please tell me the way to generate single-trials source(s) time series data from raw MEG dataset? Thanks and best regards, Sreenivasan From roberto at SMI.AUC.DK Tue Nov 9 09:49:43 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Tue, 9 Nov 2004 09:49:43 +0100 Subject: single-trials data In-Reply-To: <00a301c4c5dc$415a2400$3c1e5b83@vasan> Message-ID: Hi Sreenivasan, On 8 Nov 2004, at 22:45, R. Sreenivasan wrote: > Would you please tell me the way to generate single-trials source(s) > time > series data from raw MEG dataset? sourceanalysis with cfg.method=lcmv and cfg.singletrial=yes. That will use the full data to construct the spatial filter, and apply that filter to each individual trial. It will result in a source structure with source.avg and source.trial. The dipole moment of the single-trial source reconstructions are in source.trial.mom. Source.trial.mom{N} contains the moment for the dipole on position source.pos(N,:). Robert From r.oostenveld at FCDONDERS.RU.NL Tue Nov 9 10:26:10 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 9 Nov 2004 10:26:10 +0100 Subject: planar gradients compared In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FD06F@nihexchange17.nih.gov> Message-ID: Hi MAsao, On 8 Nov 2004, at 22:33, Matsuhashi, Masao (NIH/NINDS) wrote: > I also copied the axial2planar.m and modified the number of > gradiometers > from 151 to 274, and now it works. Could you send me the updated version, so that I can include it in the next release? > The result in our condition is > > ================ > method 1: 0.715570 > method 2: 0.923964 > method 3: 0.929785 > method 4: 0.977297 > method 5: 0.715570 > ================ > > Actually, the result of 'orig' method is flower-like and so different > from > the original. These numbers are the correlation coefficient, and method1 or 'orig', which is the default(!) in fieldtrip is clearly not the best. Btw. 'orig' means that it was the original implementation of the planar gradient computation by Ole Jensen, and does not mean that it is the original axial data. If you plot the amplitude of the planar gradients computed with 'orig', these should _not_ look like the original topoplot. Planar gradient amplitudes are conceptually different from axial gradients (e.g. amplitude is always a positive number, whereas the original data is both positive and negative). Did you check this for different dipole locations? And for different noise levels? The idea was not just to run the script that I sent you, but also to explore it to see how these parameters affect the planar gradient estimation from the axial data. > While doing this, I got the following warning message. Is this ok? > > ================ > Warning: higher order synthetic gradiometer configuration(?) >> In fieldtrip\private\prepare_vol_sens at 145 > In dipolesimulation at 35 > ================ It indicates a potential problem. Fieldtrip is not yet 100% capable of handling the CTF higher order synthetic gradients correctly. At the Donders, we useually do not use the higher order gradients and therefore they have not been implemented completely yet. The problem that I face is that I cannot read the coefficients in a decent fashion (i.e. from the res4 files). In this case (computation of planar gradients) I guess that it does not matter, but for forward and inverse computations the warning is more serious. > Another question: what is the unit of cfg.dip.mom to give to > dipolesimulation(). With the unit vector [1,0,0] as in the above test > script, the output (axial.trial) is in the order of 1e-9, where the > actual > recorded signal is usually less than 1e-11. Therefore it is not likely > nAm. > I am thinking of mixing the simulated data to the real brain background > activity. It is arbitrary units. It depends on the units of your other objects, i.e. whether the volume conductor model is specified in cm or in m, etc. Robert From rajamoni at CCS.FAU.EDU Tue Nov 9 21:32:00 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Tue, 9 Nov 2004 15:32:00 -0500 Subject: single-trials data Message-ID: Hi Robert, Attached is the script that I used for generating single-trial time series data for two dipoles. Then I want to do the freqanalysis on those source time-series data. Unfortunately, I amn't getting it ...Would you please check? Sreenivasan ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Tuesday, November 09, 2004 3:49 AM Subject: Re: [FIELDTRIP] single-trials data > Hi Sreenivasan, > > On 8 Nov 2004, at 22:45, R. Sreenivasan wrote: > > > Would you please tell me the way to generate single-trials source(s) > > time > > series data from raw MEG dataset? > > sourceanalysis with cfg.method=lcmv and cfg.singletrial=yes. That will > use the full data to construct the spatial filter, and apply that > filter to each individual trial. > > It will result in a source structure with source.avg and source.trial. > The dipole moment of the single-trial source reconstructions are in > source.trial.mom. Source.trial.mom{N} contains the moment for the > dipole on position source.pos(N,:). > > Robert -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: singletrial_patch.m URL: From r.oostenveld at FCDONDERS.RU.NL Wed Nov 10 18:38:16 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 10 Nov 2004 18:38:16 +0100 Subject: single-trials data In-Reply-To: <009e01c4c69b$2afc39e0$3c1e5b83@vasan> Message-ID: Hi Sreenivasan On 9 Nov 2004, at 21:32, R. Sreenivasan wrote: > Hi Robert, > > Attached is the script that I used for generating single-trial time > series > data for two dipoles. Then I want to do the freqanalysis on those > source > time-series data. > Unfortunately, I amn't getting it ...Would you please check? > > cfg.vartrllength = 2; This has no effect, since you are not doing partial artifact rejection. Hence all your trials have the same length. > cfg.blc = 'no' > cfg.blcwindow = [-0.0 0.25] This has no effect. > cfg.bpfreq = [8 14] > fg.bpfiltord = 4 > cfg.bpfilttype = 'fir' This will result in a very sloppy filter. > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.pos = [1 4 1; 6 1 2]; > %cfg.singletrial = 'yes'; > cfg.rawtrial = 'yes' > cfg.keepfilter = 'yes' > cfg.hdmfile = strcat(ds, '/localSpheres.hdm'); > [source] = sourceanalysis(cfg, timelock) Your single trial covariances are computed on only a 250ms time window of the filtered data (see timelockanalysis cfg). Therefore each single trial covariance is very poorly estimated and might even be rank deficient (this is something that sourceanalysis will warn you about). You should do singletrial=yes and rawtrial=no. Just to be sure you should also do keepmom=yes. > cfg = []; > cfg.method = 'fft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = smo; > cfg.foilim = [f1 f2]; > %cfg.pad = 2.; > %cfg.keeptrials = 'yes'; > cfg.sgncmb = 'all'; > [freq] = freqanalysis(cfg, source); Freqanalysis is not so smart that it immediately knows how to do its analysis on source data. You'll have to reformat the source data, and especially source.trial.mom (i.e. the estimated dipole moment for each trial) into something that looks like it comes from preprocessing. datasrc = []; datasrc.fsample = data.fsample; datasrc.cfg = source.cfg; for i=1:length(datasrc.time) datasrc.time{i} = timelock.time; datasrc.trial{i} = xxx; % something with source.trial(i).mom{1} and mom{2}; end datasrc.label = xxx; % perhaps {'dip1', 'dip2'}? You'll have to fill out the xxx'es youself and especially you should tink of how you want to treat the 3D dipole moment (i.e. regional source strength with x, y, and z-component), i.e. as three virtual channels or as one virtual channel. Maybe it is first better to have a look at the moments of each dipole in a given trial by just plotting it. Using SVD, you can for example extract the moment strength and orientation along the most dominant direction. Try something like [u, s, v] = svd(source.trial(1).mom{1}); mom = s*v; plot(time, mom); I hope this helps, Robert PS plotting virtual channels with sourceinterpolate and sliceinterpolate won't work, but you already have that commented out. From mariast at ROCKETMAIL.COM Fri Nov 12 11:13:07 2004 From: mariast at ROCKETMAIL.COM (Maria Stavrinou) Date: Fri, 12 Nov 2004 02:13:07 -0800 Subject: importing .eeg data files In-Reply-To: <4D858803-333F-11D9-B0CB-000A95DBB2CC@fcdonders.ru.nl> Message-ID: Hi, I am trying to import .eeg datafile from Neuroscan using the command read_fcdc_data in this sense: dat = read_fcdc_data('dataset_test.eeg', hdr, 1, number_of_trials*number_of_points_in_one_trial*num_channels, chanindx) However i would like to import all 62 channels -could you give me also a hint what to write to chanindx? and the answer i get is: Error using ==> read_fcdc_data cannot read beyond epoch boundary in Neuroscan *.eeg file Thanks Maria Stavrinou --------------------------------- Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Mon Nov 15 09:15:18 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Nov 2004 09:15:18 +0100 Subject: importing .eeg data files In-Reply-To: <20041112101307.18997.qmail@web12609.mail.yahoo.com> Message-ID: Hi Maria, On 12 Nov 2004, at 11:13, Maria Stavrinou wrote: > I am trying to import .eeg datafile from Neuroscan using the command > read_fcdc_data in this sense: > dat = read_fcdc_data('dataset_test.eeg', hdr, 1, > number_of_trials*number_of_points_in_one_trial*num_channels, chanindx) > However i would like to import all 62 channels -could you give me also > a hint what to write to chanindx? > and the answer i get is: > > Error using ==> read_fcdc_data > cannot read beyond epoch boundary in Neuroscan *.eeg file The error is not with chanindx, but with the fact that you are trying to read a very long continuous block of data from a file that contains only epochs. It cannot read data beyond the boundaries between the epochs. In principle you should not be using the read_fcdc_data function to get the data into Fieldtrip, since it is a low-level function. You should use the "preprocessing" function. See "help preprocessing" and "help definetrial". Probably the following configuration will do the trick cfg = [] cfg.datafile = 'dataset_test.eeg' cfg.headerfile = 'dataset_test.eeg' cfg.channel = 'all' raw = preprocessing(cfg) I hope this helps, Robert From rajamoni at CCS.FAU.EDU Tue Nov 16 16:47:28 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Tue, 16 Nov 2004 10:47:28 -0500 Subject: min-norm Message-ID: Hi Robert, I understand that the Fieldtrip uses LCMV method for source analysis. Do you have any routine(s) that uses min-norm option? Thank you Sreenivasan From r.oostenveld at FCDONDERS.RU.NL Wed Nov 17 14:19:15 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 17 Nov 2004 14:19:15 +0100 Subject: min-norm In-Reply-To: <003301c4cbf3$93515950$3c1e5b83@vasan> Message-ID: Hi Sreenivasan, There are different source analysis options implemented in FieldTrip, namely LCMV, DICS and single or multiple spatiotemporal dipole fitting. Minimum current or minimum norm solutions based on a distributed source model are not implemented. Ii principle implementing a minimum norm solution would be very easy, but it is quite difficult to implement a good regularization method. Furthermore, implementing a good and robust distributed source model (based on the cortical surface) is quite some work. best regards, Robert On 16 Nov 2004, at 16:47, R. Sreenivasan wrote: > Hi Robert, > > I understand that the Fieldtrip uses LCMV method for source analysis. > Do you > have any routine(s) that uses min-norm option? > > Thank you > Sreenivasan > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From rajamoni at CCS.FAU.EDU Thu Nov 18 00:00:39 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Wed, 17 Nov 2004 18:00:39 -0500 Subject: co-ordinate Message-ID: Hi Robert, Is there any function in Fieldtrip to translate the Freesurfer-RAS or Talairach co-ordinate system to the system that Fieldtrip uses? (e.g. giving the dipole position - cfg.grid.pos = [x y z] for source analysis) The other question is related to extracting source single-trial data. Earlier You suggested that the source signal could be extracted by the following way: ([u,s,v]=svd(dipole.moment)) and s*v produces 3 components of source. Instead can we compute from the dipole (3D) moment by sqrt(x^2+y^2+z^2) for each trial? Thank you, Best regards, Sreenivasan From r.oostenveld at FCDONDERS.RU.NL Thu Nov 18 12:30:55 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 18 Nov 2004 12:30:55 +0100 Subject: co-ordinate In-Reply-To: <017401c4ccf9$419d3000$3c1e5b83@vasan> Message-ID: Hi Sreenivasan On 18 Nov 2004, at 0:00, R. Sreenivasan wrote: > Is there any function in Fieldtrip to translate the Freesurfer-RAS or > Talairach co-ordinate system to the system that Fieldtrip uses? (e.g. > giving > the dipole position - cfg.grid.pos = [x y z] for source analysis) Fieldtrip does not use it's own intrinsic coordinate system. Instead, if you read in geometrical information from a CTF file (dataset or mri), that geometrical information such as sensor positions or voxels will be represented in Matlab memory in CTF coordinates. For other types of input data (e.g. Neuromag MEG or SPM/analyze MRI's) the coordinate system can be different. As the user it is your own responsibility to ensure that coordinate systems of the different input objects/datafiles match. Of course it is possible to "convert from one to the other coordinate system". But conceptually one does not convert the coordinate system, instead the geometrical description of the data is converted: i.e. a [x y z] point in one coordinate system is converted to [x' y' z'] in another coordinate system. Please have a look at http://www2.ru.nl/fcdonders/fieldtrip/faq.html#q4 http://www2.ru.nl/fcdonders/fieldtrip/faq.html#q5 to see the Fieldtrip specific details. Furthermore, I suggest that you have a look at http://bishopw.loni.ucla.edu/AIR5/homogenous.html to get an understanding for the general concept of a "homogenous coordinate transformation", which is used in Fieldtrip. Basically the problem boils down to obtaining a mathematical description of the coordinate transformation that relates your data (in CTF coordinates I guess) to Freesurfer-RAS or Talairach coordinates. I don't know what Freesurfer-RAS uses, but Talairach and CTF cannot be linked easily together with this homogenous transformation. E.g. SPM uses nonlinear spatial normalization to align an individual MRI to a standard MRI. This SPM approach of spatially realigning or normalizing volume data will become part of Fieldtrip in the future. > The other question is related to extracting source single-trial data. > > Earlier You suggested that the source signal could be extracted by the > following way: ([u,s,v]=svd(dipole.moment)) and s*v produces 3 > components > of source. Instead can we compute from the dipole (3D) moment by > sqrt(x^2+y^2+z^2) for each trial? Yes, but that is the magnitude of the rotating dipole moment instead of its strength along a specified direction (which you would gvet with the svd trick). The magnitude is always positive, the strength along one direction is both positive and negative. You can use whichever you think best captures the activity at that particular location, but personally I prefer the dipole moment amplitude along a specific direction because of its more clear physical interpretation. best regards, Robert Oostenveld From Thomas.Koelewijn at FCDONDERS.RU.NL Mon Nov 29 12:39:38 2004 From: Thomas.Koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 29 Nov 2004 12:39:38 +0100 Subject: multiplotER In-Reply-To: <4F9B5B2E-3955-11D9-A77D-000A95DBB2CC@fcdonders.ru.nl> Message-ID: Dear all, I'm trying to use the multiplotER function as described in the fieldtrip tutorial. cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; clf; multiplotER (cfg, avgFIC); But the I get this reply. ??? Attempt to execute SCRIPT dataread as a function. Error in ==> C:\MATLAB6p5p1\toolbox\matlab\iofun\textread.m On line 172 ==> [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> h:\common\matlab\fieldtrip\multiplotER.m On line 138 ==> [chNum,X,Y,Width,Height,Lbl] = textread(cfg.layoutname,'%f %f %f %f %f %s'); Are there any changes made in this function? Gr. Thomas From Thomas.Koelewijn at FCDONDERS.RU.NL Mon Nov 29 13:36:55 2004 From: Thomas.Koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 29 Nov 2004 13:36:55 +0100 Subject: multiplotER In-Reply-To: Message-ID: Dear all, I made a stupid mistake, sorry for bothering you It's all fixed now Gr. Thomas -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Thomas Koelewijn Sent: maandag 29 november 2004 12:40 To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] multiplotER Dear all, I'm trying to use the multiplotER function as described in the fieldtrip tutorial. cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; clf; multiplotER (cfg, avgFIC); But the I get this reply. ??? Attempt to execute SCRIPT dataread as a function. Error in ==> C:\MATLAB6p5p1\toolbox\matlab\iofun\textread.m On line 172 ==> [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> h:\common\matlab\fieldtrip\multiplotER.m On line 138 ==> [chNum,X,Y,Width,Height,Lbl] = textread(cfg.layoutname,'%f %f %f %f %f %s'); Are there any changes made in this function? Gr. Thomas From roberto at SMI.AUC.DK Mon Nov 1 09:15:41 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Mon, 1 Nov 2004 09:15:41 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FC9A1@nihexchange17.nih.gov> Message-ID: Dear Masao I cannot give a recoomendation for the interpolation method to use to compute the planar gradients. Most people at the Donders are using 'orig, buy I found myself that the 'sincos' seemed to be the most accurate. I expect that the 'fitplane' will work less wel at the boundary of the helmet. The proper way to evaluate these different methods would be to use them on simulated data, since it probably will depend on the source location and amount of noise. Important to realise is that they all do something with your data which migh or might not be desirable. It makes the topographic display of the data easier to interpret (desirable), but makes it also more noise sensitive and introduces linear dependencies in neighbouring channels which were not neccessary present in the original data (undesirable). When possible, I personally try to avoid it. But people who are used to the Neuromag system probably will be biassed the other way around, and try to use it whenever possible. best regards, Robert On 31 Oct 2004, at 20:32, Matsuhashi, Masao (NIH/NINDS) wrote: > 2. Do you have any suggestion which of three simple interpolation > method > ('orig' | 'sincos' | 'fitplane') to use in megplanar? > The 'orig' method requires less memory, but seems less reliable.... I > checked with SEF N20m data and the 'orig' method produced four peaks > in the > gradient contour map. The 'fitplane' seems best among the three in this > respect, am I right? > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From t.montez at VUMC.NL Tue Nov 2 16:54:46 2004 From: t.montez at VUMC.NL (Montez, T.) Date: Tue, 2 Nov 2004 16:54:46 +0100 Subject: resampledata Message-ID: Hi, Using the code: addpath E:\Matlab\fieldtrip-0.9.2 % READING THE DATA hdr = read_fcdc_header('E:\Matlab\Data\A012-4channels.ds\A012-4channels.res4'); dat = read_fcdc_data('E:\Matlab\Data\A012-4channels.ds\A012-4channels.meg4', hdr, 1, 4096); cfg = []; cfg.dataset = 'E:\Matlab\Data\A012-4channels.ds' cfg.trl=[1 4096 0] cfg.channel='MEG' datatest = preprocessing(cfg) save ('E:\Matlab\Data\Test\datatest') % FILTERING AND RESAMPLE cfg.lpfreq = 13 cfg.resamplefs = 250 datatest_filtered = resampledata(cfg, datatest) cfg.hpfreq = 8 datatest_filtered = preprocessing(cfg) save ('E:\Matlab\Data\Test\datatest_filtered') I get the error: % ??? Error using ==> preprocessing % resampling is not supported any more, see RESAMPLEDATA However it seem to work: >> datatest_filtered datatest_filtered = cfg: [1x1 struct] hdr: [1x1 struct] label: {4x1 cell} trial: {[4x1639 double]} offset: 0 time: {[1x1639 double]} fsample: 250 grad: [1x1 struct] origfsample: 625 origoffset: 0 origtime: {[1x4096 double]} >> cfg cfg = dataset: 'E:\Matlab\Data\A012-4channels.ds' trl: [1 4096 0] channel: 'MEG' lpfreq: 13 resamplefs: 250 hpfreq: 8 I am skipping cfg.detrend ='yes' because it is the default. Should I use cfg.downsample=X; instead of resampledata? The file resampledata.m does not appear in the reference documentation list of the FieldTrip webpage. Thanks, Teresa Montez From roberto at SMI.AUC.DK Tue Nov 2 17:56:18 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Tue, 2 Nov 2004 17:56:18 +0100 Subject: resampledata In-Reply-To: <04Nov2.165722cet.334410@nucleus.azvu.nl> Message-ID: Hi Teresa Reading through your screen output, I notice that you are reusing the same variable name. I.e. you are doing cfg = something datatest = preprocessing, no problem datatest_filtered = resampledata, also works fine then you do cfg = something else, including resamplefs datatest_filtered = preprocessing -> gives error Subsequently you appear supprised that datatest_filtered exists, but it was the result of the first call to resampledata, and not to the second call to preprocessing. The 2nd preprocessing gave an error and did not overwrite the variable. In the old days, resampling used to be done inside preprocessing, but it actually was a separate function right from its initial implementation. Conceptually it makes sense to think of resampling/downsampling as part of the preprocessing, but it never was implemented optimally in preprocessing. Therefore it was taken out of the preprocessing. To ensure that people with old configurations do not incorrectly assume that their preprocessed data is downsampled, it gives an error if you try to resample/downsample with the preprocessing function. Instead you should call preprocessing, and then call resampledata like cfgpre = something data = preprocessing(cfgpre); cfgdwn = [] cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, data); clear data or in one line as cfgpre = something cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, preprocessing(cfgpre)); Another hint: if you want to check what configuration was really used in any fieldtrip analysis step, you should look at the configuration that is contained in the output data. I will try to implement a more thorough warning/error system for configuration fields that are not being used by a specific function. > I am skipping cfg.detrend ='yes' because it is the default. The default (of any fieldtrip function) is not neccesary what you want. Please think about what you want and specify it. Also remember that defaults can change between versions. For ERPs you probably do not want to detrend the data prior to downsampling (but you do want to baselinecorrect with the proper baseline window), for TFRs it does not really matter too much and it might be advantageous to detrend. Actually, I don't think that in this case the default is the best option in general. > Should I use cfg.downsample=X; instead of resampledata? No, that is not an option for preprocessing, nor for resampledata. > The file resampledata.m does not appear in the reference documentation > list > of the FieldTrip webpage. I'll add it in a future version of the documentation. Thanks for letting me know. You get the most up to date documentation of any fieldtrip function by typing "help functionname". You will see from the documentation that cfg.resamplefs is NOT an option for preprocessing, and also that cfg.lpfreq is not an option for resampledata (you specified it incorerctly in the cfg in your mail). best regards, Robert PS Attached you will find the most recent version of resampledata, a small bug in the re-computation of the time axis has been fixed. Also the help has been updated. -------------- next part -------------- A non-text attachment was scrubbed... Name: resampledata.m Type: application/octet-stream Size: 2567 bytes Desc: not available URL: -------------- next part -------------- On 2 Nov 2004, at 16:54, Montez, T. wrote: > Hi, > > Using the code: > > > addpath E:\Matlab\fieldtrip-0.9.2 > > % READING THE DATA > > hdr = > read_fcdc_header('E:\Matlab\Data\A012-4channels.ds\A012 > -4channels.res4'); > dat = > read_fcdc_data('E:\Matlab\Data\A012-4channels.ds\A012-4channels.meg4', > hdr, 1, 4096); > > cfg = []; > > cfg.dataset = 'E:\Matlab\Data\A012-4channels.ds' > cfg.trl=[1 4096 0] > > cfg.channel='MEG' > > datatest = preprocessing(cfg) > save ('E:\Matlab\Data\Test\datatest') > > % FILTERING AND RESAMPLE > > cfg.lpfreq = 13 > > cfg.resamplefs = 250 > datatest_filtered = resampledata(cfg, datatest) > > cfg.hpfreq = 8 > > datatest_filtered = preprocessing(cfg) > save ('E:\Matlab\Data\Test\datatest_filtered') > > > I get the error: > > > % ??? Error using ==> preprocessing > % resampling is not supported any more, see RESAMPLEDATA > > > > However it seem to work: > > >>> datatest_filtered > > datatest_filtered = > > cfg: [1x1 struct] > hdr: [1x1 struct] > label: {4x1 cell} > trial: {[4x1639 double]} > offset: 0 > time: {[1x1639 double]} > fsample: 250 > grad: [1x1 struct] > origfsample: 625 > origoffset: 0 > origtime: {[1x4096 double]} > >>> cfg > > cfg = > > dataset: 'E:\Matlab\Data\A012-4channels.ds' > trl: [1 4096 0] > channel: 'MEG' > lpfreq: 13 > resamplefs: 250 > hpfreq: 8 > > > I am skipping cfg.detrend ='yes' because it is the default. > > Should I use cfg.downsample=X; instead of resampledata? > > The file resampledata.m does not appear in the reference documentation > list > of the FieldTrip webpage. > > > Thanks, > Teresa Montez > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From rajamoni at CCS.FAU.EDU Wed Nov 3 15:48:50 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Wed, 3 Nov 2004 09:48:50 -0500 Subject: Coherent sources Message-ID: Is it possible to compute coherence (sources) for more than one reference dipoles (i.e, network) using Fieltrip? ______________________________________________ R. Sreenivasan, Ph.D. Center for Complex Systems & Brain Sciences 777 Glades Road, Florida Atlantic University Boca Raton, FL 33431 Phone: 561-297-0111 (off) 561-367-0857 (home) Fax: 561-297-3634 e-mail: rajamoni at ccs.fau.edu ______________________________________________ From matsuham at NINDS.NIH.GOV Thu Nov 4 04:06:03 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Wed, 3 Nov 2004 22:06:03 -0500 Subject: freqdescriptives Message-ID: Dear Robert, Thank you for the comment. This kind of information is very helpful. Since I was grown up with Neuromag122 but now using Omega, I have to try not to be biased as such. The simulation is certainly one important thing to do. I will ask our MEG scientist. Additional question. What is the unit/dimension of the source activity calculated by sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate->sliceinterp? It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar showed something like 0 to 20 and 0 to 140. It seems like absolute or power of cross-spectra.... Regards, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From tomh at KURAGE.NIMH.NIH.GOV Thu Nov 4 05:07:41 2004 From: tomh at KURAGE.NIMH.NIH.GOV (Tom Holroyd) Date: Wed, 3 Nov 2004 23:07:41 -0500 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCD6B@nihexchange17.nih.gov> Message-ID: > The simulation is certainly one important thing to do. I will ask our MEG > scientist. Hmm. I guess that's me. :-) I may as well mention here, that there's a VSM(CTF) program called "dsim" which can add a given simulated dipole (or several) to an existing dataset. You can either start with an empty sensor noise recording, or live data. Then see if you can find it again. :-) See also dsim -help. Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce From roberto at SMI.AUC.DK Thu Nov 4 09:35:00 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:35:00 +0100 Subject: Coherent sources In-Reply-To: <004101c4c1b4$3b3a0a30$3c1e5b83@vasan> Message-ID: Hi, On 3 Nov 2004, at 15:48, R. Sreenivasan wrote: > Is it possible to compute coherence (sources) for more than one > reference > dipoles (i.e, network) using Fieltrip? It is not possible to compute it with the frequency implementation of the beamformer (i.e. DICS). However, you could use the following approach - PREPROCESSING - TIMELOCKANALYSIS using a bandpass filter (which is a hidden option) in the frequency band of interest (not too narrow), with covariance=yes and keeptrials=yes - SOURCEANALYSIS with method=lcmv and singletrial=yes, with cfg.grid.pos equal to the locations of interest - FREQANALYSIS on the output of sourceanalysis, i.e. analyze the virtual channel that was constructed on each location of interest with output=powandcsd - FREQDESCRIPTIVES The sourceanalysis with method=lcmv and singletrial=yes will compute the average covariance matrix from your data and use that to construct the spatial filter. Subsequently the spatial filter is applied to each trial seperately. The reason for averaging the trials prior to applying the filters to the individual trials is that each individual trial covariance is probably rank deficient, and will at least be pooirly estimated resulting in poorly defined spatial filters. However, the spatial filter can be determined robustly from the average. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Thu Nov 4 09:49:14 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:49:14 +0100 Subject: freqdescriptives In-Reply-To: Message-ID: Hi Tom, Thanks for the hint. There is also a DIPOLESIMULATION function in FieldTrip. You probably will want to look into "private/axial2planar" as well. I suppose that the most meaningfull simulation will be one in which you compute forward on a axial gradiometer system, and on a planar system. Then try MEGPLANAR to convert the axial data to estimated planar data, and compare with real planar data. See the attached script, which basically does it all... I am curious as to what it will bring for different source parameters and levels of simulated and real physiological (i.e. spatially correlated) noise. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: test_RO_014.m Type: application/octet-stream Size: 2227 bytes Desc: not available URL: -------------- next part -------------- On 4 Nov 2004, at 5:07, Tom Holroyd wrote: >> The simulation is certainly one important thing to do. I will ask our >> MEG >> scientist. > > Hmm. I guess that's me. :-) I may as well mention here, that > there's a VSM(CTF) program called "dsim" which can add a given > simulated dipole (or several) to an existing dataset. You can > either start with an empty sensor noise recording, or live data. > Then see if you can find it again. :-) > > See also dsim -help. From roberto at SMI.AUC.DK Thu Nov 4 09:21:31 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:21:31 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCD6B@nihexchange17.nih.gov> Message-ID: Hi Masao, On 4 Nov 2004, at 4:06, Matsuhashi, Masao (NIH/NINDS) wrote: > Additional question. What is the unit/dimension of the source activity > calculated by > sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate- > >sliceinterp? > It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar > showed something like 0 to 20 and 0 to 140. It seems like absolute or > power > of cross-spectra.... The unit depends on what estimated source parameter you are looking at: source.avg.pow is dipole power, which is expressible in (nAm)^2. But since Fieldtrip is unaware of the physical units of all the "dataobjects" (volume conductor, data, sensor geometry) that go into the computation, the result should be interpreted as arbitrary units. source.avg.coh is the coherence, which is equal to the squared coherency. Both coherence and coherency are between 0 and 1. source.avg.noise is the estimated projected noise, where the noise is assumed to be uncorrelated and of equal magnitude between channels and where the amplitude of the noise is scaled with the smallest singular value of the cross-spectral density matrix. The projected noise has the same units as the power, i.e. arbitrary units in principle. After sourcedecriptives, source.avg.nai equals the neural activity index, which is defined as pow/noise. It is dimensionless and always >=0. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From Johannes.Sarnthein at USZ.CH Thu Nov 4 10:35:35 2004 From: Johannes.Sarnthein at USZ.CH (Sarnthein Johannes) Date: Thu, 4 Nov 2004 10:35:35 +0100 Subject: AW: [FIELDTRIP] freqdescriptives Message-ID: Dear Robert, there is too much traffic, please unsubscribe me from the fieldtrip list. I enjoy using your dipfit with EEGLAB. Looking forward to your comments in the EEGLAB list. Best, Johannes -----Ursprüngliche Nachricht----- Von: Robert Oostenveld [mailto:roberto at SMI.AUC.DK] Gesendet: Donnerstag, 4. November 2004 09:22 An: FIELDTRIP at nic.surfnet.nl Betreff: Re: [FIELDTRIP] freqdescriptives Hi Masao, On 4 Nov 2004, at 4:06, Matsuhashi, Masao (NIH/NINDS) wrote: > Additional question. What is the unit/dimension of the source activity > calculated by > sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate- > >sliceinterp? > It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar > showed something like 0 to 20 and 0 to 140. It seems like absolute or > power > of cross-spectra.... The unit depends on what estimated source parameter you are looking at: source.avg.pow is dipole power, which is expressible in (nAm)^2. But since Fieldtrip is unaware of the physical units of all the "dataobjects" (volume conductor, data, sensor geometry) that go into the computation, the result should be interpreted as arbitrary units. source.avg.coh is the coherence, which is equal to the squared coherency. Both coherence and coherency are between 0 and 1. source.avg.noise is the estimated projected noise, where the noise is assumed to be uncorrelated and of equal magnitude between channels and where the amplitude of the noise is scaled with the smallest singular value of the cross-spectral density matrix. The projected noise has the same units as the power, i.e. arbitrary units in principle. After sourcedecriptives, source.avg.nai equals the neural activity index, which is defined as pow/noise. It is dimensionless and always >=0. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Thu Nov 4 11:00:43 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 11:00:43 +0100 Subject: AW: [FIELDTRIP] freqdescriptives In-Reply-To: <2B9546F31DBA5A41A7C0F5D70A31999002422F0A@DS-00181.usz.ch> Message-ID: Dear Johannes (and other subscribers) On http://nic.surfnet.nl/archives/fieldtrip.html you can unsubscribe yourself or, alternatively, you can switch to digest mode. Also other configuration options can be set there, and help is provided for the different list options. best regards, Robert On 4 Nov 2004, at 10:35, Sarnthein Johannes wrote: > Dear Robert, > there is too much traffic, please unsubscribe me from the fieldtrip > list. > I enjoy using your dipfit with EEGLAB. > Looking forward to your comments in the EEGLAB list. > Best, > Johannes From rajamoni at CCS.FAU.EDU Thu Nov 4 20:57:09 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Thu, 4 Nov 2004 14:57:09 -0500 Subject: Coherent sources Message-ID: Hi Robert, I find it difficult to figure out the hidden option of the frequency in timelockanalysis. Would you please send me a sample script? Thanks Best regards, Sreenivasan ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Thursday, November 04, 2004 3:35 AM Subject: Re: [FIELDTRIP] Coherent sources > Hi, > > On 3 Nov 2004, at 15:48, R. Sreenivasan wrote: > > > Is it possible to compute coherence (sources) for more than one > > reference > > dipoles (i.e, network) using Fieltrip? > > It is not possible to compute it with the frequency implementation of > the beamformer (i.e. DICS). However, you could use the following > approach > > - PREPROCESSING > - TIMELOCKANALYSIS using a bandpass filter (which is a hidden option) > in the frequency band of interest (not too narrow), with covariance=yes > and keeptrials=yes > - SOURCEANALYSIS with method=lcmv and singletrial=yes, with > cfg.grid.pos equal to the locations of interest > - FREQANALYSIS on the output of sourceanalysis, i.e. analyze the > virtual channel that was constructed on each location of interest with > output=powandcsd > - FREQDESCRIPTIVES > > The sourceanalysis with method=lcmv and singletrial=yes will compute > the average covariance matrix from your data and use that to construct > the spatial filter. Subsequently the spatial filter is applied to each > trial seperately. The reason for averaging the trials prior to applying > the filters to the individual trials is that each individual trial > covariance is probably rank deficient, and will at least be pooirly > estimated resulting in poorly defined spatial filters. However, the > spatial filter can be determined robustly from the average. > > > best regards, > Robert > > ---------------------------------------------------------------------- > Robert Oostenveld, PhD > Center for Sensory-Motor Interaction (SMI) > Aalborg University, Denmark > > and > > F.C. Donders Centre for Cognitive Neuroimaging > University Nijmegen > P.O. Box 9101 > NL-6500 AH Nijmegen > The Netherlands > > Tel: +31 (0)24 3619695 > Fax: +31 (0)24 3610989 > ---------------------------------------------------------------------- > N.B. Starting from 1 September 2004, the University of Nijmegen has > changed its name to Radboud University Nijmegen. All web- and > email-addresses ending in ".kun.nl" should therefore be changed into > ".ru.nl". Please update your address book and links. From matsuham at NINDS.NIH.GOV Fri Nov 5 01:16:44 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Thu, 4 Nov 2004 19:16:44 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, Let the output of sourceinterpolate as SI, then the SI.avg contains only one field, 'coh'. The elements of SI.avg.coh are way larger than 1, so they must be the neural activity index, am I correct? Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From matsuham at NINDS.NIH.GOV Fri Nov 5 01:21:37 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Thu, 4 Nov 2004 19:21:37 -0500 Subject: freqdescriptives Message-ID: Hi Robert, Tom said that we do not have the read_ctf_res4.m script that is called in your test_RO_014.m script. Would you tell us how can we get one, or any replacements? Regards, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From roberto at SMI.AUC.DK Fri Nov 5 08:49:02 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:49:02 +0100 Subject: Coherent sources In-Reply-To: <005201c4c2a8$7822d720$3c1e5b83@vasan> Message-ID: Hi Sreenivasan The bandpass filter options in timelockanalysis have the same config as those in preprocessing. If you open timelockanalysis in the editor, and jump to the first comments after the initial help block (in my version it is around line 42), you will see % Undocumented options: % cfg.blc = 'no' or 'yes' % cfg.blcwindow = [begin end] % cfg.bpfilter = 'no' or 'yes' % cfg.bpfreq = [low high] % cfg.bpfiltord = number giving the filter order % cfg.bpfilttype = 'but' or 'fir' % The filtering options are supported here only to compute the covariance % matrix in a specific frequency band while avoiding to do the preprocessing many times. I guess that that should suffice as explanation. Maybe some extra words on why they are hidden as option: in preprocessing you can pad the trial data with some extra data that also is read from the (continuous) file. After this (optional) padding, the data is filtered. That means that any filter artifacts will occur in the padded begin and end of the datasegment, and those "pads" are again removed after filtering. In timelockanalysis it is not possible to pad the data any more, hence filtering should preferably done when as much of the data is present. best regards, Robert On 4 Nov 2004, at 20:57, R. Sreenivasan wrote: > Hi Robert, > > I find it difficult to figure out the hidden option of the frequency in > timelockanalysis. Would you please send me a sample script? > > Thanks > Best regards, Sreenivasan ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From r.oostenveld at FCDONDERS.RU.NL Fri Nov 5 08:53:44 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:53:44 +0100 Subject: sourceinterpolate In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCE2F@nihexchange17.nih.gov> Message-ID: On 5 Nov 2004, at 1:16, Matsuhashi, Masao (NIH/NINDS) wrote: > Let the output of sourceinterpolate as SI, then the SI.avg contains > only one > field, 'coh'. The elements of SI.avg.coh are way larger than 1, so > they must > be the neural activity index, am I correct? For sourceinterpolate you have specified which parameter you wanted to be interpolated, i.e. you will have done cfg.parameter='coh'. Then only coherence is interpolated. If you do cfg.parameter='all', also power and nai (if present) will be interpolated. S1.avg.coh is coherence, and not nai. It being larger than one looks like a bug or an interpolation artifact. Can you check whether it is also larger than one in the non-interpolated source reconstruction? What version of fieldtrip, and specifically sourceanalysis are you using? Please look at source.cfg.version or S1.cfg.previous.version (i.e. the version of the previous step before interpolation). And what version of sourceinterpolate (S1.cfg.version)? Robert ---------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Fri Nov 5 08:55:36 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:55:36 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCE30@nihexchange17.nih.gov> Message-ID: Hi Masao, You will find it in fieldtrip/private. Just copy it from there to your working directory. Also copy the read_ctgf_res4.p file along (they go together). Robert On 5 Nov 2004, at 1:21, Matsuhashi, Masao (NIH/NINDS) wrote: > Tom said that we do not have the read_ctf_res4.m script that is called > in > your test_RO_014.m script. Would you tell us how can we get one, or any > replacements? ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From t.montez at VUMC.NL Fri Nov 5 15:36:43 2004 From: t.montez at VUMC.NL (Montez, T.) Date: Fri, 5 Nov 2004 15:36:43 +0100 Subject: resampledata/offset2time Message-ID: Hi Robert, After doing the changes you proposed: cfgpre = something data = preprocessing(cfgpre); cfgdwn = [] cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, data); I get the error message: ??? Undefined function or variable 'offset2time'. Error in ==> E:\Matlab\fieldtrip-0.9.2\resampledata.m On line 65 ==> data.time{itr} = offset2time(data.offset(itr), data.fsample, size(data.trial{itr},2)); Do I need the offset2time.m ? Best regards, Teresa From roberto at SMI.AUC.DK Fri Nov 5 16:28:12 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 16:28:12 +0100 Subject: resampledata/offset2time In-Reply-To: <04Nov5.153906cet.334940@nucleus.azvu.nl> Message-ID: On 5 Nov 2004, at 15:36, Montez, T. wrote: > ??? Undefined function or variable 'offset2time'. > > Do I need the offset2time.m ? Yes. That function should be in private, but it was added to private after release 0.9.2. Please upgrade to the latest version from the website (0.9.4), then copy the resampledata that I sent you as attachment into the fieldtrip directory, then it should work. best regards, Robert From luoj at MAIL.NIH.GOV Fri Nov 5 21:36:35 2004 From: luoj at MAIL.NIH.GOV (Luo, Jessie (NIH/NIMH)) Date: Fri, 5 Nov 2004 15:36:35 -0500 Subject: scanning next week Message-ID: Hi Tom, Thanks so much again for coming over for troubleshooting!! Also tahnks for the approval of our future scanning sessions. Our first scanning session is 1:00-5:00pm next Tuesday. Will you be around to help at that time? Some sujects might need glasses. Is this OK? Thanks, Jessie From matsuham at NINDS.NIH.GOV Sat Nov 6 21:45:03 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Sat, 6 Nov 2004 15:45:03 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, I tried with the following script: ==================================================== % load data segsize=5; % in seconds SampleRate=600; % per second DataLengthInPoints=144600; resolution=1; DS='X:/raid/meg/JATENWNT_track_20041022_01.ds'; mriFile='X:/raid/meg/TY20041022.mri'; localSpheres=[DS,'/localSpheres.hdm']; f=6; d=1; clear data cfg=[]; cfg.dataset=DS; cfg.trl=[[1:segsize*SampleRate:DataLengthInPoints-segsize*SampleRate+1]',... [segsize*SampleRate:segsize*SampleRate:DataLengthInPoints]',... zeros(fix(DataLengthInPoints/SampleRate/segsize),1)] cfg.channel='MEG' cfg.detrend='yes' data=preprocessing(cfg) %take some time, so do it only neccesory. drawnow % combine with ref signal w{dataset}(time,stim) load w; for loop = 1:length(data.trial) data.trial{loop}=[data.trial{loop};w{1}([1:segsize*SampleRate]+segsize*Sampl eRate*(loop-1),1)']; end data.label=[data.label;{'REF1'}]; % DICS step1 fourier transform cfg=[]; cfg.method = 'fft'; cfg.output = 'powandcsd' cfg.tapsmofrq=0.5; cfg.pad='maxperlen'; cfg.keeptrials = 'yes'; cfg.foilim = [f-0.2,f+0.2]; cfg.sgncmb = channelcombination({'MEG' 'MEG';'MEG' 'REF1'},data.label); [freqDICS01_060] = freqanalysis(cfg, data) drawnow % DICS step 2 source analysis cfg=[]; cfg.refchannel ='REF1'; cfg.method = 'coh_refchan'; cfg.projectnoise='yes'; cfg.hdmfile=localSpheres; cfg.frequency=f; cfg.lambda=1e-31; cfg.xgrid='auto'; cfg.ygrid='auto'; cfg.zgrid='auto'; cfg.resolution=resolution; cfg.keepleadfield='no'; source01_060=sourceanalysis(cfg,freqDICS01_060) drawnow sourceC01_060=sourcedescriptives(cfg,source01_060) drawnow % DICS step3 display cfg.downsample=2; cfg.parameter='coh'; cfg.funparameter='coh'; sourceInterp01_060=sourceinterpolate(cfg,source01_060,mriFile); drawnow figure; sliceinterp(cfg,sourceInterp01_060); set(gcf,'name',['DICS, Dataset ',d,', ',num2str(f),'Hz'],'NumberTitle','off') text(0,-20,['DICS, Dataset ',d,', ',num2str(f),'Hz']) cfg.parameter='coh'; sourceInterpC01_060=sourceinterpolate(cfg,sourceC01_060,mriFile); drawnow figure; sliceinterp(cfg,sourceInterpC01_060); set(gcf,'name',['DICS, Dataset ',d,', ',num2str(f),'Hz'],'NumberTitle','off') text(0,-20,['DICS, Dataset ',d,', ',num2str(f),'Hz']) ========================================== With FieldTrip 0.92, the resultant .coh is clearly above 1. ========================================== >> version ans = 7.0.0.19920 (R14) >> source01_060.avg ans = pow: [1x34580 double] coh: [1x34580 double] noise: [1x34580 double] >> source01_060.avg.coh(2000) ans = 9.6989 >> sourceC01_060.avg %% after sourcedescriptives ans = pow: [1x34580 double] coh: [1x34580 double] noise: [1x34580 double] nai: [1x34580 double] >> sourceC01_060.avg.coh(2000) ans = 9.6989 >> sourceC01_060.avg.nai(2000) ans = 2.1569e+012 >> sourceInterpC01_060.avg ans = coh: [128x128x128 double] >> sourceInterpC01_060.avg.coh(64,64,64) ans = 31.4140 >> sourceInterpC01_060.cfg.version ans = name: 'C:\MATLAB\fieldtrip\sourceinterpolate' id: '$Id: sourceinterpolate.m,v 1.15 2004/08/27 11:21:48 roboos Exp $' >> sourceInterpC01_060.cfg.previous{1}.version ans = name: 'C:\MATLAB\fieldtrip\sourcedescriptives' id: '$Id: sourcedescriptives.m,v 1.4.2.1 2004/09/03 07:17:41 roboos Exp $' ========================================== With FieldTrip 0.94, I had following error. ========================================== .... reading headmodel from file X:/raid/meg/JATENWNT_track_20041022_01.ds/localSpheres.hdm using gradiometers specified in the data selecting 274 first-order gradiometers creating headsurface based on multisphere model and gradiometers 2886 dipoles inside, 31694 dipoles outside brain ??? Undefined command/function 'mbrealvector'. Error in ==> fieldtrip\private\nearest at 14 mbrealvector(array) Error in ==> fieldtrip\private\prepare_freq_matrices at 68 fbin = nearest(freq.foi, cfg.frequency); Error in ==> sourceanalysis at 333 [Cf, Cr, Pr, Ntrials] = prepare_freq_matrices(cfg, freq); Error in ==> doDICS_simple at 52 source01_060=sourceanalysis(cfg,freqDICS01_060) ========================================== Thanks, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From r.oostenveld at FCDONDERS.RU.NL Mon Nov 8 08:59:19 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 8 Nov 2004 08:59:19 +0100 Subject: sourceinterpolate In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCF5C@nihexchange17.nih.gov> Message-ID: Hi Masao On 6 Nov 2004, at 21:45, Matsuhashi, Masao (NIH/NINDS) wrote: > ??? Undefined command/function 'mbrealvector'. Thanks for reporting that bug, I will take care that it is fixed in the upcoming update of fieldtrip. In the meantime, please put the attached mbXXX functions in the private subdirectory of fieldtrip. About the beamed coherence being larger than one, I will contact you directly in a separate email. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: mbvector.m Type: application/octet-stream Size: 128 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbscalar.m Type: application/octet-stream Size: 95 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbrealvector.m Type: application/octet-stream Size: 51 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbrealscalar.m Type: application/octet-stream Size: 50 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbreal.m Type: application/octet-stream Size: 83 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbmatrix.m Type: application/octet-stream Size: 75 bytes Desc: not available URL: -------------- next part -------------- ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From matsuham at NINDS.NIH.GOV Mon Nov 8 21:42:48 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Mon, 8 Nov 2004 15:42:48 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, Thank you. Now the 0.9.4 works and produces the same result (that is still a question :-) ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From matsuham at NINDS.NIH.GOV Mon Nov 8 22:33:12 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Mon, 8 Nov 2004 16:33:12 -0500 Subject: freqdescriptives Message-ID: Hello Robert, I also copied the axial2planar.m and modified the number of gradiometers from 151 to 274, and now it works. The result in our condition is ================ method 1: 0.715570 method 2: 0.923964 method 3: 0.929785 method 4: 0.977297 method 5: 0.715570 ================ Actually, the result of 'orig' method is flower-like and so different from the original. While doing this, I got the following warning message. Is this ok? ================ Warning: higher order synthetic gradiometer configuration(?) > In fieldtrip\private\prepare_vol_sens at 145 In dipolesimulation at 35 ================ Another question: what is the unit of cfg.dip.mom to give to dipolesimulation(). With the unit vector [1,0,0] as in the above test script, the output (axial.trial) is in the order of 1e-9, where the actual recorded signal is usually less than 1e-11. Therefore it is not likely nAm. I am thinking of mixing the simulated data to the real brain background activity. ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From rajamoni at CCS.FAU.EDU Mon Nov 8 22:45:25 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Mon, 8 Nov 2004 16:45:25 -0500 Subject: single-trials data Message-ID: Hi Robert, Would you please tell me the way to generate single-trials source(s) time series data from raw MEG dataset? Thanks and best regards, Sreenivasan From roberto at SMI.AUC.DK Tue Nov 9 09:49:43 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Tue, 9 Nov 2004 09:49:43 +0100 Subject: single-trials data In-Reply-To: <00a301c4c5dc$415a2400$3c1e5b83@vasan> Message-ID: Hi Sreenivasan, On 8 Nov 2004, at 22:45, R. Sreenivasan wrote: > Would you please tell me the way to generate single-trials source(s) > time > series data from raw MEG dataset? sourceanalysis with cfg.method=lcmv and cfg.singletrial=yes. That will use the full data to construct the spatial filter, and apply that filter to each individual trial. It will result in a source structure with source.avg and source.trial. The dipole moment of the single-trial source reconstructions are in source.trial.mom. Source.trial.mom{N} contains the moment for the dipole on position source.pos(N,:). Robert From r.oostenveld at FCDONDERS.RU.NL Tue Nov 9 10:26:10 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 9 Nov 2004 10:26:10 +0100 Subject: planar gradients compared In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FD06F@nihexchange17.nih.gov> Message-ID: Hi MAsao, On 8 Nov 2004, at 22:33, Matsuhashi, Masao (NIH/NINDS) wrote: > I also copied the axial2planar.m and modified the number of > gradiometers > from 151 to 274, and now it works. Could you send me the updated version, so that I can include it in the next release? > The result in our condition is > > ================ > method 1: 0.715570 > method 2: 0.923964 > method 3: 0.929785 > method 4: 0.977297 > method 5: 0.715570 > ================ > > Actually, the result of 'orig' method is flower-like and so different > from > the original. These numbers are the correlation coefficient, and method1 or 'orig', which is the default(!) in fieldtrip is clearly not the best. Btw. 'orig' means that it was the original implementation of the planar gradient computation by Ole Jensen, and does not mean that it is the original axial data. If you plot the amplitude of the planar gradients computed with 'orig', these should _not_ look like the original topoplot. Planar gradient amplitudes are conceptually different from axial gradients (e.g. amplitude is always a positive number, whereas the original data is both positive and negative). Did you check this for different dipole locations? And for different noise levels? The idea was not just to run the script that I sent you, but also to explore it to see how these parameters affect the planar gradient estimation from the axial data. > While doing this, I got the following warning message. Is this ok? > > ================ > Warning: higher order synthetic gradiometer configuration(?) >> In fieldtrip\private\prepare_vol_sens at 145 > In dipolesimulation at 35 > ================ It indicates a potential problem. Fieldtrip is not yet 100% capable of handling the CTF higher order synthetic gradients correctly. At the Donders, we useually do not use the higher order gradients and therefore they have not been implemented completely yet. The problem that I face is that I cannot read the coefficients in a decent fashion (i.e. from the res4 files). In this case (computation of planar gradients) I guess that it does not matter, but for forward and inverse computations the warning is more serious. > Another question: what is the unit of cfg.dip.mom to give to > dipolesimulation(). With the unit vector [1,0,0] as in the above test > script, the output (axial.trial) is in the order of 1e-9, where the > actual > recorded signal is usually less than 1e-11. Therefore it is not likely > nAm. > I am thinking of mixing the simulated data to the real brain background > activity. It is arbitrary units. It depends on the units of your other objects, i.e. whether the volume conductor model is specified in cm or in m, etc. Robert From rajamoni at CCS.FAU.EDU Tue Nov 9 21:32:00 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Tue, 9 Nov 2004 15:32:00 -0500 Subject: single-trials data Message-ID: Hi Robert, Attached is the script that I used for generating single-trial time series data for two dipoles. Then I want to do the freqanalysis on those source time-series data. Unfortunately, I amn't getting it ...Would you please check? Sreenivasan ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Tuesday, November 09, 2004 3:49 AM Subject: Re: [FIELDTRIP] single-trials data > Hi Sreenivasan, > > On 8 Nov 2004, at 22:45, R. Sreenivasan wrote: > > > Would you please tell me the way to generate single-trials source(s) > > time > > series data from raw MEG dataset? > > sourceanalysis with cfg.method=lcmv and cfg.singletrial=yes. That will > use the full data to construct the spatial filter, and apply that > filter to each individual trial. > > It will result in a source structure with source.avg and source.trial. > The dipole moment of the single-trial source reconstructions are in > source.trial.mom. Source.trial.mom{N} contains the moment for the > dipole on position source.pos(N,:). > > Robert -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: singletrial_patch.m URL: From r.oostenveld at FCDONDERS.RU.NL Wed Nov 10 18:38:16 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 10 Nov 2004 18:38:16 +0100 Subject: single-trials data In-Reply-To: <009e01c4c69b$2afc39e0$3c1e5b83@vasan> Message-ID: Hi Sreenivasan On 9 Nov 2004, at 21:32, R. Sreenivasan wrote: > Hi Robert, > > Attached is the script that I used for generating single-trial time > series > data for two dipoles. Then I want to do the freqanalysis on those > source > time-series data. > Unfortunately, I amn't getting it ...Would you please check? > > cfg.vartrllength = 2; This has no effect, since you are not doing partial artifact rejection. Hence all your trials have the same length. > cfg.blc = 'no' > cfg.blcwindow = [-0.0 0.25] This has no effect. > cfg.bpfreq = [8 14] > fg.bpfiltord = 4 > cfg.bpfilttype = 'fir' This will result in a very sloppy filter. > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.pos = [1 4 1; 6 1 2]; > %cfg.singletrial = 'yes'; > cfg.rawtrial = 'yes' > cfg.keepfilter = 'yes' > cfg.hdmfile = strcat(ds, '/localSpheres.hdm'); > [source] = sourceanalysis(cfg, timelock) Your single trial covariances are computed on only a 250ms time window of the filtered data (see timelockanalysis cfg). Therefore each single trial covariance is very poorly estimated and might even be rank deficient (this is something that sourceanalysis will warn you about). You should do singletrial=yes and rawtrial=no. Just to be sure you should also do keepmom=yes. > cfg = []; > cfg.method = 'fft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = smo; > cfg.foilim = [f1 f2]; > %cfg.pad = 2.; > %cfg.keeptrials = 'yes'; > cfg.sgncmb = 'all'; > [freq] = freqanalysis(cfg, source); Freqanalysis is not so smart that it immediately knows how to do its analysis on source data. You'll have to reformat the source data, and especially source.trial.mom (i.e. the estimated dipole moment for each trial) into something that looks like it comes from preprocessing. datasrc = []; datasrc.fsample = data.fsample; datasrc.cfg = source.cfg; for i=1:length(datasrc.time) datasrc.time{i} = timelock.time; datasrc.trial{i} = xxx; % something with source.trial(i).mom{1} and mom{2}; end datasrc.label = xxx; % perhaps {'dip1', 'dip2'}? You'll have to fill out the xxx'es youself and especially you should tink of how you want to treat the 3D dipole moment (i.e. regional source strength with x, y, and z-component), i.e. as three virtual channels or as one virtual channel. Maybe it is first better to have a look at the moments of each dipole in a given trial by just plotting it. Using SVD, you can for example extract the moment strength and orientation along the most dominant direction. Try something like [u, s, v] = svd(source.trial(1).mom{1}); mom = s*v; plot(time, mom); I hope this helps, Robert PS plotting virtual channels with sourceinterpolate and sliceinterpolate won't work, but you already have that commented out. From mariast at ROCKETMAIL.COM Fri Nov 12 11:13:07 2004 From: mariast at ROCKETMAIL.COM (Maria Stavrinou) Date: Fri, 12 Nov 2004 02:13:07 -0800 Subject: importing .eeg data files In-Reply-To: <4D858803-333F-11D9-B0CB-000A95DBB2CC@fcdonders.ru.nl> Message-ID: Hi, I am trying to import .eeg datafile from Neuroscan using the command read_fcdc_data in this sense: dat = read_fcdc_data('dataset_test.eeg', hdr, 1, number_of_trials*number_of_points_in_one_trial*num_channels, chanindx) However i would like to import all 62 channels -could you give me also a hint what to write to chanindx? and the answer i get is: Error using ==> read_fcdc_data cannot read beyond epoch boundary in Neuroscan *.eeg file Thanks Maria Stavrinou --------------------------------- Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Mon Nov 15 09:15:18 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Nov 2004 09:15:18 +0100 Subject: importing .eeg data files In-Reply-To: <20041112101307.18997.qmail@web12609.mail.yahoo.com> Message-ID: Hi Maria, On 12 Nov 2004, at 11:13, Maria Stavrinou wrote: > I am trying to import .eeg datafile from Neuroscan using the command > read_fcdc_data in this sense: > dat = read_fcdc_data('dataset_test.eeg', hdr, 1, > number_of_trials*number_of_points_in_one_trial*num_channels, chanindx) > However i would like to import all 62 channels -could you give me also > a hint what to write to chanindx? > and the answer i get is: > > Error using ==> read_fcdc_data > cannot read beyond epoch boundary in Neuroscan *.eeg file The error is not with chanindx, but with the fact that you are trying to read a very long continuous block of data from a file that contains only epochs. It cannot read data beyond the boundaries between the epochs. In principle you should not be using the read_fcdc_data function to get the data into Fieldtrip, since it is a low-level function. You should use the "preprocessing" function. See "help preprocessing" and "help definetrial". Probably the following configuration will do the trick cfg = [] cfg.datafile = 'dataset_test.eeg' cfg.headerfile = 'dataset_test.eeg' cfg.channel = 'all' raw = preprocessing(cfg) I hope this helps, Robert From rajamoni at CCS.FAU.EDU Tue Nov 16 16:47:28 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Tue, 16 Nov 2004 10:47:28 -0500 Subject: min-norm Message-ID: Hi Robert, I understand that the Fieldtrip uses LCMV method for source analysis. Do you have any routine(s) that uses min-norm option? Thank you Sreenivasan From r.oostenveld at FCDONDERS.RU.NL Wed Nov 17 14:19:15 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 17 Nov 2004 14:19:15 +0100 Subject: min-norm In-Reply-To: <003301c4cbf3$93515950$3c1e5b83@vasan> Message-ID: Hi Sreenivasan, There are different source analysis options implemented in FieldTrip, namely LCMV, DICS and single or multiple spatiotemporal dipole fitting. Minimum current or minimum norm solutions based on a distributed source model are not implemented. Ii principle implementing a minimum norm solution would be very easy, but it is quite difficult to implement a good regularization method. Furthermore, implementing a good and robust distributed source model (based on the cortical surface) is quite some work. best regards, Robert On 16 Nov 2004, at 16:47, R. Sreenivasan wrote: > Hi Robert, > > I understand that the Fieldtrip uses LCMV method for source analysis. > Do you > have any routine(s) that uses min-norm option? > > Thank you > Sreenivasan > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From rajamoni at CCS.FAU.EDU Thu Nov 18 00:00:39 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Wed, 17 Nov 2004 18:00:39 -0500 Subject: co-ordinate Message-ID: Hi Robert, Is there any function in Fieldtrip to translate the Freesurfer-RAS or Talairach co-ordinate system to the system that Fieldtrip uses? (e.g. giving the dipole position - cfg.grid.pos = [x y z] for source analysis) The other question is related to extracting source single-trial data. Earlier You suggested that the source signal could be extracted by the following way: ([u,s,v]=svd(dipole.moment)) and s*v produces 3 components of source. Instead can we compute from the dipole (3D) moment by sqrt(x^2+y^2+z^2) for each trial? Thank you, Best regards, Sreenivasan From r.oostenveld at FCDONDERS.RU.NL Thu Nov 18 12:30:55 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 18 Nov 2004 12:30:55 +0100 Subject: co-ordinate In-Reply-To: <017401c4ccf9$419d3000$3c1e5b83@vasan> Message-ID: Hi Sreenivasan On 18 Nov 2004, at 0:00, R. Sreenivasan wrote: > Is there any function in Fieldtrip to translate the Freesurfer-RAS or > Talairach co-ordinate system to the system that Fieldtrip uses? (e.g. > giving > the dipole position - cfg.grid.pos = [x y z] for source analysis) Fieldtrip does not use it's own intrinsic coordinate system. Instead, if you read in geometrical information from a CTF file (dataset or mri), that geometrical information such as sensor positions or voxels will be represented in Matlab memory in CTF coordinates. For other types of input data (e.g. Neuromag MEG or SPM/analyze MRI's) the coordinate system can be different. As the user it is your own responsibility to ensure that coordinate systems of the different input objects/datafiles match. Of course it is possible to "convert from one to the other coordinate system". But conceptually one does not convert the coordinate system, instead the geometrical description of the data is converted: i.e. a [x y z] point in one coordinate system is converted to [x' y' z'] in another coordinate system. Please have a look at http://www2.ru.nl/fcdonders/fieldtrip/faq.html#q4 http://www2.ru.nl/fcdonders/fieldtrip/faq.html#q5 to see the Fieldtrip specific details. Furthermore, I suggest that you have a look at http://bishopw.loni.ucla.edu/AIR5/homogenous.html to get an understanding for the general concept of a "homogenous coordinate transformation", which is used in Fieldtrip. Basically the problem boils down to obtaining a mathematical description of the coordinate transformation that relates your data (in CTF coordinates I guess) to Freesurfer-RAS or Talairach coordinates. I don't know what Freesurfer-RAS uses, but Talairach and CTF cannot be linked easily together with this homogenous transformation. E.g. SPM uses nonlinear spatial normalization to align an individual MRI to a standard MRI. This SPM approach of spatially realigning or normalizing volume data will become part of Fieldtrip in the future. > The other question is related to extracting source single-trial data. > > Earlier You suggested that the source signal could be extracted by the > following way: ([u,s,v]=svd(dipole.moment)) and s*v produces 3 > components > of source. Instead can we compute from the dipole (3D) moment by > sqrt(x^2+y^2+z^2) for each trial? Yes, but that is the magnitude of the rotating dipole moment instead of its strength along a specified direction (which you would gvet with the svd trick). The magnitude is always positive, the strength along one direction is both positive and negative. You can use whichever you think best captures the activity at that particular location, but personally I prefer the dipole moment amplitude along a specific direction because of its more clear physical interpretation. best regards, Robert Oostenveld From Thomas.Koelewijn at FCDONDERS.RU.NL Mon Nov 29 12:39:38 2004 From: Thomas.Koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 29 Nov 2004 12:39:38 +0100 Subject: multiplotER In-Reply-To: <4F9B5B2E-3955-11D9-A77D-000A95DBB2CC@fcdonders.ru.nl> Message-ID: Dear all, I'm trying to use the multiplotER function as described in the fieldtrip tutorial. cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; clf; multiplotER (cfg, avgFIC); But the I get this reply. ??? Attempt to execute SCRIPT dataread as a function. Error in ==> C:\MATLAB6p5p1\toolbox\matlab\iofun\textread.m On line 172 ==> [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> h:\common\matlab\fieldtrip\multiplotER.m On line 138 ==> [chNum,X,Y,Width,Height,Lbl] = textread(cfg.layoutname,'%f %f %f %f %f %s'); Are there any changes made in this function? Gr. Thomas From Thomas.Koelewijn at FCDONDERS.RU.NL Mon Nov 29 13:36:55 2004 From: Thomas.Koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 29 Nov 2004 13:36:55 +0100 Subject: multiplotER In-Reply-To: Message-ID: Dear all, I made a stupid mistake, sorry for bothering you It's all fixed now Gr. Thomas -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Thomas Koelewijn Sent: maandag 29 november 2004 12:40 To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] multiplotER Dear all, I'm trying to use the multiplotER function as described in the fieldtrip tutorial. cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; clf; multiplotER (cfg, avgFIC); But the I get this reply. ??? Attempt to execute SCRIPT dataread as a function. Error in ==> C:\MATLAB6p5p1\toolbox\matlab\iofun\textread.m On line 172 ==> [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> h:\common\matlab\fieldtrip\multiplotER.m On line 138 ==> [chNum,X,Y,Width,Height,Lbl] = textread(cfg.layoutname,'%f %f %f %f %f %s'); Are there any changes made in this function? Gr. Thomas From roberto at SMI.AUC.DK Mon Nov 1 09:15:41 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Mon, 1 Nov 2004 09:15:41 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FC9A1@nihexchange17.nih.gov> Message-ID: Dear Masao I cannot give a recoomendation for the interpolation method to use to compute the planar gradients. Most people at the Donders are using 'orig, buy I found myself that the 'sincos' seemed to be the most accurate. I expect that the 'fitplane' will work less wel at the boundary of the helmet. The proper way to evaluate these different methods would be to use them on simulated data, since it probably will depend on the source location and amount of noise. Important to realise is that they all do something with your data which migh or might not be desirable. It makes the topographic display of the data easier to interpret (desirable), but makes it also more noise sensitive and introduces linear dependencies in neighbouring channels which were not neccessary present in the original data (undesirable). When possible, I personally try to avoid it. But people who are used to the Neuromag system probably will be biassed the other way around, and try to use it whenever possible. best regards, Robert On 31 Oct 2004, at 20:32, Matsuhashi, Masao (NIH/NINDS) wrote: > 2. Do you have any suggestion which of three simple interpolation > method > ('orig' | 'sincos' | 'fitplane') to use in megplanar? > The 'orig' method requires less memory, but seems less reliable.... I > checked with SEF N20m data and the 'orig' method produced four peaks > in the > gradient contour map. The 'fitplane' seems best among the three in this > respect, am I right? > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From t.montez at VUMC.NL Tue Nov 2 16:54:46 2004 From: t.montez at VUMC.NL (Montez, T.) Date: Tue, 2 Nov 2004 16:54:46 +0100 Subject: resampledata Message-ID: Hi, Using the code: addpath E:\Matlab\fieldtrip-0.9.2 % READING THE DATA hdr = read_fcdc_header('E:\Matlab\Data\A012-4channels.ds\A012-4channels.res4'); dat = read_fcdc_data('E:\Matlab\Data\A012-4channels.ds\A012-4channels.meg4', hdr, 1, 4096); cfg = []; cfg.dataset = 'E:\Matlab\Data\A012-4channels.ds' cfg.trl=[1 4096 0] cfg.channel='MEG' datatest = preprocessing(cfg) save ('E:\Matlab\Data\Test\datatest') % FILTERING AND RESAMPLE cfg.lpfreq = 13 cfg.resamplefs = 250 datatest_filtered = resampledata(cfg, datatest) cfg.hpfreq = 8 datatest_filtered = preprocessing(cfg) save ('E:\Matlab\Data\Test\datatest_filtered') I get the error: % ??? Error using ==> preprocessing % resampling is not supported any more, see RESAMPLEDATA However it seem to work: >> datatest_filtered datatest_filtered = cfg: [1x1 struct] hdr: [1x1 struct] label: {4x1 cell} trial: {[4x1639 double]} offset: 0 time: {[1x1639 double]} fsample: 250 grad: [1x1 struct] origfsample: 625 origoffset: 0 origtime: {[1x4096 double]} >> cfg cfg = dataset: 'E:\Matlab\Data\A012-4channels.ds' trl: [1 4096 0] channel: 'MEG' lpfreq: 13 resamplefs: 250 hpfreq: 8 I am skipping cfg.detrend ='yes' because it is the default. Should I use cfg.downsample=X; instead of resampledata? The file resampledata.m does not appear in the reference documentation list of the FieldTrip webpage. Thanks, Teresa Montez From roberto at SMI.AUC.DK Tue Nov 2 17:56:18 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Tue, 2 Nov 2004 17:56:18 +0100 Subject: resampledata In-Reply-To: <04Nov2.165722cet.334410@nucleus.azvu.nl> Message-ID: Hi Teresa Reading through your screen output, I notice that you are reusing the same variable name. I.e. you are doing cfg = something datatest = preprocessing, no problem datatest_filtered = resampledata, also works fine then you do cfg = something else, including resamplefs datatest_filtered = preprocessing -> gives error Subsequently you appear supprised that datatest_filtered exists, but it was the result of the first call to resampledata, and not to the second call to preprocessing. The 2nd preprocessing gave an error and did not overwrite the variable. In the old days, resampling used to be done inside preprocessing, but it actually was a separate function right from its initial implementation. Conceptually it makes sense to think of resampling/downsampling as part of the preprocessing, but it never was implemented optimally in preprocessing. Therefore it was taken out of the preprocessing. To ensure that people with old configurations do not incorrectly assume that their preprocessed data is downsampled, it gives an error if you try to resample/downsample with the preprocessing function. Instead you should call preprocessing, and then call resampledata like cfgpre = something data = preprocessing(cfgpre); cfgdwn = [] cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, data); clear data or in one line as cfgpre = something cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, preprocessing(cfgpre)); Another hint: if you want to check what configuration was really used in any fieldtrip analysis step, you should look at the configuration that is contained in the output data. I will try to implement a more thorough warning/error system for configuration fields that are not being used by a specific function. > I am skipping cfg.detrend ='yes' because it is the default. The default (of any fieldtrip function) is not neccesary what you want. Please think about what you want and specify it. Also remember that defaults can change between versions. For ERPs you probably do not want to detrend the data prior to downsampling (but you do want to baselinecorrect with the proper baseline window), for TFRs it does not really matter too much and it might be advantageous to detrend. Actually, I don't think that in this case the default is the best option in general. > Should I use cfg.downsample=X; instead of resampledata? No, that is not an option for preprocessing, nor for resampledata. > The file resampledata.m does not appear in the reference documentation > list > of the FieldTrip webpage. I'll add it in a future version of the documentation. Thanks for letting me know. You get the most up to date documentation of any fieldtrip function by typing "help functionname". You will see from the documentation that cfg.resamplefs is NOT an option for preprocessing, and also that cfg.lpfreq is not an option for resampledata (you specified it incorerctly in the cfg in your mail). best regards, Robert PS Attached you will find the most recent version of resampledata, a small bug in the re-computation of the time axis has been fixed. Also the help has been updated. -------------- next part -------------- A non-text attachment was scrubbed... Name: resampledata.m Type: application/octet-stream Size: 2567 bytes Desc: not available URL: -------------- next part -------------- On 2 Nov 2004, at 16:54, Montez, T. wrote: > Hi, > > Using the code: > > > addpath E:\Matlab\fieldtrip-0.9.2 > > % READING THE DATA > > hdr = > read_fcdc_header('E:\Matlab\Data\A012-4channels.ds\A012 > -4channels.res4'); > dat = > read_fcdc_data('E:\Matlab\Data\A012-4channels.ds\A012-4channels.meg4', > hdr, 1, 4096); > > cfg = []; > > cfg.dataset = 'E:\Matlab\Data\A012-4channels.ds' > cfg.trl=[1 4096 0] > > cfg.channel='MEG' > > datatest = preprocessing(cfg) > save ('E:\Matlab\Data\Test\datatest') > > % FILTERING AND RESAMPLE > > cfg.lpfreq = 13 > > cfg.resamplefs = 250 > datatest_filtered = resampledata(cfg, datatest) > > cfg.hpfreq = 8 > > datatest_filtered = preprocessing(cfg) > save ('E:\Matlab\Data\Test\datatest_filtered') > > > I get the error: > > > % ??? Error using ==> preprocessing > % resampling is not supported any more, see RESAMPLEDATA > > > > However it seem to work: > > >>> datatest_filtered > > datatest_filtered = > > cfg: [1x1 struct] > hdr: [1x1 struct] > label: {4x1 cell} > trial: {[4x1639 double]} > offset: 0 > time: {[1x1639 double]} > fsample: 250 > grad: [1x1 struct] > origfsample: 625 > origoffset: 0 > origtime: {[1x4096 double]} > >>> cfg > > cfg = > > dataset: 'E:\Matlab\Data\A012-4channels.ds' > trl: [1 4096 0] > channel: 'MEG' > lpfreq: 13 > resamplefs: 250 > hpfreq: 8 > > > I am skipping cfg.detrend ='yes' because it is the default. > > Should I use cfg.downsample=X; instead of resampledata? > > The file resampledata.m does not appear in the reference documentation > list > of the FieldTrip webpage. > > > Thanks, > Teresa Montez > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From rajamoni at CCS.FAU.EDU Wed Nov 3 15:48:50 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Wed, 3 Nov 2004 09:48:50 -0500 Subject: Coherent sources Message-ID: Is it possible to compute coherence (sources) for more than one reference dipoles (i.e, network) using Fieltrip? ______________________________________________ R. Sreenivasan, Ph.D. Center for Complex Systems & Brain Sciences 777 Glades Road, Florida Atlantic University Boca Raton, FL 33431 Phone: 561-297-0111 (off) 561-367-0857 (home) Fax: 561-297-3634 e-mail: rajamoni at ccs.fau.edu ______________________________________________ From matsuham at NINDS.NIH.GOV Thu Nov 4 04:06:03 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Wed, 3 Nov 2004 22:06:03 -0500 Subject: freqdescriptives Message-ID: Dear Robert, Thank you for the comment. This kind of information is very helpful. Since I was grown up with Neuromag122 but now using Omega, I have to try not to be biased as such. The simulation is certainly one important thing to do. I will ask our MEG scientist. Additional question. What is the unit/dimension of the source activity calculated by sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate->sliceinterp? It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar showed something like 0 to 20 and 0 to 140. It seems like absolute or power of cross-spectra.... Regards, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From tomh at KURAGE.NIMH.NIH.GOV Thu Nov 4 05:07:41 2004 From: tomh at KURAGE.NIMH.NIH.GOV (Tom Holroyd) Date: Wed, 3 Nov 2004 23:07:41 -0500 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCD6B@nihexchange17.nih.gov> Message-ID: > The simulation is certainly one important thing to do. I will ask our MEG > scientist. Hmm. I guess that's me. :-) I may as well mention here, that there's a VSM(CTF) program called "dsim" which can add a given simulated dipole (or several) to an existing dataset. You can either start with an empty sensor noise recording, or live data. Then see if you can find it again. :-) See also dsim -help. Dr. Tom Holroyd "A man of genius makes no mistakes. His errors are volitional and are the portals of discovery." -- James Joyce From roberto at SMI.AUC.DK Thu Nov 4 09:35:00 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:35:00 +0100 Subject: Coherent sources In-Reply-To: <004101c4c1b4$3b3a0a30$3c1e5b83@vasan> Message-ID: Hi, On 3 Nov 2004, at 15:48, R. Sreenivasan wrote: > Is it possible to compute coherence (sources) for more than one > reference > dipoles (i.e, network) using Fieltrip? It is not possible to compute it with the frequency implementation of the beamformer (i.e. DICS). However, you could use the following approach - PREPROCESSING - TIMELOCKANALYSIS using a bandpass filter (which is a hidden option) in the frequency band of interest (not too narrow), with covariance=yes and keeptrials=yes - SOURCEANALYSIS with method=lcmv and singletrial=yes, with cfg.grid.pos equal to the locations of interest - FREQANALYSIS on the output of sourceanalysis, i.e. analyze the virtual channel that was constructed on each location of interest with output=powandcsd - FREQDESCRIPTIVES The sourceanalysis with method=lcmv and singletrial=yes will compute the average covariance matrix from your data and use that to construct the spatial filter. Subsequently the spatial filter is applied to each trial seperately. The reason for averaging the trials prior to applying the filters to the individual trials is that each individual trial covariance is probably rank deficient, and will at least be pooirly estimated resulting in poorly defined spatial filters. However, the spatial filter can be determined robustly from the average. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Thu Nov 4 09:49:14 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:49:14 +0100 Subject: freqdescriptives In-Reply-To: Message-ID: Hi Tom, Thanks for the hint. There is also a DIPOLESIMULATION function in FieldTrip. You probably will want to look into "private/axial2planar" as well. I suppose that the most meaningfull simulation will be one in which you compute forward on a axial gradiometer system, and on a planar system. Then try MEGPLANAR to convert the axial data to estimated planar data, and compare with real planar data. See the attached script, which basically does it all... I am curious as to what it will bring for different source parameters and levels of simulated and real physiological (i.e. spatially correlated) noise. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: test_RO_014.m Type: application/octet-stream Size: 2227 bytes Desc: not available URL: -------------- next part -------------- On 4 Nov 2004, at 5:07, Tom Holroyd wrote: >> The simulation is certainly one important thing to do. I will ask our >> MEG >> scientist. > > Hmm. I guess that's me. :-) I may as well mention here, that > there's a VSM(CTF) program called "dsim" which can add a given > simulated dipole (or several) to an existing dataset. You can > either start with an empty sensor noise recording, or live data. > Then see if you can find it again. :-) > > See also dsim -help. From roberto at SMI.AUC.DK Thu Nov 4 09:21:31 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 09:21:31 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCD6B@nihexchange17.nih.gov> Message-ID: Hi Masao, On 4 Nov 2004, at 4:06, Matsuhashi, Masao (NIH/NINDS) wrote: > Additional question. What is the unit/dimension of the source activity > calculated by > sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate- > >sliceinterp? > It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar > showed something like 0 to 20 and 0 to 140. It seems like absolute or > power > of cross-spectra.... The unit depends on what estimated source parameter you are looking at: source.avg.pow is dipole power, which is expressible in (nAm)^2. But since Fieldtrip is unaware of the physical units of all the "dataobjects" (volume conductor, data, sensor geometry) that go into the computation, the result should be interpreted as arbitrary units. source.avg.coh is the coherence, which is equal to the squared coherency. Both coherence and coherency are between 0 and 1. source.avg.noise is the estimated projected noise, where the noise is assumed to be uncorrelated and of equal magnitude between channels and where the amplitude of the noise is scaled with the smallest singular value of the cross-spectral density matrix. The projected noise has the same units as the power, i.e. arbitrary units in principle. After sourcedecriptives, source.avg.nai equals the neural activity index, which is defined as pow/noise. It is dimensionless and always >=0. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From Johannes.Sarnthein at USZ.CH Thu Nov 4 10:35:35 2004 From: Johannes.Sarnthein at USZ.CH (Sarnthein Johannes) Date: Thu, 4 Nov 2004 10:35:35 +0100 Subject: AW: [FIELDTRIP] freqdescriptives Message-ID: Dear Robert, there is too much traffic, please unsubscribe me from the fieldtrip list. I enjoy using your dipfit with EEGLAB. Looking forward to your comments in the EEGLAB list. Best, Johannes -----Ursprüngliche Nachricht----- Von: Robert Oostenveld [mailto:roberto at SMI.AUC.DK] Gesendet: Donnerstag, 4. November 2004 09:22 An: FIELDTRIP at nic.surfnet.nl Betreff: Re: [FIELDTRIP] freqdescriptives Hi Masao, On 4 Nov 2004, at 4:06, Matsuhashi, Masao (NIH/NINDS) wrote: > Additional question. What is the unit/dimension of the source activity > calculated by > sourceanalysis(cfg.method='coh_refchan')->sourceinterpolate- > >sliceinterp? > It may be [0,1] as in Gross(2001) if it is coherence, but the colorbar > showed something like 0 to 20 and 0 to 140. It seems like absolute or > power > of cross-spectra.... The unit depends on what estimated source parameter you are looking at: source.avg.pow is dipole power, which is expressible in (nAm)^2. But since Fieldtrip is unaware of the physical units of all the "dataobjects" (volume conductor, data, sensor geometry) that go into the computation, the result should be interpreted as arbitrary units. source.avg.coh is the coherence, which is equal to the squared coherency. Both coherence and coherency are between 0 and 1. source.avg.noise is the estimated projected noise, where the noise is assumed to be uncorrelated and of equal magnitude between channels and where the amplitude of the noise is scaled with the smallest singular value of the cross-spectral density matrix. The projected noise has the same units as the power, i.e. arbitrary units in principle. After sourcedecriptives, source.avg.nai equals the neural activity index, which is defined as pow/noise. It is dimensionless and always >=0. best regards, Robert ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Thu Nov 4 11:00:43 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Thu, 4 Nov 2004 11:00:43 +0100 Subject: AW: [FIELDTRIP] freqdescriptives In-Reply-To: <2B9546F31DBA5A41A7C0F5D70A31999002422F0A@DS-00181.usz.ch> Message-ID: Dear Johannes (and other subscribers) On http://nic.surfnet.nl/archives/fieldtrip.html you can unsubscribe yourself or, alternatively, you can switch to digest mode. Also other configuration options can be set there, and help is provided for the different list options. best regards, Robert On 4 Nov 2004, at 10:35, Sarnthein Johannes wrote: > Dear Robert, > there is too much traffic, please unsubscribe me from the fieldtrip > list. > I enjoy using your dipfit with EEGLAB. > Looking forward to your comments in the EEGLAB list. > Best, > Johannes From rajamoni at CCS.FAU.EDU Thu Nov 4 20:57:09 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Thu, 4 Nov 2004 14:57:09 -0500 Subject: Coherent sources Message-ID: Hi Robert, I find it difficult to figure out the hidden option of the frequency in timelockanalysis. Would you please send me a sample script? Thanks Best regards, Sreenivasan ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Thursday, November 04, 2004 3:35 AM Subject: Re: [FIELDTRIP] Coherent sources > Hi, > > On 3 Nov 2004, at 15:48, R. Sreenivasan wrote: > > > Is it possible to compute coherence (sources) for more than one > > reference > > dipoles (i.e, network) using Fieltrip? > > It is not possible to compute it with the frequency implementation of > the beamformer (i.e. DICS). However, you could use the following > approach > > - PREPROCESSING > - TIMELOCKANALYSIS using a bandpass filter (which is a hidden option) > in the frequency band of interest (not too narrow), with covariance=yes > and keeptrials=yes > - SOURCEANALYSIS with method=lcmv and singletrial=yes, with > cfg.grid.pos equal to the locations of interest > - FREQANALYSIS on the output of sourceanalysis, i.e. analyze the > virtual channel that was constructed on each location of interest with > output=powandcsd > - FREQDESCRIPTIVES > > The sourceanalysis with method=lcmv and singletrial=yes will compute > the average covariance matrix from your data and use that to construct > the spatial filter. Subsequently the spatial filter is applied to each > trial seperately. The reason for averaging the trials prior to applying > the filters to the individual trials is that each individual trial > covariance is probably rank deficient, and will at least be pooirly > estimated resulting in poorly defined spatial filters. However, the > spatial filter can be determined robustly from the average. > > > best regards, > Robert > > ---------------------------------------------------------------------- > Robert Oostenveld, PhD > Center for Sensory-Motor Interaction (SMI) > Aalborg University, Denmark > > and > > F.C. Donders Centre for Cognitive Neuroimaging > University Nijmegen > P.O. Box 9101 > NL-6500 AH Nijmegen > The Netherlands > > Tel: +31 (0)24 3619695 > Fax: +31 (0)24 3610989 > ---------------------------------------------------------------------- > N.B. Starting from 1 September 2004, the University of Nijmegen has > changed its name to Radboud University Nijmegen. All web- and > email-addresses ending in ".kun.nl" should therefore be changed into > ".ru.nl". Please update your address book and links. From matsuham at NINDS.NIH.GOV Fri Nov 5 01:16:44 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Thu, 4 Nov 2004 19:16:44 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, Let the output of sourceinterpolate as SI, then the SI.avg contains only one field, 'coh'. The elements of SI.avg.coh are way larger than 1, so they must be the neural activity index, am I correct? Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From matsuham at NINDS.NIH.GOV Fri Nov 5 01:21:37 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Thu, 4 Nov 2004 19:21:37 -0500 Subject: freqdescriptives Message-ID: Hi Robert, Tom said that we do not have the read_ctf_res4.m script that is called in your test_RO_014.m script. Would you tell us how can we get one, or any replacements? Regards, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From roberto at SMI.AUC.DK Fri Nov 5 08:49:02 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:49:02 +0100 Subject: Coherent sources In-Reply-To: <005201c4c2a8$7822d720$3c1e5b83@vasan> Message-ID: Hi Sreenivasan The bandpass filter options in timelockanalysis have the same config as those in preprocessing. If you open timelockanalysis in the editor, and jump to the first comments after the initial help block (in my version it is around line 42), you will see % Undocumented options: % cfg.blc = 'no' or 'yes' % cfg.blcwindow = [begin end] % cfg.bpfilter = 'no' or 'yes' % cfg.bpfreq = [low high] % cfg.bpfiltord = number giving the filter order % cfg.bpfilttype = 'but' or 'fir' % The filtering options are supported here only to compute the covariance % matrix in a specific frequency band while avoiding to do the preprocessing many times. I guess that that should suffice as explanation. Maybe some extra words on why they are hidden as option: in preprocessing you can pad the trial data with some extra data that also is read from the (continuous) file. After this (optional) padding, the data is filtered. That means that any filter artifacts will occur in the padded begin and end of the datasegment, and those "pads" are again removed after filtering. In timelockanalysis it is not possible to pad the data any more, hence filtering should preferably done when as much of the data is present. best regards, Robert On 4 Nov 2004, at 20:57, R. Sreenivasan wrote: > Hi Robert, > > I find it difficult to figure out the hidden option of the frequency in > timelockanalysis. Would you please send me a sample script? > > Thanks > Best regards, Sreenivasan ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From r.oostenveld at FCDONDERS.RU.NL Fri Nov 5 08:53:44 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:53:44 +0100 Subject: sourceinterpolate In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCE2F@nihexchange17.nih.gov> Message-ID: On 5 Nov 2004, at 1:16, Matsuhashi, Masao (NIH/NINDS) wrote: > Let the output of sourceinterpolate as SI, then the SI.avg contains > only one > field, 'coh'. The elements of SI.avg.coh are way larger than 1, so > they must > be the neural activity index, am I correct? For sourceinterpolate you have specified which parameter you wanted to be interpolated, i.e. you will have done cfg.parameter='coh'. Then only coherence is interpolated. If you do cfg.parameter='all', also power and nai (if present) will be interpolated. S1.avg.coh is coherence, and not nai. It being larger than one looks like a bug or an interpolation artifact. Can you check whether it is also larger than one in the non-interpolated source reconstruction? What version of fieldtrip, and specifically sourceanalysis are you using? Please look at source.cfg.version or S1.cfg.previous.version (i.e. the version of the previous step before interpolation). And what version of sourceinterpolate (S1.cfg.version)? Robert ---------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From roberto at SMI.AUC.DK Fri Nov 5 08:55:36 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 08:55:36 +0100 Subject: freqdescriptives In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCE30@nihexchange17.nih.gov> Message-ID: Hi Masao, You will find it in fieldtrip/private. Just copy it from there to your working directory. Also copy the read_ctgf_res4.p file along (they go together). Robert On 5 Nov 2004, at 1:21, Matsuhashi, Masao (NIH/NINDS) wrote: > Tom said that we do not have the read_ctf_res4.m script that is called > in > your test_RO_014.m script. Would you tell us how can we get one, or any > replacements? ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From t.montez at VUMC.NL Fri Nov 5 15:36:43 2004 From: t.montez at VUMC.NL (Montez, T.) Date: Fri, 5 Nov 2004 15:36:43 +0100 Subject: resampledata/offset2time Message-ID: Hi Robert, After doing the changes you proposed: cfgpre = something data = preprocessing(cfgpre); cfgdwn = [] cfgdwn.resamplefs = something datadwn = resampledata(cfgdwn, data); I get the error message: ??? Undefined function or variable 'offset2time'. Error in ==> E:\Matlab\fieldtrip-0.9.2\resampledata.m On line 65 ==> data.time{itr} = offset2time(data.offset(itr), data.fsample, size(data.trial{itr},2)); Do I need the offset2time.m ? Best regards, Teresa From roberto at SMI.AUC.DK Fri Nov 5 16:28:12 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Fri, 5 Nov 2004 16:28:12 +0100 Subject: resampledata/offset2time In-Reply-To: <04Nov5.153906cet.334940@nucleus.azvu.nl> Message-ID: On 5 Nov 2004, at 15:36, Montez, T. wrote: > ??? Undefined function or variable 'offset2time'. > > Do I need the offset2time.m ? Yes. That function should be in private, but it was added to private after release 0.9.2. Please upgrade to the latest version from the website (0.9.4), then copy the resampledata that I sent you as attachment into the fieldtrip directory, then it should work. best regards, Robert From luoj at MAIL.NIH.GOV Fri Nov 5 21:36:35 2004 From: luoj at MAIL.NIH.GOV (Luo, Jessie (NIH/NIMH)) Date: Fri, 5 Nov 2004 15:36:35 -0500 Subject: scanning next week Message-ID: Hi Tom, Thanks so much again for coming over for troubleshooting!! Also tahnks for the approval of our future scanning sessions. Our first scanning session is 1:00-5:00pm next Tuesday. Will you be around to help at that time? Some sujects might need glasses. Is this OK? Thanks, Jessie From matsuham at NINDS.NIH.GOV Sat Nov 6 21:45:03 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Sat, 6 Nov 2004 15:45:03 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, I tried with the following script: ==================================================== % load data segsize=5; % in seconds SampleRate=600; % per second DataLengthInPoints=144600; resolution=1; DS='X:/raid/meg/JATENWNT_track_20041022_01.ds'; mriFile='X:/raid/meg/TY20041022.mri'; localSpheres=[DS,'/localSpheres.hdm']; f=6; d=1; clear data cfg=[]; cfg.dataset=DS; cfg.trl=[[1:segsize*SampleRate:DataLengthInPoints-segsize*SampleRate+1]',... [segsize*SampleRate:segsize*SampleRate:DataLengthInPoints]',... zeros(fix(DataLengthInPoints/SampleRate/segsize),1)] cfg.channel='MEG' cfg.detrend='yes' data=preprocessing(cfg) %take some time, so do it only neccesory. drawnow % combine with ref signal w{dataset}(time,stim) load w; for loop = 1:length(data.trial) data.trial{loop}=[data.trial{loop};w{1}([1:segsize*SampleRate]+segsize*Sampl eRate*(loop-1),1)']; end data.label=[data.label;{'REF1'}]; % DICS step1 fourier transform cfg=[]; cfg.method = 'fft'; cfg.output = 'powandcsd' cfg.tapsmofrq=0.5; cfg.pad='maxperlen'; cfg.keeptrials = 'yes'; cfg.foilim = [f-0.2,f+0.2]; cfg.sgncmb = channelcombination({'MEG' 'MEG';'MEG' 'REF1'},data.label); [freqDICS01_060] = freqanalysis(cfg, data) drawnow % DICS step 2 source analysis cfg=[]; cfg.refchannel ='REF1'; cfg.method = 'coh_refchan'; cfg.projectnoise='yes'; cfg.hdmfile=localSpheres; cfg.frequency=f; cfg.lambda=1e-31; cfg.xgrid='auto'; cfg.ygrid='auto'; cfg.zgrid='auto'; cfg.resolution=resolution; cfg.keepleadfield='no'; source01_060=sourceanalysis(cfg,freqDICS01_060) drawnow sourceC01_060=sourcedescriptives(cfg,source01_060) drawnow % DICS step3 display cfg.downsample=2; cfg.parameter='coh'; cfg.funparameter='coh'; sourceInterp01_060=sourceinterpolate(cfg,source01_060,mriFile); drawnow figure; sliceinterp(cfg,sourceInterp01_060); set(gcf,'name',['DICS, Dataset ',d,', ',num2str(f),'Hz'],'NumberTitle','off') text(0,-20,['DICS, Dataset ',d,', ',num2str(f),'Hz']) cfg.parameter='coh'; sourceInterpC01_060=sourceinterpolate(cfg,sourceC01_060,mriFile); drawnow figure; sliceinterp(cfg,sourceInterpC01_060); set(gcf,'name',['DICS, Dataset ',d,', ',num2str(f),'Hz'],'NumberTitle','off') text(0,-20,['DICS, Dataset ',d,', ',num2str(f),'Hz']) ========================================== With FieldTrip 0.92, the resultant .coh is clearly above 1. ========================================== >> version ans = 7.0.0.19920 (R14) >> source01_060.avg ans = pow: [1x34580 double] coh: [1x34580 double] noise: [1x34580 double] >> source01_060.avg.coh(2000) ans = 9.6989 >> sourceC01_060.avg %% after sourcedescriptives ans = pow: [1x34580 double] coh: [1x34580 double] noise: [1x34580 double] nai: [1x34580 double] >> sourceC01_060.avg.coh(2000) ans = 9.6989 >> sourceC01_060.avg.nai(2000) ans = 2.1569e+012 >> sourceInterpC01_060.avg ans = coh: [128x128x128 double] >> sourceInterpC01_060.avg.coh(64,64,64) ans = 31.4140 >> sourceInterpC01_060.cfg.version ans = name: 'C:\MATLAB\fieldtrip\sourceinterpolate' id: '$Id: sourceinterpolate.m,v 1.15 2004/08/27 11:21:48 roboos Exp $' >> sourceInterpC01_060.cfg.previous{1}.version ans = name: 'C:\MATLAB\fieldtrip\sourcedescriptives' id: '$Id: sourcedescriptives.m,v 1.4.2.1 2004/09/03 07:17:41 roboos Exp $' ========================================== With FieldTrip 0.94, I had following error. ========================================== .... reading headmodel from file X:/raid/meg/JATENWNT_track_20041022_01.ds/localSpheres.hdm using gradiometers specified in the data selecting 274 first-order gradiometers creating headsurface based on multisphere model and gradiometers 2886 dipoles inside, 31694 dipoles outside brain ??? Undefined command/function 'mbrealvector'. Error in ==> fieldtrip\private\nearest at 14 mbrealvector(array) Error in ==> fieldtrip\private\prepare_freq_matrices at 68 fbin = nearest(freq.foi, cfg.frequency); Error in ==> sourceanalysis at 333 [Cf, Cr, Pr, Ntrials] = prepare_freq_matrices(cfg, freq); Error in ==> doDICS_simple at 52 source01_060=sourceanalysis(cfg,freqDICS01_060) ========================================== Thanks, Masao ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From r.oostenveld at FCDONDERS.RU.NL Mon Nov 8 08:59:19 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 8 Nov 2004 08:59:19 +0100 Subject: sourceinterpolate In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FCF5C@nihexchange17.nih.gov> Message-ID: Hi Masao On 6 Nov 2004, at 21:45, Matsuhashi, Masao (NIH/NINDS) wrote: > ??? Undefined command/function 'mbrealvector'. Thanks for reporting that bug, I will take care that it is fixed in the upcoming update of fieldtrip. In the meantime, please put the attached mbXXX functions in the private subdirectory of fieldtrip. About the beamed coherence being larger than one, I will contact you directly in a separate email. best regards, Robert -------------- next part -------------- A non-text attachment was scrubbed... Name: mbvector.m Type: application/octet-stream Size: 128 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbscalar.m Type: application/octet-stream Size: 95 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbrealvector.m Type: application/octet-stream Size: 51 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbrealscalar.m Type: application/octet-stream Size: 50 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbreal.m Type: application/octet-stream Size: 83 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: mbmatrix.m Type: application/octet-stream Size: 75 bytes Desc: not available URL: -------------- next part -------------- ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From matsuham at NINDS.NIH.GOV Mon Nov 8 21:42:48 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Mon, 8 Nov 2004 15:42:48 -0500 Subject: sourceinterpolate Message-ID: Hi Robert, Thank you. Now the 0.9.4 works and produces the same result (that is still a question :-) ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From matsuham at NINDS.NIH.GOV Mon Nov 8 22:33:12 2004 From: matsuham at NINDS.NIH.GOV (Matsuhashi, Masao (NIH/NINDS)) Date: Mon, 8 Nov 2004 16:33:12 -0500 Subject: freqdescriptives Message-ID: Hello Robert, I also copied the axial2planar.m and modified the number of gradiometers from 151 to 274, and now it works. The result in our condition is ================ method 1: 0.715570 method 2: 0.923964 method 3: 0.929785 method 4: 0.977297 method 5: 0.715570 ================ Actually, the result of 'orig' method is flower-like and so different from the original. While doing this, I got the following warning message. Is this ok? ================ Warning: higher order synthetic gradiometer configuration(?) > In fieldtrip\private\prepare_vol_sens at 145 In dipolesimulation at 35 ================ Another question: what is the unit of cfg.dip.mom to give to dipolesimulation(). With the unit vector [1,0,0] as in the above test script, the output (axial.trial) is in the order of 1e-9, where the actual recorded signal is usually less than 1e-11. Therefore it is not likely nAm. I am thinking of mixing the simulated data to the real brain background activity. ------------------------------------------------ Masao Matsuhashi, MD, DMS NINDS, NIH Tel: 1-301-594-9139 E-mail: MatsuhaM at ninds.nih.gov ------------------------------------------------ From rajamoni at CCS.FAU.EDU Mon Nov 8 22:45:25 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Mon, 8 Nov 2004 16:45:25 -0500 Subject: single-trials data Message-ID: Hi Robert, Would you please tell me the way to generate single-trials source(s) time series data from raw MEG dataset? Thanks and best regards, Sreenivasan From roberto at SMI.AUC.DK Tue Nov 9 09:49:43 2004 From: roberto at SMI.AUC.DK (Robert Oostenveld) Date: Tue, 9 Nov 2004 09:49:43 +0100 Subject: single-trials data In-Reply-To: <00a301c4c5dc$415a2400$3c1e5b83@vasan> Message-ID: Hi Sreenivasan, On 8 Nov 2004, at 22:45, R. Sreenivasan wrote: > Would you please tell me the way to generate single-trials source(s) > time > series data from raw MEG dataset? sourceanalysis with cfg.method=lcmv and cfg.singletrial=yes. That will use the full data to construct the spatial filter, and apply that filter to each individual trial. It will result in a source structure with source.avg and source.trial. The dipole moment of the single-trial source reconstructions are in source.trial.mom. Source.trial.mom{N} contains the moment for the dipole on position source.pos(N,:). Robert From r.oostenveld at FCDONDERS.RU.NL Tue Nov 9 10:26:10 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 9 Nov 2004 10:26:10 +0100 Subject: planar gradients compared In-Reply-To: <6EF659D3CB8D724BBA76CF97214D8DAC0C5FD06F@nihexchange17.nih.gov> Message-ID: Hi MAsao, On 8 Nov 2004, at 22:33, Matsuhashi, Masao (NIH/NINDS) wrote: > I also copied the axial2planar.m and modified the number of > gradiometers > from 151 to 274, and now it works. Could you send me the updated version, so that I can include it in the next release? > The result in our condition is > > ================ > method 1: 0.715570 > method 2: 0.923964 > method 3: 0.929785 > method 4: 0.977297 > method 5: 0.715570 > ================ > > Actually, the result of 'orig' method is flower-like and so different > from > the original. These numbers are the correlation coefficient, and method1 or 'orig', which is the default(!) in fieldtrip is clearly not the best. Btw. 'orig' means that it was the original implementation of the planar gradient computation by Ole Jensen, and does not mean that it is the original axial data. If you plot the amplitude of the planar gradients computed with 'orig', these should _not_ look like the original topoplot. Planar gradient amplitudes are conceptually different from axial gradients (e.g. amplitude is always a positive number, whereas the original data is both positive and negative). Did you check this for different dipole locations? And for different noise levels? The idea was not just to run the script that I sent you, but also to explore it to see how these parameters affect the planar gradient estimation from the axial data. > While doing this, I got the following warning message. Is this ok? > > ================ > Warning: higher order synthetic gradiometer configuration(?) >> In fieldtrip\private\prepare_vol_sens at 145 > In dipolesimulation at 35 > ================ It indicates a potential problem. Fieldtrip is not yet 100% capable of handling the CTF higher order synthetic gradients correctly. At the Donders, we useually do not use the higher order gradients and therefore they have not been implemented completely yet. The problem that I face is that I cannot read the coefficients in a decent fashion (i.e. from the res4 files). In this case (computation of planar gradients) I guess that it does not matter, but for forward and inverse computations the warning is more serious. > Another question: what is the unit of cfg.dip.mom to give to > dipolesimulation(). With the unit vector [1,0,0] as in the above test > script, the output (axial.trial) is in the order of 1e-9, where the > actual > recorded signal is usually less than 1e-11. Therefore it is not likely > nAm. > I am thinking of mixing the simulated data to the real brain background > activity. It is arbitrary units. It depends on the units of your other objects, i.e. whether the volume conductor model is specified in cm or in m, etc. Robert From rajamoni at CCS.FAU.EDU Tue Nov 9 21:32:00 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Tue, 9 Nov 2004 15:32:00 -0500 Subject: single-trials data Message-ID: Hi Robert, Attached is the script that I used for generating single-trial time series data for two dipoles. Then I want to do the freqanalysis on those source time-series data. Unfortunately, I amn't getting it ...Would you please check? Sreenivasan ----- Original Message ----- From: "Robert Oostenveld" To: Sent: Tuesday, November 09, 2004 3:49 AM Subject: Re: [FIELDTRIP] single-trials data > Hi Sreenivasan, > > On 8 Nov 2004, at 22:45, R. Sreenivasan wrote: > > > Would you please tell me the way to generate single-trials source(s) > > time > > series data from raw MEG dataset? > > sourceanalysis with cfg.method=lcmv and cfg.singletrial=yes. That will > use the full data to construct the spatial filter, and apply that > filter to each individual trial. > > It will result in a source structure with source.avg and source.trial. > The dipole moment of the single-trial source reconstructions are in > source.trial.mom. Source.trial.mom{N} contains the moment for the > dipole on position source.pos(N,:). > > Robert -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: singletrial_patch.m URL: From r.oostenveld at FCDONDERS.RU.NL Wed Nov 10 18:38:16 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 10 Nov 2004 18:38:16 +0100 Subject: single-trials data In-Reply-To: <009e01c4c69b$2afc39e0$3c1e5b83@vasan> Message-ID: Hi Sreenivasan On 9 Nov 2004, at 21:32, R. Sreenivasan wrote: > Hi Robert, > > Attached is the script that I used for generating single-trial time > series > data for two dipoles. Then I want to do the freqanalysis on those > source > time-series data. > Unfortunately, I amn't getting it ...Would you please check? > > cfg.vartrllength = 2; This has no effect, since you are not doing partial artifact rejection. Hence all your trials have the same length. > cfg.blc = 'no' > cfg.blcwindow = [-0.0 0.25] This has no effect. > cfg.bpfreq = [8 14] > fg.bpfiltord = 4 > cfg.bpfilttype = 'fir' This will result in a very sloppy filter. > cfg = []; > cfg.method = 'lcmv'; > cfg.grid.pos = [1 4 1; 6 1 2]; > %cfg.singletrial = 'yes'; > cfg.rawtrial = 'yes' > cfg.keepfilter = 'yes' > cfg.hdmfile = strcat(ds, '/localSpheres.hdm'); > [source] = sourceanalysis(cfg, timelock) Your single trial covariances are computed on only a 250ms time window of the filtered data (see timelockanalysis cfg). Therefore each single trial covariance is very poorly estimated and might even be rank deficient (this is something that sourceanalysis will warn you about). You should do singletrial=yes and rawtrial=no. Just to be sure you should also do keepmom=yes. > cfg = []; > cfg.method = 'fft'; > cfg.output = 'powandcsd'; > cfg.tapsmofrq = smo; > cfg.foilim = [f1 f2]; > %cfg.pad = 2.; > %cfg.keeptrials = 'yes'; > cfg.sgncmb = 'all'; > [freq] = freqanalysis(cfg, source); Freqanalysis is not so smart that it immediately knows how to do its analysis on source data. You'll have to reformat the source data, and especially source.trial.mom (i.e. the estimated dipole moment for each trial) into something that looks like it comes from preprocessing. datasrc = []; datasrc.fsample = data.fsample; datasrc.cfg = source.cfg; for i=1:length(datasrc.time) datasrc.time{i} = timelock.time; datasrc.trial{i} = xxx; % something with source.trial(i).mom{1} and mom{2}; end datasrc.label = xxx; % perhaps {'dip1', 'dip2'}? You'll have to fill out the xxx'es youself and especially you should tink of how you want to treat the 3D dipole moment (i.e. regional source strength with x, y, and z-component), i.e. as three virtual channels or as one virtual channel. Maybe it is first better to have a look at the moments of each dipole in a given trial by just plotting it. Using SVD, you can for example extract the moment strength and orientation along the most dominant direction. Try something like [u, s, v] = svd(source.trial(1).mom{1}); mom = s*v; plot(time, mom); I hope this helps, Robert PS plotting virtual channels with sourceinterpolate and sliceinterpolate won't work, but you already have that commented out. From mariast at ROCKETMAIL.COM Fri Nov 12 11:13:07 2004 From: mariast at ROCKETMAIL.COM (Maria Stavrinou) Date: Fri, 12 Nov 2004 02:13:07 -0800 Subject: importing .eeg data files In-Reply-To: <4D858803-333F-11D9-B0CB-000A95DBB2CC@fcdonders.ru.nl> Message-ID: Hi, I am trying to import .eeg datafile from Neuroscan using the command read_fcdc_data in this sense: dat = read_fcdc_data('dataset_test.eeg', hdr, 1, number_of_trials*number_of_points_in_one_trial*num_channels, chanindx) However i would like to import all 62 channels -could you give me also a hint what to write to chanindx? and the answer i get is: Error using ==> read_fcdc_data cannot read beyond epoch boundary in Neuroscan *.eeg file Thanks Maria Stavrinou --------------------------------- Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at FCDONDERS.RU.NL Mon Nov 15 09:15:18 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 15 Nov 2004 09:15:18 +0100 Subject: importing .eeg data files In-Reply-To: <20041112101307.18997.qmail@web12609.mail.yahoo.com> Message-ID: Hi Maria, On 12 Nov 2004, at 11:13, Maria Stavrinou wrote: > I am trying to import .eeg datafile from Neuroscan using the command > read_fcdc_data in this sense: > dat = read_fcdc_data('dataset_test.eeg', hdr, 1, > number_of_trials*number_of_points_in_one_trial*num_channels, chanindx) > However i would like to import all 62 channels -could you give me also > a hint what to write to chanindx? > and the answer i get is: > > Error using ==> read_fcdc_data > cannot read beyond epoch boundary in Neuroscan *.eeg file The error is not with chanindx, but with the fact that you are trying to read a very long continuous block of data from a file that contains only epochs. It cannot read data beyond the boundaries between the epochs. In principle you should not be using the read_fcdc_data function to get the data into Fieldtrip, since it is a low-level function. You should use the "preprocessing" function. See "help preprocessing" and "help definetrial". Probably the following configuration will do the trick cfg = [] cfg.datafile = 'dataset_test.eeg' cfg.headerfile = 'dataset_test.eeg' cfg.channel = 'all' raw = preprocessing(cfg) I hope this helps, Robert From rajamoni at CCS.FAU.EDU Tue Nov 16 16:47:28 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Tue, 16 Nov 2004 10:47:28 -0500 Subject: min-norm Message-ID: Hi Robert, I understand that the Fieldtrip uses LCMV method for source analysis. Do you have any routine(s) that uses min-norm option? Thank you Sreenivasan From r.oostenveld at FCDONDERS.RU.NL Wed Nov 17 14:19:15 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 17 Nov 2004 14:19:15 +0100 Subject: min-norm In-Reply-To: <003301c4cbf3$93515950$3c1e5b83@vasan> Message-ID: Hi Sreenivasan, There are different source analysis options implemented in FieldTrip, namely LCMV, DICS and single or multiple spatiotemporal dipole fitting. Minimum current or minimum norm solutions based on a distributed source model are not implemented. Ii principle implementing a minimum norm solution would be very easy, but it is quite difficult to implement a good regularization method. Furthermore, implementing a good and robust distributed source model (based on the cortical surface) is quite some work. best regards, Robert On 16 Nov 2004, at 16:47, R. Sreenivasan wrote: > Hi Robert, > > I understand that the Fieldtrip uses LCMV method for source analysis. > Do you > have any routine(s) that uses min-norm option? > > Thank you > Sreenivasan > ---------------------------------------------------------------------- Robert Oostenveld, PhD Center for Sensory-Motor Interaction (SMI) Aalborg University, Denmark and F.C. Donders Centre for Cognitive Neuroimaging University Nijmegen P.O. Box 9101 NL-6500 AH Nijmegen The Netherlands Tel: +31 (0)24 3619695 Fax: +31 (0)24 3610989 ---------------------------------------------------------------------- N.B. Starting from 1 September 2004, the University of Nijmegen has changed its name to Radboud University Nijmegen. All web- and email-addresses ending in ".kun.nl" should therefore be changed into ".ru.nl". Please update your address book and links. From rajamoni at CCS.FAU.EDU Thu Nov 18 00:00:39 2004 From: rajamoni at CCS.FAU.EDU (R. Sreenivasan) Date: Wed, 17 Nov 2004 18:00:39 -0500 Subject: co-ordinate Message-ID: Hi Robert, Is there any function in Fieldtrip to translate the Freesurfer-RAS or Talairach co-ordinate system to the system that Fieldtrip uses? (e.g. giving the dipole position - cfg.grid.pos = [x y z] for source analysis) The other question is related to extracting source single-trial data. Earlier You suggested that the source signal could be extracted by the following way: ([u,s,v]=svd(dipole.moment)) and s*v produces 3 components of source. Instead can we compute from the dipole (3D) moment by sqrt(x^2+y^2+z^2) for each trial? Thank you, Best regards, Sreenivasan From r.oostenveld at FCDONDERS.RU.NL Thu Nov 18 12:30:55 2004 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 18 Nov 2004 12:30:55 +0100 Subject: co-ordinate In-Reply-To: <017401c4ccf9$419d3000$3c1e5b83@vasan> Message-ID: Hi Sreenivasan On 18 Nov 2004, at 0:00, R. Sreenivasan wrote: > Is there any function in Fieldtrip to translate the Freesurfer-RAS or > Talairach co-ordinate system to the system that Fieldtrip uses? (e.g. > giving > the dipole position - cfg.grid.pos = [x y z] for source analysis) Fieldtrip does not use it's own intrinsic coordinate system. Instead, if you read in geometrical information from a CTF file (dataset or mri), that geometrical information such as sensor positions or voxels will be represented in Matlab memory in CTF coordinates. For other types of input data (e.g. Neuromag MEG or SPM/analyze MRI's) the coordinate system can be different. As the user it is your own responsibility to ensure that coordinate systems of the different input objects/datafiles match. Of course it is possible to "convert from one to the other coordinate system". But conceptually one does not convert the coordinate system, instead the geometrical description of the data is converted: i.e. a [x y z] point in one coordinate system is converted to [x' y' z'] in another coordinate system. Please have a look at http://www2.ru.nl/fcdonders/fieldtrip/faq.html#q4 http://www2.ru.nl/fcdonders/fieldtrip/faq.html#q5 to see the Fieldtrip specific details. Furthermore, I suggest that you have a look at http://bishopw.loni.ucla.edu/AIR5/homogenous.html to get an understanding for the general concept of a "homogenous coordinate transformation", which is used in Fieldtrip. Basically the problem boils down to obtaining a mathematical description of the coordinate transformation that relates your data (in CTF coordinates I guess) to Freesurfer-RAS or Talairach coordinates. I don't know what Freesurfer-RAS uses, but Talairach and CTF cannot be linked easily together with this homogenous transformation. E.g. SPM uses nonlinear spatial normalization to align an individual MRI to a standard MRI. This SPM approach of spatially realigning or normalizing volume data will become part of Fieldtrip in the future. > The other question is related to extracting source single-trial data. > > Earlier You suggested that the source signal could be extracted by the > following way: ([u,s,v]=svd(dipole.moment)) and s*v produces 3 > components > of source. Instead can we compute from the dipole (3D) moment by > sqrt(x^2+y^2+z^2) for each trial? Yes, but that is the magnitude of the rotating dipole moment instead of its strength along a specified direction (which you would gvet with the svd trick). The magnitude is always positive, the strength along one direction is both positive and negative. You can use whichever you think best captures the activity at that particular location, but personally I prefer the dipole moment amplitude along a specific direction because of its more clear physical interpretation. best regards, Robert Oostenveld From Thomas.Koelewijn at FCDONDERS.RU.NL Mon Nov 29 12:39:38 2004 From: Thomas.Koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 29 Nov 2004 12:39:38 +0100 Subject: multiplotER In-Reply-To: <4F9B5B2E-3955-11D9-A77D-000A95DBB2CC@fcdonders.ru.nl> Message-ID: Dear all, I'm trying to use the multiplotER function as described in the fieldtrip tutorial. cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; clf; multiplotER (cfg, avgFIC); But the I get this reply. ??? Attempt to execute SCRIPT dataread as a function. Error in ==> C:\MATLAB6p5p1\toolbox\matlab\iofun\textread.m On line 172 ==> [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> h:\common\matlab\fieldtrip\multiplotER.m On line 138 ==> [chNum,X,Y,Width,Height,Lbl] = textread(cfg.layoutname,'%f %f %f %f %f %s'); Are there any changes made in this function? Gr. Thomas From Thomas.Koelewijn at FCDONDERS.RU.NL Mon Nov 29 13:36:55 2004 From: Thomas.Koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 29 Nov 2004 13:36:55 +0100 Subject: multiplotER In-Reply-To: Message-ID: Dear all, I made a stupid mistake, sorry for bothering you It's all fixed now Gr. Thomas -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Thomas Koelewijn Sent: maandag 29 november 2004 12:40 To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] multiplotER Dear all, I'm trying to use the multiplotER function as described in the fieldtrip tutorial. cfg = []; cfg.showlabels = 'yes'; cfg.fontsize = 6; clf; multiplotER (cfg, avgFIC); But the I get this reply. ??? Attempt to execute SCRIPT dataread as a function. Error in ==> C:\MATLAB6p5p1\toolbox\matlab\iofun\textread.m On line 172 ==> [varargout{1:nlhs}]=dataread('file',varargin{:}); Error in ==> h:\common\matlab\fieldtrip\multiplotER.m On line 138 ==> [chNum,X,Y,Width,Height,Lbl] = textread(cfg.layoutname,'%f %f %f %f %f %s'); Are there any changes made in this function? Gr. Thomas