From Marcel.Bastiaansen at FCDONDERS.RU.NL Thu Mar 2 11:33:27 2006 From: Marcel.Bastiaansen at FCDONDERS.RU.NL (Marcel Bastiaansen) Date: Thu, 2 Mar 2006 11:33:27 +0100 Subject: new plotting functionality In-Reply-To: <3C6D5FA7-A993-4CC6-9D73-456231758BD0@fcdonders.ru.nl> Message-ID: Hi Robert, Dennis, Whenever I try to use the interactive mode, I get the following error messages: ??? Undefined command/function 'plotSelection'. ??? Error while evaluating figure WindowButtonMotionFcn. And indeed, I cannot find the file plotSelection.m in the FC Donders fieldtrip version. Am I doing something wrong? Marcel Robert Oostenveld wrote: > Dear all, > > Dennis has implemented new plotting functions, they have been > committed to CVS this afternoon. The most important difference is > that of adding the option > cfg.interactive='yes' or 'no' (default) > > If you specify interactive-yes, you can make a selection, click on > it, and that selection will be plotted in a new figure. I.e. if you > start with a topoplotTFR, you can make a selection of channels, and > the average TFR of that channels will be plotted in the next figure > as a singleplotTFR. If you select a time-frequency window in that > singgleplotTFR, that selection will be plotted in a topoplotTFR. A > similar selection is possible in multiplotTFR, and the same > interactive sequence of plotting is possible for topo/multi/ > singleplotER. > > In case of 3D (TFR) data, the default xparam is 'time', the yparam is > 'freq' and the zparam is powspctrm or cohspctrm. In case of 2D data > (event-related field or power spectra), the xparam is either 'time' > or 'freq', and the zparam is 'avg' or 'powspctrm'. Please read the > documentation of each of the functions for the new options. > > best regards, > Robert & Dennis > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Robert Oostenveld, PhD > F.C. Donders Centre for Cognitive Neuroimaging > Radboud University Nijmegen > phone: +31-24-3619695 > http://www.ru.nl/fcdonders/ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > -- dr. Marcel C.M. Bastiaansen. FC Donders Centre for Cognitive Neuroimaging Visiting address: Kapittelweg 29, 6525 EN Nijmegen, the Netherlands Mailing address: Trigon 181, PO Box 9101, 6500 HB Nijmegen, the Netherlands phone: + 31 24 3610 882 fax: + 31 24 3610 989 mail: marcel.bastiaansen at fcdonders.ru.nl web: http://www.ru.nl/aspx/get.aspx?xdl=/views/run/xdl/page&ItmIdt=20592&SitIdt=119&VarIdt=96 -- From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 2 11:57:36 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 2 Mar 2006 11:57:36 +0100 Subject: new plotting functionality In-Reply-To: <4406C9F7.4040307@fcdonders.ru.nl> Message-ID: Dear Marcel, Apparently, plotSelection has not been 'tagged' to be visible from the fieldtrip-version on /home/common/. I just did it (and hopefully correctly). If will be available within five minutes. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Marcel Bastiaansen Sent: Thursday, March 02, 2006 11:33 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] new plotting functionality Hi Robert, Dennis, Whenever I try to use the interactive mode, I get the following error messages: ??? Undefined command/function 'plotSelection'. ??? Error while evaluating figure WindowButtonMotionFcn. And indeed, I cannot find the file plotSelection.m in the FC Donders fieldtrip version. Am I doing something wrong? Marcel Robert Oostenveld wrote: > Dear all, > > Dennis has implemented new plotting functions, they have been > committed to CVS this afternoon. The most important difference is > that of adding the option > cfg.interactive='yes' or 'no' (default) > > If you specify interactive-yes, you can make a selection, click on > it, and that selection will be plotted in a new figure. I.e. if you > start with a topoplotTFR, you can make a selection of channels, and > the average TFR of that channels will be plotted in the next figure > as a singleplotTFR. If you select a time-frequency window in that > singgleplotTFR, that selection will be plotted in a topoplotTFR. A > similar selection is possible in multiplotTFR, and the same > interactive sequence of plotting is possible for topo/multi/ > singleplotER. > > In case of 3D (TFR) data, the default xparam is 'time', the yparam is > 'freq' and the zparam is powspctrm or cohspctrm. In case of 2D data > (event-related field or power spectra), the xparam is either 'time' > or 'freq', and the zparam is 'avg' or 'powspctrm'. Please read the > documentation of each of the functions for the new options. > > best regards, > Robert & Dennis > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Robert Oostenveld, PhD > F.C. Donders Centre for Cognitive Neuroimaging > Radboud University Nijmegen > phone: +31-24-3619695 > http://www.ru.nl/fcdonders/ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > -- dr. Marcel C.M. Bastiaansen. FC Donders Centre for Cognitive Neuroimaging Visiting address: Kapittelweg 29, 6525 EN Nijmegen, the Netherlands Mailing address: Trigon 181, PO Box 9101, 6500 HB Nijmegen, the Netherlands phone: + 31 24 3610 882 fax: + 31 24 3610 989 mail: marcel.bastiaansen at fcdonders.ru.nl web: http://www.ru.nl/aspx/get.aspx?xdl=/views/run/xdl/page&ItmIdt=20592&SitIdt=1 19&VarIdt=96 -- From laura at GBT.TFO.UPM.ES Tue Mar 7 12:53:24 2006 From: laura at GBT.TFO.UPM.ES (Laura Espino) Date: Tue, 7 Mar 2006 12:53:24 +0100 Subject: EEG/MEG adaptive segmentation Message-ID: Hi, I´m starting to work with adaptive segmentation in EEG/MEG based on the detection of transitions in the signal state for further feature extraction. Is there in fieldtrip some algorithms already developed for this purpose? thanks ! Laura Espino E.T.S.I. Telecomunicacion - UPM Madrid España From r.oostenveld at FCDONDERS.RU.NL Wed Mar 8 12:35:19 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 8 Mar 2006 12:35:19 +0100 Subject: EEG/MEG adaptive segmentation In-Reply-To: <5.2.0.9.0.20060307124808.00c2ec28@pop3.gbt.tfo.upm.es> Message-ID: On 7 Mar 2006, at 12:53, Laura Espino wrote: > I´m starting to work with adaptive segmentation in EEG/MEG based on > the detection of transitions in the signal state for further > feature extraction. > Is there in fieldtrip some algorithms already developed for this > purpose? Hi Laura, No, something exactly like that is not implemented. But if you look at the fieldtrip website (http://www.ru.nl/fcdonders/fieldtrip), under documentation, example matlab scripts, then you will see an example trial function that detects transitions in the EMG signal (i.e. start and end of muscle activity) and that defines trials in which there is muscle activity. Those trials are read in and can then further be analyzed. That script is the closest to what you describe that I can think of. best regards, Robert Oostenveld PS the full link to the script is http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:detect_the_muscle_activity_in_an_emg_channel_ and_use_that_as_trial_definition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From cgra05 at HST.AUC.DK Mon Mar 13 00:53:12 2006 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Mon, 13 Mar 2006 00:53:12 +0100 Subject: Problem using .eeg-files Message-ID: An HTML attachment was scrubbed... URL: From pchris at UNC.EDU Mon Mar 13 06:48:15 2006 From: pchris at UNC.EDU (Punita) Date: Mon, 13 Mar 2006 06:48:15 +0100 Subject: plotting Message-ID: Hello, I am new to this group. I was just wondering if there was a simple method in fieldtrip that would allow me to plot surface potential data on a spherical head surface. As for my data - I have 3 arrays containing the x, y, and z coordinates on the surface of the head, and a 4th array that contains values of the potentials at these specified locations. Any help or pointers would be deeply appreciated. Thank you, Punita From jaakko.sarela at TKK.FI Mon Mar 13 10:26:41 2006 From: jaakko.sarela at TKK.FI (Jaakko Sarela) Date: Mon, 13 Mar 2006 11:26:41 +0200 Subject: Neuromag specifications in Fieldtrip Message-ID: Hi I'm trying to use the Fieldtrip package to analyse a data from Neuromag 306 channel device (actually, I only have the 204 gradiometer channels). However, I do not have access to the fif-files, so standard approach using Fieltrip does not work. I have the following information: - data file (as a matrix in MATLAB) - the channel locations (in VVchs_flat.txt, 2D or VVchs.txt, 3D) Based on this information, is it possible to use the Fieldtrip package for subsequent analysis? What information do I need to specify, before I can for instance, plot fields on certain time locations, using topoplotER? --------------------------------------------------------------------------- D. Sc. (Tech) Jaakko Särelä Helsinki University of Technology Laboratory of Computer and Information Science P.O. Box 5400, FIN-02015 HUT, Finland http://www.cis.hut.fi/jaakkos Tel: +358-9-451 4896; Fax: +358-9-451 3277; Email: jaakko.sarela at hut.fi --------------------------------------------------------------------------- From Jan.Schoffelen at FCDONDERS.RU.NL Mon Mar 13 13:01:01 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Mon, 13 Mar 2006 13:01:01 +0100 Subject: Neuromag specifications in Fieldtrip In-Reply-To: <20060313092641.GB10085@mail.cis.hut.fi> Message-ID: Dear Jaakko, Yes, it is possible to subsequently process your data. Fieldtrip only needs to know how to interpret your data-matrix. So you should create a structure, which is recognizable as a fieldtrippish-thingy. If your input-data is defined in a matrix, you have to specify the following fields in your input-structure: input.dimord: this is a string which specifies for each dimension of your matrix what it means, If you have time-domain data, with repetitions, it should be input.dimord = 'rpt_chan_time', with the dimensionality of your data accordingly. input.trial = yourdata If you do not have repetitions, but just an average over trials, input.avg = yourdata input.dimord = 'chan_time'; Next you have to define some additional stuff: input.label: this is a cell-array containing the channel-labels input.time: this is a row-vector telling fieldtrip how to convert from sample to seconds. If you want to do frequency-analysis, it becomes a bit more tricky; you then have to convert your data matrix into a cell-array, containing the single-trial data Nchan*Ntime. You do not need a dimord in that case, but you need a cell-array of vectors input.time, which specifies the time-axis for each trial separately. Hope this helps, Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jaakko Sarela Sent: Monday, March 13, 2006 10:27 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] Neuromag specifications in Fieldtrip Hi I'm trying to use the Fieldtrip package to analyse a data from Neuromag 306 channel device (actually, I only have the 204 gradiometer channels). However, I do not have access to the fif-files, so standard approach using Fieltrip does not work. I have the following information: - data file (as a matrix in MATLAB) - the channel locations (in VVchs_flat.txt, 2D or VVchs.txt, 3D) Based on this information, is it possible to use the Fieldtrip package for subsequent analysis? What information do I need to specify, before I can for instance, plot fields on certain time locations, using topoplotER? --------------------------------------------------------------------------- D. Sc. (Tech) Jaakko Särelä Helsinki University of Technology Laboratory of Computer and Information Science P.O. Box 5400, FIN-02015 HUT, Finland http://www.cis.hut.fi/jaakkos Tel: +358-9-451 4896; Fax: +358-9-451 3277; Email: jaakko.sarela at hut.fi --------------------------------------------------------------------------- From thomas.koelewijn at FCDONDERS.RU.NL Mon Mar 13 13:51:50 2006 From: thomas.koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 13 Mar 2006 13:51:50 +0100 Subject: topoplotER Message-ID: Dear fieldtrippers, I’m trying to use a half year old plot script to plot some new data, but it doesn’t do the trick anymore. Some changes seem to be made in the topoplotER function but I can’t figure out how to cope with them. My data set: label: {152x1 cell} fsample: 600 avg: [152x601 double] var: [152x601 double] time: [1x601 double] individual: [12x152x601 double] dimord: 'subj_chan_time' cfg: [1x1 struct] grad: [1x1 struct] My script cfg = []; cfg.colorbar='no'; cfg.xlim = [0.0:0.1:0.5]; cfg.showzlim = 'no'; cfg.layout = 'ctf151s.lay'; cfg.zlim = [-1.5e-14 1.5e-14]; a = figure ('color',[1 1 1]); topoplotER(cfg,O_GavgLRF_C); what is going wrong? Thomas From Jan.Schoffelen at FCDONDERS.RU.NL Mon Mar 13 14:35:17 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Mon, 13 Mar 2006 14:35:17 +0100 Subject: topoplotER In-Reply-To: Message-ID: Hi Thomas, Could you be a bit more specific? JM -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Thomas Koelewijn Sent: Monday, March 13, 2006 1:52 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] topoplotER Dear fieldtrippers, I'm trying to use a half year old plot script to plot some new data, but it doesn't do the trick anymore. Some changes seem to be made in the topoplotER function but I can't figure out how to cope with them. My data set: label: {152x1 cell} fsample: 600 avg: [152x601 double] var: [152x601 double] time: [1x601 double] individual: [12x152x601 double] dimord: 'subj_chan_time' cfg: [1x1 struct] grad: [1x1 struct] My script cfg = []; cfg.colorbar='no'; cfg.xlim = [0.0:0.1:0.5]; cfg.showzlim = 'no'; cfg.layout = 'ctf151s.lay'; cfg.zlim = [-1.5e-14 1.5e-14]; a = figure ('color',[1 1 1]); topoplotER(cfg,O_GavgLRF_C); what is going wrong? Thomas From marie at PSY.GLA.AC.UK Mon Mar 13 16:35:14 2006 From: marie at PSY.GLA.AC.UK (Marie Smith) Date: Mon, 13 Mar 2006 15:35:14 +0000 Subject: read_ctf_mri In-Reply-To: Message-ID: Hi, I am trying to load CTF .mri files using the read_ctf_mri function. The function fails when the reshape function is called. Having checked the contents of mri at this point they do not total 256*256*256 elements, but some smaller number (256*256*255.39). Could anyone suggest why this would be the case? Thanks, Marie Smith %%% Error message To RESHAPE the number of elements must not change. Error in ==> read_ctf_mri at 103 mri = reshape(mri, [256 256 256]); From tomh at KURAGE.NIMH.NIH.GOV Mon Mar 13 16:42:43 2006 From: tomh at KURAGE.NIMH.NIH.GOV (Tom Holroyd (NIH/NIMH) [E]) Date: Mon, 13 Mar 2006 10:42:43 -0500 Subject: read_ctf_mri In-Reply-To: <04D6A9B6-47AC-4901-8E1C-B9859C002965@psy.gla.ac.uk> Message-ID: Is it a newer format .mri file? They can have a variable length. If you look in the File menu there's a place where you can re-save it as a v2 format file which is flat. Marie Smith wrote: > Hi, > > I am trying to load CTF .mri files using the read_ctf_mri function. The > function fails when the reshape function is called. Having checked the > contents of mri at this point they do not total 256*256*256 elements, > but some smaller number (256*256*255.39). Could anyone suggest why this > would be the case? > > Thanks, > > Marie Smith > > %%% Error message > To RESHAPE the number of elements must not change. > > Error in ==> read_ctf_mri at 103 > mri = reshape(mri, [256 256 256]); > -- Tom Holroyd, Ph.D. "If you have to ask, I'm not telling you." -- Classic female answer to a question. From r.oostenveld at FCDONDERS.RU.NL Mon Mar 13 20:45:46 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 13 Mar 2006 20:45:46 +0100 Subject: Problem using .eeg-files In-Reply-To: Message-ID: Hi Carina, What kind of file is the *.eeg that you mention? Is it Neuroscan or EEProbe? Both should be supported, however, today I did notice a bug in code for neuroscan *.eeg files. Regarding the configuration. The "xxx.ds" directory is special for CTF MEG data, and contains a whole bunch of files (e.g. a seperate header and data file, and other files containing the marker events). If you want to run the tutorial, you should download the demo data from teh ftp server. In your case you should not make a xxx.ds directopry, but instead specify cfg.datafile = 'Ken_data.eeg' cfg.headerfile = 'Ken_data.eeg' since the data and header information are both in the same file. Furthermore, the cfg3.trialdef.includeTrigger = 3; cfg3.trialdef.excludeConditions = {'BAD'}; are also specific for CTF. You should read eth help of DEFINETRIAL, specifically the cfg.trialdef.eventtype = '?' will be of interest (since it shows you what you can actually use). best Robert On 13 Mar 2006, at 0:53, Carina Graversen wrote: > Hi. I just downloaded the Fieldtrip program to use it for my thesis > as biomedical engineering, and I'm now trying to use it on a .eeg- > file, which causes some problems for me. I have created the > directory Ken_data.ds where I have the file Ken_data.eeg. I use the > following configuration (taken from the tutorial and previous > answers from this forum): cfg3 = []; cfg3.dataset = 'Ken_test.ds'; > cfg3.trialdef.includeTrigger = 3; cfg3.trialdef.excludeConditions = > {'BAD'}; cfg3.blc = 'yes'; cfg3.blcwindow = [-0.2 0]; cfg3.lpfilter > = 'yes'; cfg3.lpfreq = 35; cfg3.padding = 0; cfg3.datafile = > 'Ken_test.eeg'; cfg3.headerfile = 'Ken_test.eeg'; cfg3.channel = > 'all'; I then call the preprocessing function: dataFIC = > preprocessing(cfg3); Unfortunately I get the following errors: > Warning: could not determine filetype of Ken_test.ds\Ken_test.meg4 > > In fieldtrip-20060306\private\filetype at 524 In definetrial at > 109 In preprocessing at 270 evaluating trialfunction > 'trialfun_ctf_epoched' ??? Error using ==> fieldtrip-20060306 > \private\read_ctf_meg4 could not open datafile Which I guess means > that I haven't used the correct configuration, since the program is > searching for a .meg4-file. I hope someone can help me by giving > the correct configuration when working on .eeg-files :o). Thanks in > advance. Regards, Carina Graversen Aalborg University, Denmark From r.oostenveld at FCDONDERS.RU.NL Mon Mar 13 20:51:11 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 13 Mar 2006 20:51:11 +0100 Subject: plotting In-Reply-To: Message-ID: Hi Punita There is no 3D plotting function, i.e. one that would assume that the head is a surface in 3D space, and which would require to rotate the head to get a full view of the sides. But there are plotting functions for scalp topographies which assume that you have projected the electrode locations on a 2D plane (i.e. a top view). They use layout files (see for an example the *.lay files, they are plain ascii). Alternatively, you can use the topoplot() function, which either uses a layout file or which also allows you to specify the x,y positions and the potential values at each site. best Robert PS if you do want to plot your x/y/z/v data in 3D and be able to rotate, you can use the undocumented and unsupported private/triplot function. You should then copy it from the private folder into fieldtip main. You then would do >> triplot([x y z], [], v) On 13 Mar 2006, at 6:48, Punita wrote: > Hello, > I am new to this group. I was just wondering if there was a simple > method > in fieldtrip that would allow me to plot surface potential data on a > spherical head surface. As for my data - I have 3 arrays > containing the x, > y, and z coordinates on the surface of the head, and a 4th array that > contains values of the potentials at these specified locations. > Any help or pointers would be deeply appreciated. > Thank you, > Punita > From r.oostenveld at FCDONDERS.RU.NL Mon Mar 13 21:05:15 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 13 Mar 2006 21:05:15 +0100 Subject: Neuromag specifications in Fieldtrip In-Reply-To: <20060313092641.GB10085@mail.cis.hut.fi> Message-ID: Hi Jaacko If you go to http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions and scroll down to "How can I import my own dataformat?", you can read the structure of the raw data format (i.e. the format that Jan-Mathijs mentioned at the end of his mail). In case yu want to topoplot: you should use the 2D locations and make a layout file (*.lay) for it. Please open one of the (plan ascii) layout files in a text editor (e.g. NM122.lay). With the data that you describe, you should be able to do all channel level analyses (but not source analyses, since that requires more information, like the location and orientation of all individual MEG coils). best Robert On 13 Mar 2006, at 10:26, Jaakko Sarela wrote: > Hi > > I'm trying to use the Fieldtrip package to analyse a data from > Neuromag 306 channel device (actually, I only have the 204 gradiometer > channels). > > However, I do not have access to the fif-files, so standard approach > using Fieltrip does not work. I have the following information: > - data file (as a matrix in MATLAB) > - the channel locations (in VVchs_flat.txt, 2D or VVchs.txt, 3D) > > Based on this information, is it possible to use the Fieldtrip package > for subsequent analysis? What information do I need to specify, > before I > can for instance, plot fields on certain time locations, using > topoplotER? From d.talsma at PSY.VU.NL Tue Mar 14 11:48:27 2006 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Tue, 14 Mar 2006 11:48:27 +0100 Subject: Missing 'elec' field when reading neuroscan CNT files? Message-ID: Hi Folks, I just ran into the following issue. For an ongoing EEG project, which was originally stored in neuroscan CNT files, I'm trying to set up a clusterrandanalysis. The analysis doesn't run, because the input data struct is expected to have an 'elec' field (in order to compute the neighbouring channels). Just looking at some CTF MEG data, I saw that these data structs do contain the (for these puposes) equivalent 'grad' field, consisting of the following data members: grad.pnt grad.ori grad.tra grad.label grad.units I suspect that elec will be similar, but which fields are required? I suspect pnt, tra, label, and unit. Assuming this is correct, I have the following questions: In what coordinate system is elec.pnt specified? (Cartesian, polar? Which reference frame?) What is the meaning of the tra field? Cheers, Durk From r.oostenveld at FCDONDERS.RU.NL Tue Mar 14 12:22:53 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 14 Mar 2006 12:22:53 +0100 Subject: Missing 'elec' field when reading neuroscan CNT files? In-Reply-To: <44169F7B.3010604@psy.vu.nl> Message-ID: Hi Durk On 14 Mar 2006, at 11:48, Durk Talsma wrote: > I just ran into the following issue. For an ongoing EEG project, > which was originally stored in neuroscan CNT files, I'm trying to > set up a clusterrandanalysis. The analysis doesn't run, because the > input data struct is expected to have an 'elec' field (in order to > compute the neighbouring channels). > > Just looking at some CTF MEG data, I saw that these data structs do > contain the (for these puposes) equivalent 'grad' field, consisting > of the following data members: > > grad.pnt > grad.ori > grad.tra > grad.label > grad.units > > I suspect that elec will be similar, but which fields are required? > I suspect pnt, tra, label, and unit. Assuming this is correct, I > have the following questions: See the documentation on http://www2.ru.nl/fcdonders/fieldtrip/ doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_are_electrodes _magnetometers_or_gradiometers_described and scroll down to "How are electrodes, magnetometers or gradiometers described?" You only need elec.pnt = Nchan x 3, with [x y z] elec.label = Nchan x 1 cell array with labels > In what coordinate system is elec.pnt specified? (Cartesian, polar? > Which reference frame?) The positions should be carthesian, and can be in any reference frame (head/polhemus/mri) and in any units. Whether channels are neighbours or not will be the same in any reference frame, so that is why that does not matter. Better not use elec.units, since that is not consistently supported throughout FieldTrip and probably does not do anything. In clusterrandanalysis you furthermore can specify cfg.neighbourdist = distance in the same units as above See also read_fcdc_elec (esp look into the code), which might help you to get an elec structure for your data. You can also manually construct a neighbourhood structure using cfg.neighbours (in that case fieldtrip does not need the elec strucure), that is explained in the help of clusterrandanalysis. > What is the meaning of the tra field? It is only for MEG, and it is the linear transformation matrix from the field at each coil to the field at each channel. Gradiometer channels have 2 coils, so think of a forward model for all coils that contains (2*151)x3 fT values, a grad.tra=[eye(151) -eye(151)] and aforward model for all channels that contains 151x3 fT values (the 3 is because of the three dipole orientations). Robert From r.oostenveld at FCDONDERS.RU.NL Thu Mar 16 15:36:05 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 16 Mar 2006 15:36:05 +0100 Subject: fieldtrip version 0.9.7 released Message-ID: Dear Fieldtrip users, This week the "Toolkit of Cognitive Neuroscience: advanced data analysis and source modelling of EEG and MEG data" course has been given at the F.C. Donders Centre. During the course, the Fieldtrip toolbox has been used in the tutorial hands-on sessions. For the course we have made a new release of the fieldtrip toolbox: version 0.9.7. All the up-to-date tutorials (which are available from http:// www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial) have been tested and are known to work with this release version. If you wish, you can upgrade to this stable release version. Preferably, you should always use the daily released version, since that will always contain the latest enhancements. The fieldtrip toolbox 0.9.7 and the daily release versions are available from the homepage (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:download) or directly from the ftp server (ftp:// ftp.fcdonders.nl/pub/fieldtrip). best regards ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From Brian.Roach at YALE.EDU Thu Mar 16 18:57:51 2006 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 16 Mar 2006 12:57:51 -0500 Subject: new user questions Message-ID: Hi, I am very new to Fieldtrip, and I have a pretty basic question about loading data to process - how do I do it? Looking at example code and the tutorials, it seems like I need to have a .ds file that contains my data. I am able to load .cnt and brain vision analyzer data successfully with their related functions, but how do I then assign that data to a .ds file? If there is documentation for this that I have missed, please point me to it. Also - what kind of interpolation would the topoPlot function use for EEG data (spherical or based on a 3-d head model)? Thank you! Brian From shahink at U.WASHINGTON.EDU Fri Mar 17 01:57:31 2006 From: shahink at U.WASHINGTON.EDU (Shahin Hakimian) Date: Fri, 17 Mar 2006 01:57:31 +0100 Subject: Help a novice with EEGlab2fieldtrip() Message-ID: Hello, Please excuse my ignorance. When I tried to transfer data from EEGLab to Fieldtrip using the function above, the procedure initially seemed to work. Later, however, preprocessing of the same dataset failed since the header was not there. Am I doing something wrong? Does the EEGlab2fieldtrip automatically fill in the header fields? Thanks From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 17 09:40:50 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 17 Mar 2006 09:40:50 +0100 Subject: new user questions In-Reply-To: <6.1.2.0.2.20060316125317.01b1ed10@email.med.yale.edu> Message-ID: Dear Brian, Please have a look at the fieldtrip website. When you go to the documentation part and then to the frequently asked questions, you'll find everything you want to know. Fieldtrip supports several data-formats, including neuroscan data. The .ds data-format is the one we have on our MEG-system. So there is no need to do complicated stuff with your own data. The interpolation for the plotting is just a linear or spline interpolation of the surface-data. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Brian Roach Sent: Thursday, March 16, 2006 6:58 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] new user questions Hi, I am very new to Fieldtrip, and I have a pretty basic question about loading data to process - how do I do it? Looking at example code and the tutorials, it seems like I need to have a .ds file that contains my data. I am able to load .cnt and brain vision analyzer data successfully with their related functions, but how do I then assign that data to a .ds file? If there is documentation for this that I have missed, please point me to it. Also - what kind of interpolation would the topoPlot function use for EEG data (spherical or based on a 3-d head model)? Thank you! Brian From r.oostenveld at FCDONDERS.RU.NL Fri Mar 17 10:26:59 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 17 Mar 2006 10:26:59 +0100 Subject: Help a novice with EEGlab2fieldtrip() In-Reply-To: Message-ID: Dear Shakin The eeglab2fieldtrip function should be used if you have already done the preprocessing in EEGLAB. If you use eeglab2fieldtrip, you do not have to use preprocessing. The EEG structure from EEGLAB contains all data, whereas in Fieldtrip we work with one data object at a time (i.e. raw data is a data object which normally would result from the preprocessing function). I.e. you can do data = eeglab2fieldtrip(EEG, 'preprocessing') and get the preprocessed raw data, or timelock = eeglab2fieldtrip(EEG, 'timelockanalysis') to get the averaged ERP, or comp = eeglab2fieldtrip(EEG, 'componentanalysis') to get the component topographies and activations. best regards, Robert ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On 17 Mar 2006, at 1:57, Shahin Hakimian wrote: > Please excuse my ignorance. When I tried to transfer data from > EEGLab to > Fieldtrip using the function above, the procedure initially seemed > to work. > Later, however, preprocessing of the same dataset failed since the > header > was not there. Am I doing something wrong? Does the EEGlab2fieldtrip > automatically fill in the header fields? > Thanks > From cgra05 at HST.AUC.DK Thu Mar 23 11:24:49 2006 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 23 Mar 2006 11:24:49 +0100 Subject: problems using multiplotTFR for eeg-files. In-Reply-To: <6EA6DC7F-A7D4-4BAB-B2AB-7BF4D6845EA8@fcdonders.ru.nl> Message-ID: Hi. I'm trying to use the wavelet code for an .eeg-file, but unfortunately I run into problems when I try to plot the results. The error I get is a lot of the following messages: Warning: Divide by zero. > In fieldtrip-20060306\private\nan_mean at 57 In freqbaseline>TFabschange at 201 In freqbaseline at 109 In multiplotTFR at 142 reading layout from file CTF151.lay Warning: Divide by zero. > In mean at 31 In multiplotTFR at 251 I use the following commands: % ************************************************************************* % EVENTRELATEDAVERAGING % ************************************************************************* cfg1 = []; cfg1.datafile = 'Ken_test.eeg'; cfg1.headerfile = 'Ken_test.eeg'; cfg1.channel = 'all'; dataFIC = preprocessing(cfg1); % Preprocess! cfg2 = []; avgFIC = timelockanalysis(cfg2, dataFIC); % ************************************************************************* % WAVELET % ************************************************************************* cfg7 = []; cfg7.output = 'pow'; cfg7.method = 'wltconvol' cfg7.foi = 1:2:30; cfg7.t_ftimwin = 5./cfg7.foi; cfg7.tapsmofrq = 0.4 *cfg7.foi; cfg7.toi = -0.5:0.05:1.5; TFRmult = freqanalysis(cfg7, dataFIC); cfg8 = []; cfg8.baseline = [-0.5 -0.1]; cfg8.zlim = [-3e-27 3e-27]; cfg8.showlabels = 'yes'; cfg8.layout = 'CTF151.lay'; multiplotTFR(cfg8, TFRmult); Can anyone give me a clue on what I'm doing wrong ??? Best Regards, Carina Graversen From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 23 12:09:58 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 23 Mar 2006 12:09:58 +0100 Subject: problems using multiplotTFR for eeg-files. In-Reply-To: Message-ID: Dear Carina, cfg8.layout = 'CTF151.lay'; This is incorrect. The cfg.layout field specifies for the plotting function, how to interpret the input-data. With this configuration fieldtrip expects that your input data consists of data obtained with the 151-gradiometer CTF system. Please have a look at the help of multiplotTFR, in which it is explained how to deal with the cfg.layout field. Yours, Jan-Mathijs From r.oostenveld at FCDONDERS.RU.NL Thu Mar 23 13:25:57 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 23 Mar 2006 13:25:57 +0100 Subject: problems using multiplotTFR for eeg-files. In-Reply-To: Message-ID: Hi Carina, Here is another clue: > Warning: Divide by zero. >> In fieldtrip-20060306\private\nan_mean at 57 > In freqbaseline>TFabschange at 201 > In freqbaseline at 109 > In multiplotTFR at 142 These warnings indicate that the specified baseline period does not contain any power, which is due to the wavelet being too long. I suggest to start with plotting a single TFR without any baseline correction, using the standard matlab function imagesc. Then you can see at which latency the power starts to be real-valued (insted of nans, which indicate that the wavelet is not yet completely inside the data). Robert From will.51 at OSU.EDU Sun Mar 26 05:19:16 2006 From: will.51 at OSU.EDU (Udo Will) Date: Sat, 25 Mar 2006 21:19:16 -0600 Subject: average intertrial phase coherence Message-ID: Hi I wonder if there is a fieldtrip function that calculates 1) average intertrial phasecoherence for a set of frequencies at individual electrode locations, and 2) the timedevelopment of this intertrial phasecoherence (i.e a time/phase plot). Regards Udo Will From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 13:25:12 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 13:25:12 +0200 Subject: average intertrial phase coherence In-Reply-To: <44260834.6000802@osu.edu> Message-ID: Dear Udo, That is not implemented yet, but it is easy to compute yourself. You should do freqanalysis with method=mtmfft (for 1) or method=mtmconvol (for 2) and output=fourier, which also implies keeptaper=yes and keeptrial=yes. That results in the complex fourier representation of the data (in one large "ntrial X nchan X nfreq X ntime" array) , from which you can compute the ITC. I recommend not to use multitapering (=frequency smoothing) for the ITC, so in freqanalysis you should also specify taper=hanning (or another single taper of your choise). Even with taper=hanning, you are required to specify something as taper-smoothing-frequency (i.e. cfg.tapsmofrq), but that is neglected (the field needs to be present, but is not used). Best regards, Robert On 26 Mar 2006, at 5:19, Udo Will wrote: > Hi > > I wonder if there is a fieldtrip function that calculates 1) > average intertrial phasecoherence for a set of frequencies at > individual electrode locations, and 2) the timedevelopment of this > intertrial phasecoherence (i.e a time/phase plot). > > Regards > Udo Will > From litvak at TECHUNIX.TECHNION.AC.IL Mon Mar 27 15:15:30 2006 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Mon, 27 Mar 2006 15:15:30 +0200 Subject: LORETA to Fieldtrip In-Reply-To: <49442A5E-58F1-4A3B-84BA-0C7A60B0F21B@fcdonders.ru.nl> Message-ID: Hi Robert, I tried reading the SPM MRI file (single_subj_T1.mnc - is this the one you meant?) but in the grid variables there are just indices in the matrix. So how do I know the correspondence to LORETA voxels? Is there a way to put the MNI grid there? Thanks, Vladimir -----Original Message----- From: Robert Oostenveld [mailto:r.oostenveld at fcdonders.ru.nl] Sent: Monday, March 27, 2006 2:43 PM To: Vladimir Litvak Subject: Re: Clusterrandanalysis > The question is - can we build a gateway for reading LORETA files > in FT and > applying the same statistics as you use for the beamformer? > This > shouldn't be something very complicated I think. The only problem > is that > LORETA uses a grid of 2394 voxels which are only in the gray matter > (so > there are some holes there) and it would probably be necessary to > do some > smoothing. Also one must write a routine for transforming from > LORETA grid > to your grid (based on Tailarach coordinates of the voxels). I once started with implementing LORETA myself in sourceanalysis, but never finished it. I don't consider LORETA to be too interesting for MEG, although I do appreciate it's usefullness for EEG. I have been in contact a couple of times with Roberto Pasqual-Marqui, and he told me some of the details. LORETA is using plain SPM/MNI coordinates, which can also be used in FT. The holes can be dealt with in FT by specifying NaNs as source.avg.pow, [] as source.avg.mom, and by specifying the right source.inside and source.outside vector (those are indices specifying which voxels are inside the brain, or inside the gray matter if you wish). Writing a LORETA importer should be trivial, but I am not going to do it myself. Please point the grad student to http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_is_anatomical_ functional_or_statistical_volume_data_described and tell him to use volume.inside and volume.outside to "fill" the non-gray matter so that the data fits into a 3D box. Also do addpath spm2 volume = read_fcdc_mri(filename) with filename being the canonical MRI from SPM (the collin27 one). That should belp in getting it alligned with the proper transformation matrix. Once you can read a single LORETA volume into FT, then you can repeat it for all subjects and do your statistics. Please address further questions regarding this topic to the mailing list. Robert PS I don't think that you want to smooth, our source clustering is aware of the grey/white matter differences (given the correct inside/ outside specification). From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 21:28:58 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 21:28:58 +0200 Subject: LORETA to Fieldtrip In-Reply-To: <000001c651a0$8884a750$90514484@dellgx240> Message-ID: On 27 Mar 2006, at 16:51, Vladimir Litvak wrote: > I thought about this somewhat more and there are some things I > realized and > some new questions that came up: > > 1) Why do I need the Collin brain if I don't plot the results in > fieldtrip? > A much simpler way would be to create a grid according to the > maximal values > of coordinates in LORETA (there is a list). Then I don't need any > transforms > - I just fill this grid directly using the MNI coordinates (plus some > constant). Then after the analysis I can simply export the result > back to > LORETA. You can use the collin brain to learn how volumes are represented in FT (and in SPM for that matter): with the transformation matrix. Furthermore, you can map the LORETA data onto the collin brain to check whether you have interpreted the LORETA 3D array correctly. It could be that in LORETA part of the brain has been cut off, which would mess up the matching, that is something which you need to be aware of. Spatial clustering in FT requires that you specify the shape of the 3D array correctly. The best way of knowing that it is correct is by plotting it in FT. FT sourceplotting also has options for combining anatomy+functional+statistics in one display (using grey+color +tranparency). Why not ask around whether someone has read it into Matlab before. I suspect that there is a mailing list, or you can ask Roberto Pasqual- Marqui directly. > 2) Does sourcestatistics handle multiple timeframes i.e. does > clustering > both in time and in space the same way as with scalpmaps? If yes, > how do I > specify the input for this? I haven't tried yet but I suspect that > would be > a pretty heavy operation to run. No, sofar I have not implemented Xvox-Yvox-Zvox-freq-time clustering, only Xvox-Yvox-Zvox clustering. We typically do not look at multiple frequencies or latencies, since on the channel level we can already decide (channel statistics) which time-frequency "tile" is significant. Subsequently we use multitapering on exactly that time- frequency tile to capture the complete effect in one TF-bin (with the desired width in both dimensions) and beam that single bin. So the standard way to deal with source data is that it is 3-D only. Actually it would not be too hard to implement the clustering in 4-D or 5-D, although I have no idea on the computational demands. I suspect it to be computationally feasible, since it uses the Matlab image processing toolbox, which is very efficient. For your LORETA data, the 4-D clustering does seem to be interesting so I could look at implementing it for N-D. The channel clustering is much more difficult, since the channel locations do not "code" a nice natural dimension in the data but they have a weird neighbourhood structure. Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 21:52:16 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 21:52:16 +0200 Subject: COEFS In-Reply-To: <6.2.3.4.0.20060327200856.01da0858@193.62.66.20> Message-ID: Hi James. On 27 Mar 2006, at 21:14, James Kilner wrote: > I am trying to understand how one forms synthetic gradiometers from > the MEG data. I spoke to CTF about this sometime ago and they told > me that the raw data is recorded with whatever gradiometer settings > you choose but I wanted to check this. Do you use the coefs (as > defined in ctf_read_meg4) in your latest release? Do you already > have functions to change the order of the gradiometers? No, we are still using our own read_ctf_res4 without the coefs. I know that the raw data in the meg4 file can be stored in different formats, i.e. with or without the coefs being applied. Furthermore, there is also the option in CTF to only store the flag in the processing params file, whereby DataEditor remembers it the next time that you open the dataset (but the data in teh meg4 itself is not touched). The coefs can always be undone, which means that there should be a flag in the res4 header specifying whether the coefs have been applied or not. I am working on a redesign of the reading functions, which will also clear up the low-level functions: currently the mix between read_ctf_res4 and ctf_read_res4 is kind of vague. Furthermore, I have some synthetic gradient code that I would not mind sharing with you, but it requires testing and tighter integration with FT. I already want to add support for the synthetic gradients for quite some time now, but am lacking the time to implement it myself (and the MEG site in Nijmegen is relatively noise-free). I can point you to the right spots in the FT code, conceptually it is not too complex. best regards, Robert PS I just replied to your download mail before I noticed this mail in my inbox. I moved this mail over to the discussion list, since I think that it is also relevant for the other CTF users. From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 22:14:10 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 22:14:10 +0200 Subject: LORETA to fieldtrip In-Reply-To: <000001c651bd$8288a5a0$90514484@dellgx240> Message-ID: Hi Vladimir On 27 Mar 2006, at 18:42, Vladimir Litvak wrote: > I tried to do some simple calculation and it doesn't look good. The > size of > a box defined by MNI coordinates used in LORETA is 141x166x116. > Even in > single precision it takes 10 Mb. In order to do the analysis I > can't do in > LORETA (regression) I need to store 4 conditions for 10 subjects. > That gives > us 400Mb per time frame. Yes, I can follow the math (141x166x11 x 4bytes x 4conditions x 10subjects = 400MB). That means that for 20 timepoints (assuming some temporal downsampling and selection of a latency window of interest) that you need 8GB RAM just to hold the data. If you could a-priory identy a time-window of interest, then you could average over that time-window, limiting the analysis to a single 400MB. Alternatively, you could spatially downsample with a factor of 2x2x2 (using the DOWNSAMPLEVOLUME function), which would result in the data fitting in 1GB of RAM. After identifying the time of interest in this spatially downsampled volume, you could again go to the full resolution volume and only work on the (average) time of interest to localize the effect in that timewindow. > We had an idea here to solve this but I'm not sure it's > statistically sound. > The idea is to do the analysis for each timeframe separately and > then look > for clusters continuous in time and compare them to what you would > get with > reshuffled timeframes. The problem is that the null hypothesis in > the second > step is not the same as in the first step. What do you think? Yyou cannot give an unambigous interpretation of the probability that you are getting out of the second step. The hypothesis of interest is not on the timecourses (which will have a natural autocorrelation that of course will be destroyed by the shuffling), but on the data in the different conditions. As far as I can tell, shuffling the timewindows does not correspond with a hypothesis that relates in a meaningfull way to the data taht you observed in the 4 conditions. > In any case, I can define some segments to average if there is no > choice. Furthermore, applying some Bonferoni correction for the multiple time frames should not be too much of a problem. ALternatively, you can do a massive univariate test on chuncks of the data (clustering only in time and not in space), store the probabilities per voxel, and use the false discovery rate method for multiple comparison correction. I have code for FDR (but not in FT yet). The idea in pseudocode would be for slice=1:116 read 10x4 slices, each with 141x166 voxels do statistics on each slice, without multiple comparison correction over voxels, but with correction over timepoints: that gives you an interpretable probability per voxel. save the probabilities end for all slices, read all voxel probabilities and apply FDR to control for the expected proportion of false alarms over all voxels best regards, Robert From arno at SALK.EDU Tue Mar 28 12:05:43 2006 From: arno at SALK.EDU (arno) Date: Tue, 28 Mar 2006 12:05:43 +0200 Subject: LORETA to Fieldtrip In-Reply-To: <72073E3B-32D0-4A02-8A96-4E9532E1D4FD@fcdonders.ru.nl> Message-ID: > Spatial clustering in FT requires that you specify the shape of the 3D > array correctly. The best way of knowing that it is correct is by > plotting it in FT. FT sourceplotting also has options for combining > anatomy+functional+statistics in one display (using > grey+color+tranparency). > > Why not ask around whether someone has read it into Matlab before. I > suspect that there is a mailing list, or you can ask Roberto > Pasqual-Marqui directly. I do have a function to read LORETA results under Matlab and overlay them onto a custom MRI file (normalized to the MNI brain using SPM2 for example; MRI files can be read with the fieldtrip function read_fcdc_mri). The attached file LORETAtalairach.xyz is part of the LORETA distribution and contain the MNI coordinates of the LORETA voxels. Arno >> 2) Does sourcestatistics handle multiple timeframes i.e. does clustering >> both in time and in space the same way as with scalpmaps? If yes, how >> do I >> specify the input for this? I haven't tried yet but I suspect that >> would be >> a pretty heavy operation to run. > > No, sofar I have not implemented Xvox-Yvox-Zvox-freq-time clustering, > only Xvox-Yvox-Zvox clustering. We typically do not look at multiple > frequencies or latencies, since on the channel level we can already > decide (channel statistics) which time-frequency "tile" is > significant. Subsequently we use multitapering on exactly that > time-frequency tile to capture the complete effect in one TF-bin (with > the desired width in both dimensions) and beam that single bin. So the > standard way to deal with source data is that it is 3-D only. Actually > it would not be too hard to implement the clustering in 4-D or 5-D, > although I have no idea on the computational demands. I suspect it to > be computationally feasible, since it uses the Matlab image processing > toolbox, which is very efficient. For your LORETA data, the 4-D > clustering does seem to be interesting so I could look at implementing > it for N-D. The channel clustering is much more difficult, since the > channel locations do not "code" a nice natural dimension in the data > but they have a weird neighbourhood structure. > > Robert > > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: loreta_importcomp.m URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: LORETAtalairach.xyz URL: From litvak at TECHUNIX.TECHNION.AC.IL Wed Mar 29 18:36:23 2006 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Wed, 29 Mar 2006 18:36:23 +0200 Subject: LORETA to fieldtrip In-Reply-To: Message-ID: Hi again, I made some progress with loreta2fieldtrip function. It supports both the new sLORETA and the old LORETA format. I had to prepare two resampled MRI scans of Collin to match to each kind of LORETA file. I attach the function, these scans, the index file that is necessary for the conversion and two example files for LORETA and for sLORETA. To test the function you should run: volume=loreta2fieldtrip('test.slor', 1); volume=loreta2fieldtrip('test.lorb', 1); Now I would like you to help me finalize this function to produce something suitable for statitistical analysis. As I said yesterday with the sizes I actually got it shouldn't be a problem to run time-space test. It's probably not necessary to include the anatomy in every volume so the final function should have this as an option. Also I'm not sure whether avg.pow is the right place to put the functional data in this case. Another issue is coordinate system. What I understood from Roberto is that his MNI coordinates correspond to voxels in the original not downsampled Collin scan (such as the one I sent you before). The origin is [91 127 73]. The lCollin was obtained by downsampling the original Collin with (4:7:end, 4:7:end, 4:7:end) and the slCollin with (1:5:end, 2:5:end, 3:5:end). So if it is necessary to store the MNI coordinates or transformation matrix in the volume, please figure out how this should be done. Then I would appreciate an example of how to run for instance a dependent sample t-test on this data with your new statistics functions. What I really need to do is dependent samples regression with 4 conditions and up to 10 subjects. If this is possible with your present functions please send me an example as well. I hope that if I have these examples I'll be able to keep further developing them as I've been doing until now. If you want, you can include this loreta2fieldtrip extension in Fieldtrip after we finish polishing and testing it. Best, Vladimir -------------- next part -------------- A non-text attachment was scrubbed... Name: loreta2fieldtrip.zip Type: application/x-zip-compressed Size: 106645 bytes Desc: not available URL: From Marcel.Bastiaansen at FCDONDERS.RU.NL Thu Mar 2 11:33:27 2006 From: Marcel.Bastiaansen at FCDONDERS.RU.NL (Marcel Bastiaansen) Date: Thu, 2 Mar 2006 11:33:27 +0100 Subject: new plotting functionality In-Reply-To: <3C6D5FA7-A993-4CC6-9D73-456231758BD0@fcdonders.ru.nl> Message-ID: Hi Robert, Dennis, Whenever I try to use the interactive mode, I get the following error messages: ??? Undefined command/function 'plotSelection'. ??? Error while evaluating figure WindowButtonMotionFcn. And indeed, I cannot find the file plotSelection.m in the FC Donders fieldtrip version. Am I doing something wrong? Marcel Robert Oostenveld wrote: > Dear all, > > Dennis has implemented new plotting functions, they have been > committed to CVS this afternoon. The most important difference is > that of adding the option > cfg.interactive='yes' or 'no' (default) > > If you specify interactive-yes, you can make a selection, click on > it, and that selection will be plotted in a new figure. I.e. if you > start with a topoplotTFR, you can make a selection of channels, and > the average TFR of that channels will be plotted in the next figure > as a singleplotTFR. If you select a time-frequency window in that > singgleplotTFR, that selection will be plotted in a topoplotTFR. A > similar selection is possible in multiplotTFR, and the same > interactive sequence of plotting is possible for topo/multi/ > singleplotER. > > In case of 3D (TFR) data, the default xparam is 'time', the yparam is > 'freq' and the zparam is powspctrm or cohspctrm. In case of 2D data > (event-related field or power spectra), the xparam is either 'time' > or 'freq', and the zparam is 'avg' or 'powspctrm'. Please read the > documentation of each of the functions for the new options. > > best regards, > Robert & Dennis > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Robert Oostenveld, PhD > F.C. Donders Centre for Cognitive Neuroimaging > Radboud University Nijmegen > phone: +31-24-3619695 > http://www.ru.nl/fcdonders/ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > -- dr. Marcel C.M. Bastiaansen. FC Donders Centre for Cognitive Neuroimaging Visiting address: Kapittelweg 29, 6525 EN Nijmegen, the Netherlands Mailing address: Trigon 181, PO Box 9101, 6500 HB Nijmegen, the Netherlands phone: + 31 24 3610 882 fax: + 31 24 3610 989 mail: marcel.bastiaansen at fcdonders.ru.nl web: http://www.ru.nl/aspx/get.aspx?xdl=/views/run/xdl/page&ItmIdt=20592&SitIdt=119&VarIdt=96 -- From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 2 11:57:36 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 2 Mar 2006 11:57:36 +0100 Subject: new plotting functionality In-Reply-To: <4406C9F7.4040307@fcdonders.ru.nl> Message-ID: Dear Marcel, Apparently, plotSelection has not been 'tagged' to be visible from the fieldtrip-version on /home/common/. I just did it (and hopefully correctly). If will be available within five minutes. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Marcel Bastiaansen Sent: Thursday, March 02, 2006 11:33 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] new plotting functionality Hi Robert, Dennis, Whenever I try to use the interactive mode, I get the following error messages: ??? Undefined command/function 'plotSelection'. ??? Error while evaluating figure WindowButtonMotionFcn. And indeed, I cannot find the file plotSelection.m in the FC Donders fieldtrip version. Am I doing something wrong? Marcel Robert Oostenveld wrote: > Dear all, > > Dennis has implemented new plotting functions, they have been > committed to CVS this afternoon. The most important difference is > that of adding the option > cfg.interactive='yes' or 'no' (default) > > If you specify interactive-yes, you can make a selection, click on > it, and that selection will be plotted in a new figure. I.e. if you > start with a topoplotTFR, you can make a selection of channels, and > the average TFR of that channels will be plotted in the next figure > as a singleplotTFR. If you select a time-frequency window in that > singgleplotTFR, that selection will be plotted in a topoplotTFR. A > similar selection is possible in multiplotTFR, and the same > interactive sequence of plotting is possible for topo/multi/ > singleplotER. > > In case of 3D (TFR) data, the default xparam is 'time', the yparam is > 'freq' and the zparam is powspctrm or cohspctrm. In case of 2D data > (event-related field or power spectra), the xparam is either 'time' > or 'freq', and the zparam is 'avg' or 'powspctrm'. Please read the > documentation of each of the functions for the new options. > > best regards, > Robert & Dennis > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Robert Oostenveld, PhD > F.C. Donders Centre for Cognitive Neuroimaging > Radboud University Nijmegen > phone: +31-24-3619695 > http://www.ru.nl/fcdonders/ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > -- dr. Marcel C.M. Bastiaansen. FC Donders Centre for Cognitive Neuroimaging Visiting address: Kapittelweg 29, 6525 EN Nijmegen, the Netherlands Mailing address: Trigon 181, PO Box 9101, 6500 HB Nijmegen, the Netherlands phone: + 31 24 3610 882 fax: + 31 24 3610 989 mail: marcel.bastiaansen at fcdonders.ru.nl web: http://www.ru.nl/aspx/get.aspx?xdl=/views/run/xdl/page&ItmIdt=20592&SitIdt=1 19&VarIdt=96 -- From laura at GBT.TFO.UPM.ES Tue Mar 7 12:53:24 2006 From: laura at GBT.TFO.UPM.ES (Laura Espino) Date: Tue, 7 Mar 2006 12:53:24 +0100 Subject: EEG/MEG adaptive segmentation Message-ID: Hi, I´m starting to work with adaptive segmentation in EEG/MEG based on the detection of transitions in the signal state for further feature extraction. Is there in fieldtrip some algorithms already developed for this purpose? thanks ! Laura Espino E.T.S.I. Telecomunicacion - UPM Madrid España From r.oostenveld at FCDONDERS.RU.NL Wed Mar 8 12:35:19 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 8 Mar 2006 12:35:19 +0100 Subject: EEG/MEG adaptive segmentation In-Reply-To: <5.2.0.9.0.20060307124808.00c2ec28@pop3.gbt.tfo.upm.es> Message-ID: On 7 Mar 2006, at 12:53, Laura Espino wrote: > I´m starting to work with adaptive segmentation in EEG/MEG based on > the detection of transitions in the signal state for further > feature extraction. > Is there in fieldtrip some algorithms already developed for this > purpose? Hi Laura, No, something exactly like that is not implemented. But if you look at the fieldtrip website (http://www.ru.nl/fcdonders/fieldtrip), under documentation, example matlab scripts, then you will see an example trial function that detects transitions in the EMG signal (i.e. start and end of muscle activity) and that defines trials in which there is muscle activity. Those trials are read in and can then further be analyzed. That script is the closest to what you describe that I can think of. best regards, Robert Oostenveld PS the full link to the script is http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:detect_the_muscle_activity_in_an_emg_channel_ and_use_that_as_trial_definition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From cgra05 at HST.AUC.DK Mon Mar 13 00:53:12 2006 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Mon, 13 Mar 2006 00:53:12 +0100 Subject: Problem using .eeg-files Message-ID: An HTML attachment was scrubbed... URL: From pchris at UNC.EDU Mon Mar 13 06:48:15 2006 From: pchris at UNC.EDU (Punita) Date: Mon, 13 Mar 2006 06:48:15 +0100 Subject: plotting Message-ID: Hello, I am new to this group. I was just wondering if there was a simple method in fieldtrip that would allow me to plot surface potential data on a spherical head surface. As for my data - I have 3 arrays containing the x, y, and z coordinates on the surface of the head, and a 4th array that contains values of the potentials at these specified locations. Any help or pointers would be deeply appreciated. Thank you, Punita From jaakko.sarela at TKK.FI Mon Mar 13 10:26:41 2006 From: jaakko.sarela at TKK.FI (Jaakko Sarela) Date: Mon, 13 Mar 2006 11:26:41 +0200 Subject: Neuromag specifications in Fieldtrip Message-ID: Hi I'm trying to use the Fieldtrip package to analyse a data from Neuromag 306 channel device (actually, I only have the 204 gradiometer channels). However, I do not have access to the fif-files, so standard approach using Fieltrip does not work. I have the following information: - data file (as a matrix in MATLAB) - the channel locations (in VVchs_flat.txt, 2D or VVchs.txt, 3D) Based on this information, is it possible to use the Fieldtrip package for subsequent analysis? What information do I need to specify, before I can for instance, plot fields on certain time locations, using topoplotER? --------------------------------------------------------------------------- D. Sc. (Tech) Jaakko Särelä Helsinki University of Technology Laboratory of Computer and Information Science P.O. Box 5400, FIN-02015 HUT, Finland http://www.cis.hut.fi/jaakkos Tel: +358-9-451 4896; Fax: +358-9-451 3277; Email: jaakko.sarela at hut.fi --------------------------------------------------------------------------- From Jan.Schoffelen at FCDONDERS.RU.NL Mon Mar 13 13:01:01 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Mon, 13 Mar 2006 13:01:01 +0100 Subject: Neuromag specifications in Fieldtrip In-Reply-To: <20060313092641.GB10085@mail.cis.hut.fi> Message-ID: Dear Jaakko, Yes, it is possible to subsequently process your data. Fieldtrip only needs to know how to interpret your data-matrix. So you should create a structure, which is recognizable as a fieldtrippish-thingy. If your input-data is defined in a matrix, you have to specify the following fields in your input-structure: input.dimord: this is a string which specifies for each dimension of your matrix what it means, If you have time-domain data, with repetitions, it should be input.dimord = 'rpt_chan_time', with the dimensionality of your data accordingly. input.trial = yourdata If you do not have repetitions, but just an average over trials, input.avg = yourdata input.dimord = 'chan_time'; Next you have to define some additional stuff: input.label: this is a cell-array containing the channel-labels input.time: this is a row-vector telling fieldtrip how to convert from sample to seconds. If you want to do frequency-analysis, it becomes a bit more tricky; you then have to convert your data matrix into a cell-array, containing the single-trial data Nchan*Ntime. You do not need a dimord in that case, but you need a cell-array of vectors input.time, which specifies the time-axis for each trial separately. Hope this helps, Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jaakko Sarela Sent: Monday, March 13, 2006 10:27 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] Neuromag specifications in Fieldtrip Hi I'm trying to use the Fieldtrip package to analyse a data from Neuromag 306 channel device (actually, I only have the 204 gradiometer channels). However, I do not have access to the fif-files, so standard approach using Fieltrip does not work. I have the following information: - data file (as a matrix in MATLAB) - the channel locations (in VVchs_flat.txt, 2D or VVchs.txt, 3D) Based on this information, is it possible to use the Fieldtrip package for subsequent analysis? What information do I need to specify, before I can for instance, plot fields on certain time locations, using topoplotER? --------------------------------------------------------------------------- D. Sc. (Tech) Jaakko Särelä Helsinki University of Technology Laboratory of Computer and Information Science P.O. Box 5400, FIN-02015 HUT, Finland http://www.cis.hut.fi/jaakkos Tel: +358-9-451 4896; Fax: +358-9-451 3277; Email: jaakko.sarela at hut.fi --------------------------------------------------------------------------- From thomas.koelewijn at FCDONDERS.RU.NL Mon Mar 13 13:51:50 2006 From: thomas.koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 13 Mar 2006 13:51:50 +0100 Subject: topoplotER Message-ID: Dear fieldtrippers, I’m trying to use a half year old plot script to plot some new data, but it doesn’t do the trick anymore. Some changes seem to be made in the topoplotER function but I can’t figure out how to cope with them. My data set: label: {152x1 cell} fsample: 600 avg: [152x601 double] var: [152x601 double] time: [1x601 double] individual: [12x152x601 double] dimord: 'subj_chan_time' cfg: [1x1 struct] grad: [1x1 struct] My script cfg = []; cfg.colorbar='no'; cfg.xlim = [0.0:0.1:0.5]; cfg.showzlim = 'no'; cfg.layout = 'ctf151s.lay'; cfg.zlim = [-1.5e-14 1.5e-14]; a = figure ('color',[1 1 1]); topoplotER(cfg,O_GavgLRF_C); what is going wrong? Thomas From Jan.Schoffelen at FCDONDERS.RU.NL Mon Mar 13 14:35:17 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Mon, 13 Mar 2006 14:35:17 +0100 Subject: topoplotER In-Reply-To: Message-ID: Hi Thomas, Could you be a bit more specific? JM -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Thomas Koelewijn Sent: Monday, March 13, 2006 1:52 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] topoplotER Dear fieldtrippers, I'm trying to use a half year old plot script to plot some new data, but it doesn't do the trick anymore. Some changes seem to be made in the topoplotER function but I can't figure out how to cope with them. My data set: label: {152x1 cell} fsample: 600 avg: [152x601 double] var: [152x601 double] time: [1x601 double] individual: [12x152x601 double] dimord: 'subj_chan_time' cfg: [1x1 struct] grad: [1x1 struct] My script cfg = []; cfg.colorbar='no'; cfg.xlim = [0.0:0.1:0.5]; cfg.showzlim = 'no'; cfg.layout = 'ctf151s.lay'; cfg.zlim = [-1.5e-14 1.5e-14]; a = figure ('color',[1 1 1]); topoplotER(cfg,O_GavgLRF_C); what is going wrong? Thomas From marie at PSY.GLA.AC.UK Mon Mar 13 16:35:14 2006 From: marie at PSY.GLA.AC.UK (Marie Smith) Date: Mon, 13 Mar 2006 15:35:14 +0000 Subject: read_ctf_mri In-Reply-To: Message-ID: Hi, I am trying to load CTF .mri files using the read_ctf_mri function. The function fails when the reshape function is called. Having checked the contents of mri at this point they do not total 256*256*256 elements, but some smaller number (256*256*255.39). Could anyone suggest why this would be the case? Thanks, Marie Smith %%% Error message To RESHAPE the number of elements must not change. Error in ==> read_ctf_mri at 103 mri = reshape(mri, [256 256 256]); From tomh at KURAGE.NIMH.NIH.GOV Mon Mar 13 16:42:43 2006 From: tomh at KURAGE.NIMH.NIH.GOV (Tom Holroyd (NIH/NIMH) [E]) Date: Mon, 13 Mar 2006 10:42:43 -0500 Subject: read_ctf_mri In-Reply-To: <04D6A9B6-47AC-4901-8E1C-B9859C002965@psy.gla.ac.uk> Message-ID: Is it a newer format .mri file? They can have a variable length. If you look in the File menu there's a place where you can re-save it as a v2 format file which is flat. Marie Smith wrote: > Hi, > > I am trying to load CTF .mri files using the read_ctf_mri function. The > function fails when the reshape function is called. Having checked the > contents of mri at this point they do not total 256*256*256 elements, > but some smaller number (256*256*255.39). Could anyone suggest why this > would be the case? > > Thanks, > > Marie Smith > > %%% Error message > To RESHAPE the number of elements must not change. > > Error in ==> read_ctf_mri at 103 > mri = reshape(mri, [256 256 256]); > -- Tom Holroyd, Ph.D. "If you have to ask, I'm not telling you." -- Classic female answer to a question. From r.oostenveld at FCDONDERS.RU.NL Mon Mar 13 20:45:46 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 13 Mar 2006 20:45:46 +0100 Subject: Problem using .eeg-files In-Reply-To: Message-ID: Hi Carina, What kind of file is the *.eeg that you mention? Is it Neuroscan or EEProbe? Both should be supported, however, today I did notice a bug in code for neuroscan *.eeg files. Regarding the configuration. The "xxx.ds" directory is special for CTF MEG data, and contains a whole bunch of files (e.g. a seperate header and data file, and other files containing the marker events). If you want to run the tutorial, you should download the demo data from teh ftp server. In your case you should not make a xxx.ds directopry, but instead specify cfg.datafile = 'Ken_data.eeg' cfg.headerfile = 'Ken_data.eeg' since the data and header information are both in the same file. Furthermore, the cfg3.trialdef.includeTrigger = 3; cfg3.trialdef.excludeConditions = {'BAD'}; are also specific for CTF. You should read eth help of DEFINETRIAL, specifically the cfg.trialdef.eventtype = '?' will be of interest (since it shows you what you can actually use). best Robert On 13 Mar 2006, at 0:53, Carina Graversen wrote: > Hi. I just downloaded the Fieldtrip program to use it for my thesis > as biomedical engineering, and I'm now trying to use it on a .eeg- > file, which causes some problems for me. I have created the > directory Ken_data.ds where I have the file Ken_data.eeg. I use the > following configuration (taken from the tutorial and previous > answers from this forum): cfg3 = []; cfg3.dataset = 'Ken_test.ds'; > cfg3.trialdef.includeTrigger = 3; cfg3.trialdef.excludeConditions = > {'BAD'}; cfg3.blc = 'yes'; cfg3.blcwindow = [-0.2 0]; cfg3.lpfilter > = 'yes'; cfg3.lpfreq = 35; cfg3.padding = 0; cfg3.datafile = > 'Ken_test.eeg'; cfg3.headerfile = 'Ken_test.eeg'; cfg3.channel = > 'all'; I then call the preprocessing function: dataFIC = > preprocessing(cfg3); Unfortunately I get the following errors: > Warning: could not determine filetype of Ken_test.ds\Ken_test.meg4 > > In fieldtrip-20060306\private\filetype at 524 In definetrial at > 109 In preprocessing at 270 evaluating trialfunction > 'trialfun_ctf_epoched' ??? Error using ==> fieldtrip-20060306 > \private\read_ctf_meg4 could not open datafile Which I guess means > that I haven't used the correct configuration, since the program is > searching for a .meg4-file. I hope someone can help me by giving > the correct configuration when working on .eeg-files :o). Thanks in > advance. Regards, Carina Graversen Aalborg University, Denmark From r.oostenveld at FCDONDERS.RU.NL Mon Mar 13 20:51:11 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 13 Mar 2006 20:51:11 +0100 Subject: plotting In-Reply-To: Message-ID: Hi Punita There is no 3D plotting function, i.e. one that would assume that the head is a surface in 3D space, and which would require to rotate the head to get a full view of the sides. But there are plotting functions for scalp topographies which assume that you have projected the electrode locations on a 2D plane (i.e. a top view). They use layout files (see for an example the *.lay files, they are plain ascii). Alternatively, you can use the topoplot() function, which either uses a layout file or which also allows you to specify the x,y positions and the potential values at each site. best Robert PS if you do want to plot your x/y/z/v data in 3D and be able to rotate, you can use the undocumented and unsupported private/triplot function. You should then copy it from the private folder into fieldtip main. You then would do >> triplot([x y z], [], v) On 13 Mar 2006, at 6:48, Punita wrote: > Hello, > I am new to this group. I was just wondering if there was a simple > method > in fieldtrip that would allow me to plot surface potential data on a > spherical head surface. As for my data - I have 3 arrays > containing the x, > y, and z coordinates on the surface of the head, and a 4th array that > contains values of the potentials at these specified locations. > Any help or pointers would be deeply appreciated. > Thank you, > Punita > From r.oostenveld at FCDONDERS.RU.NL Mon Mar 13 21:05:15 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 13 Mar 2006 21:05:15 +0100 Subject: Neuromag specifications in Fieldtrip In-Reply-To: <20060313092641.GB10085@mail.cis.hut.fi> Message-ID: Hi Jaacko If you go to http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions and scroll down to "How can I import my own dataformat?", you can read the structure of the raw data format (i.e. the format that Jan-Mathijs mentioned at the end of his mail). In case yu want to topoplot: you should use the 2D locations and make a layout file (*.lay) for it. Please open one of the (plan ascii) layout files in a text editor (e.g. NM122.lay). With the data that you describe, you should be able to do all channel level analyses (but not source analyses, since that requires more information, like the location and orientation of all individual MEG coils). best Robert On 13 Mar 2006, at 10:26, Jaakko Sarela wrote: > Hi > > I'm trying to use the Fieldtrip package to analyse a data from > Neuromag 306 channel device (actually, I only have the 204 gradiometer > channels). > > However, I do not have access to the fif-files, so standard approach > using Fieltrip does not work. I have the following information: > - data file (as a matrix in MATLAB) > - the channel locations (in VVchs_flat.txt, 2D or VVchs.txt, 3D) > > Based on this information, is it possible to use the Fieldtrip package > for subsequent analysis? What information do I need to specify, > before I > can for instance, plot fields on certain time locations, using > topoplotER? From d.talsma at PSY.VU.NL Tue Mar 14 11:48:27 2006 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Tue, 14 Mar 2006 11:48:27 +0100 Subject: Missing 'elec' field when reading neuroscan CNT files? Message-ID: Hi Folks, I just ran into the following issue. For an ongoing EEG project, which was originally stored in neuroscan CNT files, I'm trying to set up a clusterrandanalysis. The analysis doesn't run, because the input data struct is expected to have an 'elec' field (in order to compute the neighbouring channels). Just looking at some CTF MEG data, I saw that these data structs do contain the (for these puposes) equivalent 'grad' field, consisting of the following data members: grad.pnt grad.ori grad.tra grad.label grad.units I suspect that elec will be similar, but which fields are required? I suspect pnt, tra, label, and unit. Assuming this is correct, I have the following questions: In what coordinate system is elec.pnt specified? (Cartesian, polar? Which reference frame?) What is the meaning of the tra field? Cheers, Durk From r.oostenveld at FCDONDERS.RU.NL Tue Mar 14 12:22:53 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 14 Mar 2006 12:22:53 +0100 Subject: Missing 'elec' field when reading neuroscan CNT files? In-Reply-To: <44169F7B.3010604@psy.vu.nl> Message-ID: Hi Durk On 14 Mar 2006, at 11:48, Durk Talsma wrote: > I just ran into the following issue. For an ongoing EEG project, > which was originally stored in neuroscan CNT files, I'm trying to > set up a clusterrandanalysis. The analysis doesn't run, because the > input data struct is expected to have an 'elec' field (in order to > compute the neighbouring channels). > > Just looking at some CTF MEG data, I saw that these data structs do > contain the (for these puposes) equivalent 'grad' field, consisting > of the following data members: > > grad.pnt > grad.ori > grad.tra > grad.label > grad.units > > I suspect that elec will be similar, but which fields are required? > I suspect pnt, tra, label, and unit. Assuming this is correct, I > have the following questions: See the documentation on http://www2.ru.nl/fcdonders/fieldtrip/ doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_are_electrodes _magnetometers_or_gradiometers_described and scroll down to "How are electrodes, magnetometers or gradiometers described?" You only need elec.pnt = Nchan x 3, with [x y z] elec.label = Nchan x 1 cell array with labels > In what coordinate system is elec.pnt specified? (Cartesian, polar? > Which reference frame?) The positions should be carthesian, and can be in any reference frame (head/polhemus/mri) and in any units. Whether channels are neighbours or not will be the same in any reference frame, so that is why that does not matter. Better not use elec.units, since that is not consistently supported throughout FieldTrip and probably does not do anything. In clusterrandanalysis you furthermore can specify cfg.neighbourdist = distance in the same units as above See also read_fcdc_elec (esp look into the code), which might help you to get an elec structure for your data. You can also manually construct a neighbourhood structure using cfg.neighbours (in that case fieldtrip does not need the elec strucure), that is explained in the help of clusterrandanalysis. > What is the meaning of the tra field? It is only for MEG, and it is the linear transformation matrix from the field at each coil to the field at each channel. Gradiometer channels have 2 coils, so think of a forward model for all coils that contains (2*151)x3 fT values, a grad.tra=[eye(151) -eye(151)] and aforward model for all channels that contains 151x3 fT values (the 3 is because of the three dipole orientations). Robert From r.oostenveld at FCDONDERS.RU.NL Thu Mar 16 15:36:05 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 16 Mar 2006 15:36:05 +0100 Subject: fieldtrip version 0.9.7 released Message-ID: Dear Fieldtrip users, This week the "Toolkit of Cognitive Neuroscience: advanced data analysis and source modelling of EEG and MEG data" course has been given at the F.C. Donders Centre. During the course, the Fieldtrip toolbox has been used in the tutorial hands-on sessions. For the course we have made a new release of the fieldtrip toolbox: version 0.9.7. All the up-to-date tutorials (which are available from http:// www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial) have been tested and are known to work with this release version. If you wish, you can upgrade to this stable release version. Preferably, you should always use the daily released version, since that will always contain the latest enhancements. The fieldtrip toolbox 0.9.7 and the daily release versions are available from the homepage (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:download) or directly from the ftp server (ftp:// ftp.fcdonders.nl/pub/fieldtrip). best regards ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From Brian.Roach at YALE.EDU Thu Mar 16 18:57:51 2006 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 16 Mar 2006 12:57:51 -0500 Subject: new user questions Message-ID: Hi, I am very new to Fieldtrip, and I have a pretty basic question about loading data to process - how do I do it? Looking at example code and the tutorials, it seems like I need to have a .ds file that contains my data. I am able to load .cnt and brain vision analyzer data successfully with their related functions, but how do I then assign that data to a .ds file? If there is documentation for this that I have missed, please point me to it. Also - what kind of interpolation would the topoPlot function use for EEG data (spherical or based on a 3-d head model)? Thank you! Brian From shahink at U.WASHINGTON.EDU Fri Mar 17 01:57:31 2006 From: shahink at U.WASHINGTON.EDU (Shahin Hakimian) Date: Fri, 17 Mar 2006 01:57:31 +0100 Subject: Help a novice with EEGlab2fieldtrip() Message-ID: Hello, Please excuse my ignorance. When I tried to transfer data from EEGLab to Fieldtrip using the function above, the procedure initially seemed to work. Later, however, preprocessing of the same dataset failed since the header was not there. Am I doing something wrong? Does the EEGlab2fieldtrip automatically fill in the header fields? Thanks From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 17 09:40:50 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 17 Mar 2006 09:40:50 +0100 Subject: new user questions In-Reply-To: <6.1.2.0.2.20060316125317.01b1ed10@email.med.yale.edu> Message-ID: Dear Brian, Please have a look at the fieldtrip website. When you go to the documentation part and then to the frequently asked questions, you'll find everything you want to know. Fieldtrip supports several data-formats, including neuroscan data. The .ds data-format is the one we have on our MEG-system. So there is no need to do complicated stuff with your own data. The interpolation for the plotting is just a linear or spline interpolation of the surface-data. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Brian Roach Sent: Thursday, March 16, 2006 6:58 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] new user questions Hi, I am very new to Fieldtrip, and I have a pretty basic question about loading data to process - how do I do it? Looking at example code and the tutorials, it seems like I need to have a .ds file that contains my data. I am able to load .cnt and brain vision analyzer data successfully with their related functions, but how do I then assign that data to a .ds file? If there is documentation for this that I have missed, please point me to it. Also - what kind of interpolation would the topoPlot function use for EEG data (spherical or based on a 3-d head model)? Thank you! Brian From r.oostenveld at FCDONDERS.RU.NL Fri Mar 17 10:26:59 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 17 Mar 2006 10:26:59 +0100 Subject: Help a novice with EEGlab2fieldtrip() In-Reply-To: Message-ID: Dear Shakin The eeglab2fieldtrip function should be used if you have already done the preprocessing in EEGLAB. If you use eeglab2fieldtrip, you do not have to use preprocessing. The EEG structure from EEGLAB contains all data, whereas in Fieldtrip we work with one data object at a time (i.e. raw data is a data object which normally would result from the preprocessing function). I.e. you can do data = eeglab2fieldtrip(EEG, 'preprocessing') and get the preprocessed raw data, or timelock = eeglab2fieldtrip(EEG, 'timelockanalysis') to get the averaged ERP, or comp = eeglab2fieldtrip(EEG, 'componentanalysis') to get the component topographies and activations. best regards, Robert ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On 17 Mar 2006, at 1:57, Shahin Hakimian wrote: > Please excuse my ignorance. When I tried to transfer data from > EEGLab to > Fieldtrip using the function above, the procedure initially seemed > to work. > Later, however, preprocessing of the same dataset failed since the > header > was not there. Am I doing something wrong? Does the EEGlab2fieldtrip > automatically fill in the header fields? > Thanks > From cgra05 at HST.AUC.DK Thu Mar 23 11:24:49 2006 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 23 Mar 2006 11:24:49 +0100 Subject: problems using multiplotTFR for eeg-files. In-Reply-To: <6EA6DC7F-A7D4-4BAB-B2AB-7BF4D6845EA8@fcdonders.ru.nl> Message-ID: Hi. I'm trying to use the wavelet code for an .eeg-file, but unfortunately I run into problems when I try to plot the results. The error I get is a lot of the following messages: Warning: Divide by zero. > In fieldtrip-20060306\private\nan_mean at 57 In freqbaseline>TFabschange at 201 In freqbaseline at 109 In multiplotTFR at 142 reading layout from file CTF151.lay Warning: Divide by zero. > In mean at 31 In multiplotTFR at 251 I use the following commands: % ************************************************************************* % EVENTRELATEDAVERAGING % ************************************************************************* cfg1 = []; cfg1.datafile = 'Ken_test.eeg'; cfg1.headerfile = 'Ken_test.eeg'; cfg1.channel = 'all'; dataFIC = preprocessing(cfg1); % Preprocess! cfg2 = []; avgFIC = timelockanalysis(cfg2, dataFIC); % ************************************************************************* % WAVELET % ************************************************************************* cfg7 = []; cfg7.output = 'pow'; cfg7.method = 'wltconvol' cfg7.foi = 1:2:30; cfg7.t_ftimwin = 5./cfg7.foi; cfg7.tapsmofrq = 0.4 *cfg7.foi; cfg7.toi = -0.5:0.05:1.5; TFRmult = freqanalysis(cfg7, dataFIC); cfg8 = []; cfg8.baseline = [-0.5 -0.1]; cfg8.zlim = [-3e-27 3e-27]; cfg8.showlabels = 'yes'; cfg8.layout = 'CTF151.lay'; multiplotTFR(cfg8, TFRmult); Can anyone give me a clue on what I'm doing wrong ??? Best Regards, Carina Graversen From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 23 12:09:58 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 23 Mar 2006 12:09:58 +0100 Subject: problems using multiplotTFR for eeg-files. In-Reply-To: Message-ID: Dear Carina, cfg8.layout = 'CTF151.lay'; This is incorrect. The cfg.layout field specifies for the plotting function, how to interpret the input-data. With this configuration fieldtrip expects that your input data consists of data obtained with the 151-gradiometer CTF system. Please have a look at the help of multiplotTFR, in which it is explained how to deal with the cfg.layout field. Yours, Jan-Mathijs From r.oostenveld at FCDONDERS.RU.NL Thu Mar 23 13:25:57 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 23 Mar 2006 13:25:57 +0100 Subject: problems using multiplotTFR for eeg-files. In-Reply-To: Message-ID: Hi Carina, Here is another clue: > Warning: Divide by zero. >> In fieldtrip-20060306\private\nan_mean at 57 > In freqbaseline>TFabschange at 201 > In freqbaseline at 109 > In multiplotTFR at 142 These warnings indicate that the specified baseline period does not contain any power, which is due to the wavelet being too long. I suggest to start with plotting a single TFR without any baseline correction, using the standard matlab function imagesc. Then you can see at which latency the power starts to be real-valued (insted of nans, which indicate that the wavelet is not yet completely inside the data). Robert From will.51 at OSU.EDU Sun Mar 26 05:19:16 2006 From: will.51 at OSU.EDU (Udo Will) Date: Sat, 25 Mar 2006 21:19:16 -0600 Subject: average intertrial phase coherence Message-ID: Hi I wonder if there is a fieldtrip function that calculates 1) average intertrial phasecoherence for a set of frequencies at individual electrode locations, and 2) the timedevelopment of this intertrial phasecoherence (i.e a time/phase plot). Regards Udo Will From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 13:25:12 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 13:25:12 +0200 Subject: average intertrial phase coherence In-Reply-To: <44260834.6000802@osu.edu> Message-ID: Dear Udo, That is not implemented yet, but it is easy to compute yourself. You should do freqanalysis with method=mtmfft (for 1) or method=mtmconvol (for 2) and output=fourier, which also implies keeptaper=yes and keeptrial=yes. That results in the complex fourier representation of the data (in one large "ntrial X nchan X nfreq X ntime" array) , from which you can compute the ITC. I recommend not to use multitapering (=frequency smoothing) for the ITC, so in freqanalysis you should also specify taper=hanning (or another single taper of your choise). Even with taper=hanning, you are required to specify something as taper-smoothing-frequency (i.e. cfg.tapsmofrq), but that is neglected (the field needs to be present, but is not used). Best regards, Robert On 26 Mar 2006, at 5:19, Udo Will wrote: > Hi > > I wonder if there is a fieldtrip function that calculates 1) > average intertrial phasecoherence for a set of frequencies at > individual electrode locations, and 2) the timedevelopment of this > intertrial phasecoherence (i.e a time/phase plot). > > Regards > Udo Will > From litvak at TECHUNIX.TECHNION.AC.IL Mon Mar 27 15:15:30 2006 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Mon, 27 Mar 2006 15:15:30 +0200 Subject: LORETA to Fieldtrip In-Reply-To: <49442A5E-58F1-4A3B-84BA-0C7A60B0F21B@fcdonders.ru.nl> Message-ID: Hi Robert, I tried reading the SPM MRI file (single_subj_T1.mnc - is this the one you meant?) but in the grid variables there are just indices in the matrix. So how do I know the correspondence to LORETA voxels? Is there a way to put the MNI grid there? Thanks, Vladimir -----Original Message----- From: Robert Oostenveld [mailto:r.oostenveld at fcdonders.ru.nl] Sent: Monday, March 27, 2006 2:43 PM To: Vladimir Litvak Subject: Re: Clusterrandanalysis > The question is - can we build a gateway for reading LORETA files > in FT and > applying the same statistics as you use for the beamformer? > This > shouldn't be something very complicated I think. The only problem > is that > LORETA uses a grid of 2394 voxels which are only in the gray matter > (so > there are some holes there) and it would probably be necessary to > do some > smoothing. Also one must write a routine for transforming from > LORETA grid > to your grid (based on Tailarach coordinates of the voxels). I once started with implementing LORETA myself in sourceanalysis, but never finished it. I don't consider LORETA to be too interesting for MEG, although I do appreciate it's usefullness for EEG. I have been in contact a couple of times with Roberto Pasqual-Marqui, and he told me some of the details. LORETA is using plain SPM/MNI coordinates, which can also be used in FT. The holes can be dealt with in FT by specifying NaNs as source.avg.pow, [] as source.avg.mom, and by specifying the right source.inside and source.outside vector (those are indices specifying which voxels are inside the brain, or inside the gray matter if you wish). Writing a LORETA importer should be trivial, but I am not going to do it myself. Please point the grad student to http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_is_anatomical_ functional_or_statistical_volume_data_described and tell him to use volume.inside and volume.outside to "fill" the non-gray matter so that the data fits into a 3D box. Also do addpath spm2 volume = read_fcdc_mri(filename) with filename being the canonical MRI from SPM (the collin27 one). That should belp in getting it alligned with the proper transformation matrix. Once you can read a single LORETA volume into FT, then you can repeat it for all subjects and do your statistics. Please address further questions regarding this topic to the mailing list. Robert PS I don't think that you want to smooth, our source clustering is aware of the grey/white matter differences (given the correct inside/ outside specification). From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 21:28:58 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 21:28:58 +0200 Subject: LORETA to Fieldtrip In-Reply-To: <000001c651a0$8884a750$90514484@dellgx240> Message-ID: On 27 Mar 2006, at 16:51, Vladimir Litvak wrote: > I thought about this somewhat more and there are some things I > realized and > some new questions that came up: > > 1) Why do I need the Collin brain if I don't plot the results in > fieldtrip? > A much simpler way would be to create a grid according to the > maximal values > of coordinates in LORETA (there is a list). Then I don't need any > transforms > - I just fill this grid directly using the MNI coordinates (plus some > constant). Then after the analysis I can simply export the result > back to > LORETA. You can use the collin brain to learn how volumes are represented in FT (and in SPM for that matter): with the transformation matrix. Furthermore, you can map the LORETA data onto the collin brain to check whether you have interpreted the LORETA 3D array correctly. It could be that in LORETA part of the brain has been cut off, which would mess up the matching, that is something which you need to be aware of. Spatial clustering in FT requires that you specify the shape of the 3D array correctly. The best way of knowing that it is correct is by plotting it in FT. FT sourceplotting also has options for combining anatomy+functional+statistics in one display (using grey+color +tranparency). Why not ask around whether someone has read it into Matlab before. I suspect that there is a mailing list, or you can ask Roberto Pasqual- Marqui directly. > 2) Does sourcestatistics handle multiple timeframes i.e. does > clustering > both in time and in space the same way as with scalpmaps? If yes, > how do I > specify the input for this? I haven't tried yet but I suspect that > would be > a pretty heavy operation to run. No, sofar I have not implemented Xvox-Yvox-Zvox-freq-time clustering, only Xvox-Yvox-Zvox clustering. We typically do not look at multiple frequencies or latencies, since on the channel level we can already decide (channel statistics) which time-frequency "tile" is significant. Subsequently we use multitapering on exactly that time- frequency tile to capture the complete effect in one TF-bin (with the desired width in both dimensions) and beam that single bin. So the standard way to deal with source data is that it is 3-D only. Actually it would not be too hard to implement the clustering in 4-D or 5-D, although I have no idea on the computational demands. I suspect it to be computationally feasible, since it uses the Matlab image processing toolbox, which is very efficient. For your LORETA data, the 4-D clustering does seem to be interesting so I could look at implementing it for N-D. The channel clustering is much more difficult, since the channel locations do not "code" a nice natural dimension in the data but they have a weird neighbourhood structure. Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 21:52:16 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 21:52:16 +0200 Subject: COEFS In-Reply-To: <6.2.3.4.0.20060327200856.01da0858@193.62.66.20> Message-ID: Hi James. On 27 Mar 2006, at 21:14, James Kilner wrote: > I am trying to understand how one forms synthetic gradiometers from > the MEG data. I spoke to CTF about this sometime ago and they told > me that the raw data is recorded with whatever gradiometer settings > you choose but I wanted to check this. Do you use the coefs (as > defined in ctf_read_meg4) in your latest release? Do you already > have functions to change the order of the gradiometers? No, we are still using our own read_ctf_res4 without the coefs. I know that the raw data in the meg4 file can be stored in different formats, i.e. with or without the coefs being applied. Furthermore, there is also the option in CTF to only store the flag in the processing params file, whereby DataEditor remembers it the next time that you open the dataset (but the data in teh meg4 itself is not touched). The coefs can always be undone, which means that there should be a flag in the res4 header specifying whether the coefs have been applied or not. I am working on a redesign of the reading functions, which will also clear up the low-level functions: currently the mix between read_ctf_res4 and ctf_read_res4 is kind of vague. Furthermore, I have some synthetic gradient code that I would not mind sharing with you, but it requires testing and tighter integration with FT. I already want to add support for the synthetic gradients for quite some time now, but am lacking the time to implement it myself (and the MEG site in Nijmegen is relatively noise-free). I can point you to the right spots in the FT code, conceptually it is not too complex. best regards, Robert PS I just replied to your download mail before I noticed this mail in my inbox. I moved this mail over to the discussion list, since I think that it is also relevant for the other CTF users. From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 22:14:10 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 22:14:10 +0200 Subject: LORETA to fieldtrip In-Reply-To: <000001c651bd$8288a5a0$90514484@dellgx240> Message-ID: Hi Vladimir On 27 Mar 2006, at 18:42, Vladimir Litvak wrote: > I tried to do some simple calculation and it doesn't look good. The > size of > a box defined by MNI coordinates used in LORETA is 141x166x116. > Even in > single precision it takes 10 Mb. In order to do the analysis I > can't do in > LORETA (regression) I need to store 4 conditions for 10 subjects. > That gives > us 400Mb per time frame. Yes, I can follow the math (141x166x11 x 4bytes x 4conditions x 10subjects = 400MB). That means that for 20 timepoints (assuming some temporal downsampling and selection of a latency window of interest) that you need 8GB RAM just to hold the data. If you could a-priory identy a time-window of interest, then you could average over that time-window, limiting the analysis to a single 400MB. Alternatively, you could spatially downsample with a factor of 2x2x2 (using the DOWNSAMPLEVOLUME function), which would result in the data fitting in 1GB of RAM. After identifying the time of interest in this spatially downsampled volume, you could again go to the full resolution volume and only work on the (average) time of interest to localize the effect in that timewindow. > We had an idea here to solve this but I'm not sure it's > statistically sound. > The idea is to do the analysis for each timeframe separately and > then look > for clusters continuous in time and compare them to what you would > get with > reshuffled timeframes. The problem is that the null hypothesis in > the second > step is not the same as in the first step. What do you think? Yyou cannot give an unambigous interpretation of the probability that you are getting out of the second step. The hypothesis of interest is not on the timecourses (which will have a natural autocorrelation that of course will be destroyed by the shuffling), but on the data in the different conditions. As far as I can tell, shuffling the timewindows does not correspond with a hypothesis that relates in a meaningfull way to the data taht you observed in the 4 conditions. > In any case, I can define some segments to average if there is no > choice. Furthermore, applying some Bonferoni correction for the multiple time frames should not be too much of a problem. ALternatively, you can do a massive univariate test on chuncks of the data (clustering only in time and not in space), store the probabilities per voxel, and use the false discovery rate method for multiple comparison correction. I have code for FDR (but not in FT yet). The idea in pseudocode would be for slice=1:116 read 10x4 slices, each with 141x166 voxels do statistics on each slice, without multiple comparison correction over voxels, but with correction over timepoints: that gives you an interpretable probability per voxel. save the probabilities end for all slices, read all voxel probabilities and apply FDR to control for the expected proportion of false alarms over all voxels best regards, Robert From arno at SALK.EDU Tue Mar 28 12:05:43 2006 From: arno at SALK.EDU (arno) Date: Tue, 28 Mar 2006 12:05:43 +0200 Subject: LORETA to Fieldtrip In-Reply-To: <72073E3B-32D0-4A02-8A96-4E9532E1D4FD@fcdonders.ru.nl> Message-ID: > Spatial clustering in FT requires that you specify the shape of the 3D > array correctly. The best way of knowing that it is correct is by > plotting it in FT. FT sourceplotting also has options for combining > anatomy+functional+statistics in one display (using > grey+color+tranparency). > > Why not ask around whether someone has read it into Matlab before. I > suspect that there is a mailing list, or you can ask Roberto > Pasqual-Marqui directly. I do have a function to read LORETA results under Matlab and overlay them onto a custom MRI file (normalized to the MNI brain using SPM2 for example; MRI files can be read with the fieldtrip function read_fcdc_mri). The attached file LORETAtalairach.xyz is part of the LORETA distribution and contain the MNI coordinates of the LORETA voxels. Arno >> 2) Does sourcestatistics handle multiple timeframes i.e. does clustering >> both in time and in space the same way as with scalpmaps? If yes, how >> do I >> specify the input for this? I haven't tried yet but I suspect that >> would be >> a pretty heavy operation to run. > > No, sofar I have not implemented Xvox-Yvox-Zvox-freq-time clustering, > only Xvox-Yvox-Zvox clustering. We typically do not look at multiple > frequencies or latencies, since on the channel level we can already > decide (channel statistics) which time-frequency "tile" is > significant. Subsequently we use multitapering on exactly that > time-frequency tile to capture the complete effect in one TF-bin (with > the desired width in both dimensions) and beam that single bin. So the > standard way to deal with source data is that it is 3-D only. Actually > it would not be too hard to implement the clustering in 4-D or 5-D, > although I have no idea on the computational demands. I suspect it to > be computationally feasible, since it uses the Matlab image processing > toolbox, which is very efficient. For your LORETA data, the 4-D > clustering does seem to be interesting so I could look at implementing > it for N-D. The channel clustering is much more difficult, since the > channel locations do not "code" a nice natural dimension in the data > but they have a weird neighbourhood structure. > > Robert > > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: loreta_importcomp.m URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: LORETAtalairach.xyz URL: From litvak at TECHUNIX.TECHNION.AC.IL Wed Mar 29 18:36:23 2006 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Wed, 29 Mar 2006 18:36:23 +0200 Subject: LORETA to fieldtrip In-Reply-To: Message-ID: Hi again, I made some progress with loreta2fieldtrip function. It supports both the new sLORETA and the old LORETA format. I had to prepare two resampled MRI scans of Collin to match to each kind of LORETA file. I attach the function, these scans, the index file that is necessary for the conversion and two example files for LORETA and for sLORETA. To test the function you should run: volume=loreta2fieldtrip('test.slor', 1); volume=loreta2fieldtrip('test.lorb', 1); Now I would like you to help me finalize this function to produce something suitable for statitistical analysis. As I said yesterday with the sizes I actually got it shouldn't be a problem to run time-space test. It's probably not necessary to include the anatomy in every volume so the final function should have this as an option. Also I'm not sure whether avg.pow is the right place to put the functional data in this case. Another issue is coordinate system. What I understood from Roberto is that his MNI coordinates correspond to voxels in the original not downsampled Collin scan (such as the one I sent you before). The origin is [91 127 73]. The lCollin was obtained by downsampling the original Collin with (4:7:end, 4:7:end, 4:7:end) and the slCollin with (1:5:end, 2:5:end, 3:5:end). So if it is necessary to store the MNI coordinates or transformation matrix in the volume, please figure out how this should be done. Then I would appreciate an example of how to run for instance a dependent sample t-test on this data with your new statistics functions. What I really need to do is dependent samples regression with 4 conditions and up to 10 subjects. If this is possible with your present functions please send me an example as well. I hope that if I have these examples I'll be able to keep further developing them as I've been doing until now. If you want, you can include this loreta2fieldtrip extension in Fieldtrip after we finish polishing and testing it. Best, Vladimir -------------- next part -------------- A non-text attachment was scrubbed... Name: loreta2fieldtrip.zip Type: application/x-zip-compressed Size: 106645 bytes Desc: not available URL: From Marcel.Bastiaansen at FCDONDERS.RU.NL Thu Mar 2 11:33:27 2006 From: Marcel.Bastiaansen at FCDONDERS.RU.NL (Marcel Bastiaansen) Date: Thu, 2 Mar 2006 11:33:27 +0100 Subject: new plotting functionality In-Reply-To: <3C6D5FA7-A993-4CC6-9D73-456231758BD0@fcdonders.ru.nl> Message-ID: Hi Robert, Dennis, Whenever I try to use the interactive mode, I get the following error messages: ??? Undefined command/function 'plotSelection'. ??? Error while evaluating figure WindowButtonMotionFcn. And indeed, I cannot find the file plotSelection.m in the FC Donders fieldtrip version. Am I doing something wrong? Marcel Robert Oostenveld wrote: > Dear all, > > Dennis has implemented new plotting functions, they have been > committed to CVS this afternoon. The most important difference is > that of adding the option > cfg.interactive='yes' or 'no' (default) > > If you specify interactive-yes, you can make a selection, click on > it, and that selection will be plotted in a new figure. I.e. if you > start with a topoplotTFR, you can make a selection of channels, and > the average TFR of that channels will be plotted in the next figure > as a singleplotTFR. If you select a time-frequency window in that > singgleplotTFR, that selection will be plotted in a topoplotTFR. A > similar selection is possible in multiplotTFR, and the same > interactive sequence of plotting is possible for topo/multi/ > singleplotER. > > In case of 3D (TFR) data, the default xparam is 'time', the yparam is > 'freq' and the zparam is powspctrm or cohspctrm. In case of 2D data > (event-related field or power spectra), the xparam is either 'time' > or 'freq', and the zparam is 'avg' or 'powspctrm'. Please read the > documentation of each of the functions for the new options. > > best regards, > Robert & Dennis > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Robert Oostenveld, PhD > F.C. Donders Centre for Cognitive Neuroimaging > Radboud University Nijmegen > phone: +31-24-3619695 > http://www.ru.nl/fcdonders/ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > -- dr. Marcel C.M. Bastiaansen. FC Donders Centre for Cognitive Neuroimaging Visiting address: Kapittelweg 29, 6525 EN Nijmegen, the Netherlands Mailing address: Trigon 181, PO Box 9101, 6500 HB Nijmegen, the Netherlands phone: + 31 24 3610 882 fax: + 31 24 3610 989 mail: marcel.bastiaansen at fcdonders.ru.nl web: http://www.ru.nl/aspx/get.aspx?xdl=/views/run/xdl/page&ItmIdt=20592&SitIdt=119&VarIdt=96 -- From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 2 11:57:36 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 2 Mar 2006 11:57:36 +0100 Subject: new plotting functionality In-Reply-To: <4406C9F7.4040307@fcdonders.ru.nl> Message-ID: Dear Marcel, Apparently, plotSelection has not been 'tagged' to be visible from the fieldtrip-version on /home/common/. I just did it (and hopefully correctly). If will be available within five minutes. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Marcel Bastiaansen Sent: Thursday, March 02, 2006 11:33 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: Re: [FIELDTRIP] new plotting functionality Hi Robert, Dennis, Whenever I try to use the interactive mode, I get the following error messages: ??? Undefined command/function 'plotSelection'. ??? Error while evaluating figure WindowButtonMotionFcn. And indeed, I cannot find the file plotSelection.m in the FC Donders fieldtrip version. Am I doing something wrong? Marcel Robert Oostenveld wrote: > Dear all, > > Dennis has implemented new plotting functions, they have been > committed to CVS this afternoon. The most important difference is > that of adding the option > cfg.interactive='yes' or 'no' (default) > > If you specify interactive-yes, you can make a selection, click on > it, and that selection will be plotted in a new figure. I.e. if you > start with a topoplotTFR, you can make a selection of channels, and > the average TFR of that channels will be plotted in the next figure > as a singleplotTFR. If you select a time-frequency window in that > singgleplotTFR, that selection will be plotted in a topoplotTFR. A > similar selection is possible in multiplotTFR, and the same > interactive sequence of plotting is possible for topo/multi/ > singleplotER. > > In case of 3D (TFR) data, the default xparam is 'time', the yparam is > 'freq' and the zparam is powspctrm or cohspctrm. In case of 2D data > (event-related field or power spectra), the xparam is either 'time' > or 'freq', and the zparam is 'avg' or 'powspctrm'. Please read the > documentation of each of the functions for the new options. > > best regards, > Robert & Dennis > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Robert Oostenveld, PhD > F.C. Donders Centre for Cognitive Neuroimaging > Radboud University Nijmegen > phone: +31-24-3619695 > http://www.ru.nl/fcdonders/ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > -- dr. Marcel C.M. Bastiaansen. FC Donders Centre for Cognitive Neuroimaging Visiting address: Kapittelweg 29, 6525 EN Nijmegen, the Netherlands Mailing address: Trigon 181, PO Box 9101, 6500 HB Nijmegen, the Netherlands phone: + 31 24 3610 882 fax: + 31 24 3610 989 mail: marcel.bastiaansen at fcdonders.ru.nl web: http://www.ru.nl/aspx/get.aspx?xdl=/views/run/xdl/page&ItmIdt=20592&SitIdt=1 19&VarIdt=96 -- From laura at GBT.TFO.UPM.ES Tue Mar 7 12:53:24 2006 From: laura at GBT.TFO.UPM.ES (Laura Espino) Date: Tue, 7 Mar 2006 12:53:24 +0100 Subject: EEG/MEG adaptive segmentation Message-ID: Hi, I´m starting to work with adaptive segmentation in EEG/MEG based on the detection of transitions in the signal state for further feature extraction. Is there in fieldtrip some algorithms already developed for this purpose? thanks ! Laura Espino E.T.S.I. Telecomunicacion - UPM Madrid España From r.oostenveld at FCDONDERS.RU.NL Wed Mar 8 12:35:19 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Wed, 8 Mar 2006 12:35:19 +0100 Subject: EEG/MEG adaptive segmentation In-Reply-To: <5.2.0.9.0.20060307124808.00c2ec28@pop3.gbt.tfo.upm.es> Message-ID: On 7 Mar 2006, at 12:53, Laura Espino wrote: > I´m starting to work with adaptive segmentation in EEG/MEG based on > the detection of transitions in the signal state for further > feature extraction. > Is there in fieldtrip some algorithms already developed for this > purpose? Hi Laura, No, something exactly like that is not implemented. But if you look at the fieldtrip website (http://www.ru.nl/fcdonders/fieldtrip), under documentation, example matlab scripts, then you will see an example trial function that detects transitions in the EMG signal (i.e. start and end of muscle activity) and that defines trials in which there is muscle activity. Those trials are read in and can then further be analyzed. That script is the closest to what you describe that I can think of. best regards, Robert Oostenveld PS the full link to the script is http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:detect_the_muscle_activity_in_an_emg_channel_ and_use_that_as_trial_definition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From cgra05 at HST.AUC.DK Mon Mar 13 00:53:12 2006 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Mon, 13 Mar 2006 00:53:12 +0100 Subject: Problem using .eeg-files Message-ID: An HTML attachment was scrubbed... URL: From pchris at UNC.EDU Mon Mar 13 06:48:15 2006 From: pchris at UNC.EDU (Punita) Date: Mon, 13 Mar 2006 06:48:15 +0100 Subject: plotting Message-ID: Hello, I am new to this group. I was just wondering if there was a simple method in fieldtrip that would allow me to plot surface potential data on a spherical head surface. As for my data - I have 3 arrays containing the x, y, and z coordinates on the surface of the head, and a 4th array that contains values of the potentials at these specified locations. Any help or pointers would be deeply appreciated. Thank you, Punita From jaakko.sarela at TKK.FI Mon Mar 13 10:26:41 2006 From: jaakko.sarela at TKK.FI (Jaakko Sarela) Date: Mon, 13 Mar 2006 11:26:41 +0200 Subject: Neuromag specifications in Fieldtrip Message-ID: Hi I'm trying to use the Fieldtrip package to analyse a data from Neuromag 306 channel device (actually, I only have the 204 gradiometer channels). However, I do not have access to the fif-files, so standard approach using Fieltrip does not work. I have the following information: - data file (as a matrix in MATLAB) - the channel locations (in VVchs_flat.txt, 2D or VVchs.txt, 3D) Based on this information, is it possible to use the Fieldtrip package for subsequent analysis? What information do I need to specify, before I can for instance, plot fields on certain time locations, using topoplotER? --------------------------------------------------------------------------- D. Sc. (Tech) Jaakko Särelä Helsinki University of Technology Laboratory of Computer and Information Science P.O. Box 5400, FIN-02015 HUT, Finland http://www.cis.hut.fi/jaakkos Tel: +358-9-451 4896; Fax: +358-9-451 3277; Email: jaakko.sarela at hut.fi --------------------------------------------------------------------------- From Jan.Schoffelen at FCDONDERS.RU.NL Mon Mar 13 13:01:01 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Mon, 13 Mar 2006 13:01:01 +0100 Subject: Neuromag specifications in Fieldtrip In-Reply-To: <20060313092641.GB10085@mail.cis.hut.fi> Message-ID: Dear Jaakko, Yes, it is possible to subsequently process your data. Fieldtrip only needs to know how to interpret your data-matrix. So you should create a structure, which is recognizable as a fieldtrippish-thingy. If your input-data is defined in a matrix, you have to specify the following fields in your input-structure: input.dimord: this is a string which specifies for each dimension of your matrix what it means, If you have time-domain data, with repetitions, it should be input.dimord = 'rpt_chan_time', with the dimensionality of your data accordingly. input.trial = yourdata If you do not have repetitions, but just an average over trials, input.avg = yourdata input.dimord = 'chan_time'; Next you have to define some additional stuff: input.label: this is a cell-array containing the channel-labels input.time: this is a row-vector telling fieldtrip how to convert from sample to seconds. If you want to do frequency-analysis, it becomes a bit more tricky; you then have to convert your data matrix into a cell-array, containing the single-trial data Nchan*Ntime. You do not need a dimord in that case, but you need a cell-array of vectors input.time, which specifies the time-axis for each trial separately. Hope this helps, Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Jaakko Sarela Sent: Monday, March 13, 2006 10:27 AM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] Neuromag specifications in Fieldtrip Hi I'm trying to use the Fieldtrip package to analyse a data from Neuromag 306 channel device (actually, I only have the 204 gradiometer channels). However, I do not have access to the fif-files, so standard approach using Fieltrip does not work. I have the following information: - data file (as a matrix in MATLAB) - the channel locations (in VVchs_flat.txt, 2D or VVchs.txt, 3D) Based on this information, is it possible to use the Fieldtrip package for subsequent analysis? What information do I need to specify, before I can for instance, plot fields on certain time locations, using topoplotER? --------------------------------------------------------------------------- D. Sc. (Tech) Jaakko Särelä Helsinki University of Technology Laboratory of Computer and Information Science P.O. Box 5400, FIN-02015 HUT, Finland http://www.cis.hut.fi/jaakkos Tel: +358-9-451 4896; Fax: +358-9-451 3277; Email: jaakko.sarela at hut.fi --------------------------------------------------------------------------- From thomas.koelewijn at FCDONDERS.RU.NL Mon Mar 13 13:51:50 2006 From: thomas.koelewijn at FCDONDERS.RU.NL (Thomas Koelewijn) Date: Mon, 13 Mar 2006 13:51:50 +0100 Subject: topoplotER Message-ID: Dear fieldtrippers, I’m trying to use a half year old plot script to plot some new data, but it doesn’t do the trick anymore. Some changes seem to be made in the topoplotER function but I can’t figure out how to cope with them. My data set: label: {152x1 cell} fsample: 600 avg: [152x601 double] var: [152x601 double] time: [1x601 double] individual: [12x152x601 double] dimord: 'subj_chan_time' cfg: [1x1 struct] grad: [1x1 struct] My script cfg = []; cfg.colorbar='no'; cfg.xlim = [0.0:0.1:0.5]; cfg.showzlim = 'no'; cfg.layout = 'ctf151s.lay'; cfg.zlim = [-1.5e-14 1.5e-14]; a = figure ('color',[1 1 1]); topoplotER(cfg,O_GavgLRF_C); what is going wrong? Thomas From Jan.Schoffelen at FCDONDERS.RU.NL Mon Mar 13 14:35:17 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Mon, 13 Mar 2006 14:35:17 +0100 Subject: topoplotER In-Reply-To: Message-ID: Hi Thomas, Could you be a bit more specific? JM -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Thomas Koelewijn Sent: Monday, March 13, 2006 1:52 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] topoplotER Dear fieldtrippers, I'm trying to use a half year old plot script to plot some new data, but it doesn't do the trick anymore. Some changes seem to be made in the topoplotER function but I can't figure out how to cope with them. My data set: label: {152x1 cell} fsample: 600 avg: [152x601 double] var: [152x601 double] time: [1x601 double] individual: [12x152x601 double] dimord: 'subj_chan_time' cfg: [1x1 struct] grad: [1x1 struct] My script cfg = []; cfg.colorbar='no'; cfg.xlim = [0.0:0.1:0.5]; cfg.showzlim = 'no'; cfg.layout = 'ctf151s.lay'; cfg.zlim = [-1.5e-14 1.5e-14]; a = figure ('color',[1 1 1]); topoplotER(cfg,O_GavgLRF_C); what is going wrong? Thomas From marie at PSY.GLA.AC.UK Mon Mar 13 16:35:14 2006 From: marie at PSY.GLA.AC.UK (Marie Smith) Date: Mon, 13 Mar 2006 15:35:14 +0000 Subject: read_ctf_mri In-Reply-To: Message-ID: Hi, I am trying to load CTF .mri files using the read_ctf_mri function. The function fails when the reshape function is called. Having checked the contents of mri at this point they do not total 256*256*256 elements, but some smaller number (256*256*255.39). Could anyone suggest why this would be the case? Thanks, Marie Smith %%% Error message To RESHAPE the number of elements must not change. Error in ==> read_ctf_mri at 103 mri = reshape(mri, [256 256 256]); From tomh at KURAGE.NIMH.NIH.GOV Mon Mar 13 16:42:43 2006 From: tomh at KURAGE.NIMH.NIH.GOV (Tom Holroyd (NIH/NIMH) [E]) Date: Mon, 13 Mar 2006 10:42:43 -0500 Subject: read_ctf_mri In-Reply-To: <04D6A9B6-47AC-4901-8E1C-B9859C002965@psy.gla.ac.uk> Message-ID: Is it a newer format .mri file? They can have a variable length. If you look in the File menu there's a place where you can re-save it as a v2 format file which is flat. Marie Smith wrote: > Hi, > > I am trying to load CTF .mri files using the read_ctf_mri function. The > function fails when the reshape function is called. Having checked the > contents of mri at this point they do not total 256*256*256 elements, > but some smaller number (256*256*255.39). Could anyone suggest why this > would be the case? > > Thanks, > > Marie Smith > > %%% Error message > To RESHAPE the number of elements must not change. > > Error in ==> read_ctf_mri at 103 > mri = reshape(mri, [256 256 256]); > -- Tom Holroyd, Ph.D. "If you have to ask, I'm not telling you." -- Classic female answer to a question. From r.oostenveld at FCDONDERS.RU.NL Mon Mar 13 20:45:46 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 13 Mar 2006 20:45:46 +0100 Subject: Problem using .eeg-files In-Reply-To: Message-ID: Hi Carina, What kind of file is the *.eeg that you mention? Is it Neuroscan or EEProbe? Both should be supported, however, today I did notice a bug in code for neuroscan *.eeg files. Regarding the configuration. The "xxx.ds" directory is special for CTF MEG data, and contains a whole bunch of files (e.g. a seperate header and data file, and other files containing the marker events). If you want to run the tutorial, you should download the demo data from teh ftp server. In your case you should not make a xxx.ds directopry, but instead specify cfg.datafile = 'Ken_data.eeg' cfg.headerfile = 'Ken_data.eeg' since the data and header information are both in the same file. Furthermore, the cfg3.trialdef.includeTrigger = 3; cfg3.trialdef.excludeConditions = {'BAD'}; are also specific for CTF. You should read eth help of DEFINETRIAL, specifically the cfg.trialdef.eventtype = '?' will be of interest (since it shows you what you can actually use). best Robert On 13 Mar 2006, at 0:53, Carina Graversen wrote: > Hi. I just downloaded the Fieldtrip program to use it for my thesis > as biomedical engineering, and I'm now trying to use it on a .eeg- > file, which causes some problems for me. I have created the > directory Ken_data.ds where I have the file Ken_data.eeg. I use the > following configuration (taken from the tutorial and previous > answers from this forum): cfg3 = []; cfg3.dataset = 'Ken_test.ds'; > cfg3.trialdef.includeTrigger = 3; cfg3.trialdef.excludeConditions = > {'BAD'}; cfg3.blc = 'yes'; cfg3.blcwindow = [-0.2 0]; cfg3.lpfilter > = 'yes'; cfg3.lpfreq = 35; cfg3.padding = 0; cfg3.datafile = > 'Ken_test.eeg'; cfg3.headerfile = 'Ken_test.eeg'; cfg3.channel = > 'all'; I then call the preprocessing function: dataFIC = > preprocessing(cfg3); Unfortunately I get the following errors: > Warning: could not determine filetype of Ken_test.ds\Ken_test.meg4 > > In fieldtrip-20060306\private\filetype at 524 In definetrial at > 109 In preprocessing at 270 evaluating trialfunction > 'trialfun_ctf_epoched' ??? Error using ==> fieldtrip-20060306 > \private\read_ctf_meg4 could not open datafile Which I guess means > that I haven't used the correct configuration, since the program is > searching for a .meg4-file. I hope someone can help me by giving > the correct configuration when working on .eeg-files :o). Thanks in > advance. Regards, Carina Graversen Aalborg University, Denmark From r.oostenveld at FCDONDERS.RU.NL Mon Mar 13 20:51:11 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 13 Mar 2006 20:51:11 +0100 Subject: plotting In-Reply-To: Message-ID: Hi Punita There is no 3D plotting function, i.e. one that would assume that the head is a surface in 3D space, and which would require to rotate the head to get a full view of the sides. But there are plotting functions for scalp topographies which assume that you have projected the electrode locations on a 2D plane (i.e. a top view). They use layout files (see for an example the *.lay files, they are plain ascii). Alternatively, you can use the topoplot() function, which either uses a layout file or which also allows you to specify the x,y positions and the potential values at each site. best Robert PS if you do want to plot your x/y/z/v data in 3D and be able to rotate, you can use the undocumented and unsupported private/triplot function. You should then copy it from the private folder into fieldtip main. You then would do >> triplot([x y z], [], v) On 13 Mar 2006, at 6:48, Punita wrote: > Hello, > I am new to this group. I was just wondering if there was a simple > method > in fieldtrip that would allow me to plot surface potential data on a > spherical head surface. As for my data - I have 3 arrays > containing the x, > y, and z coordinates on the surface of the head, and a 4th array that > contains values of the potentials at these specified locations. > Any help or pointers would be deeply appreciated. > Thank you, > Punita > From r.oostenveld at FCDONDERS.RU.NL Mon Mar 13 21:05:15 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 13 Mar 2006 21:05:15 +0100 Subject: Neuromag specifications in Fieldtrip In-Reply-To: <20060313092641.GB10085@mail.cis.hut.fi> Message-ID: Hi Jaacko If you go to http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions and scroll down to "How can I import my own dataformat?", you can read the structure of the raw data format (i.e. the format that Jan-Mathijs mentioned at the end of his mail). In case yu want to topoplot: you should use the 2D locations and make a layout file (*.lay) for it. Please open one of the (plan ascii) layout files in a text editor (e.g. NM122.lay). With the data that you describe, you should be able to do all channel level analyses (but not source analyses, since that requires more information, like the location and orientation of all individual MEG coils). best Robert On 13 Mar 2006, at 10:26, Jaakko Sarela wrote: > Hi > > I'm trying to use the Fieldtrip package to analyse a data from > Neuromag 306 channel device (actually, I only have the 204 gradiometer > channels). > > However, I do not have access to the fif-files, so standard approach > using Fieltrip does not work. I have the following information: > - data file (as a matrix in MATLAB) > - the channel locations (in VVchs_flat.txt, 2D or VVchs.txt, 3D) > > Based on this information, is it possible to use the Fieldtrip package > for subsequent analysis? What information do I need to specify, > before I > can for instance, plot fields on certain time locations, using > topoplotER? From d.talsma at PSY.VU.NL Tue Mar 14 11:48:27 2006 From: d.talsma at PSY.VU.NL (Durk Talsma) Date: Tue, 14 Mar 2006 11:48:27 +0100 Subject: Missing 'elec' field when reading neuroscan CNT files? Message-ID: Hi Folks, I just ran into the following issue. For an ongoing EEG project, which was originally stored in neuroscan CNT files, I'm trying to set up a clusterrandanalysis. The analysis doesn't run, because the input data struct is expected to have an 'elec' field (in order to compute the neighbouring channels). Just looking at some CTF MEG data, I saw that these data structs do contain the (for these puposes) equivalent 'grad' field, consisting of the following data members: grad.pnt grad.ori grad.tra grad.label grad.units I suspect that elec will be similar, but which fields are required? I suspect pnt, tra, label, and unit. Assuming this is correct, I have the following questions: In what coordinate system is elec.pnt specified? (Cartesian, polar? Which reference frame?) What is the meaning of the tra field? Cheers, Durk From r.oostenveld at FCDONDERS.RU.NL Tue Mar 14 12:22:53 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Tue, 14 Mar 2006 12:22:53 +0100 Subject: Missing 'elec' field when reading neuroscan CNT files? In-Reply-To: <44169F7B.3010604@psy.vu.nl> Message-ID: Hi Durk On 14 Mar 2006, at 11:48, Durk Talsma wrote: > I just ran into the following issue. For an ongoing EEG project, > which was originally stored in neuroscan CNT files, I'm trying to > set up a clusterrandanalysis. The analysis doesn't run, because the > input data struct is expected to have an 'elec' field (in order to > compute the neighbouring channels). > > Just looking at some CTF MEG data, I saw that these data structs do > contain the (for these puposes) equivalent 'grad' field, consisting > of the following data members: > > grad.pnt > grad.ori > grad.tra > grad.label > grad.units > > I suspect that elec will be similar, but which fields are required? > I suspect pnt, tra, label, and unit. Assuming this is correct, I > have the following questions: See the documentation on http://www2.ru.nl/fcdonders/fieldtrip/ doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_are_electrodes _magnetometers_or_gradiometers_described and scroll down to "How are electrodes, magnetometers or gradiometers described?" You only need elec.pnt = Nchan x 3, with [x y z] elec.label = Nchan x 1 cell array with labels > In what coordinate system is elec.pnt specified? (Cartesian, polar? > Which reference frame?) The positions should be carthesian, and can be in any reference frame (head/polhemus/mri) and in any units. Whether channels are neighbours or not will be the same in any reference frame, so that is why that does not matter. Better not use elec.units, since that is not consistently supported throughout FieldTrip and probably does not do anything. In clusterrandanalysis you furthermore can specify cfg.neighbourdist = distance in the same units as above See also read_fcdc_elec (esp look into the code), which might help you to get an elec structure for your data. You can also manually construct a neighbourhood structure using cfg.neighbours (in that case fieldtrip does not need the elec strucure), that is explained in the help of clusterrandanalysis. > What is the meaning of the tra field? It is only for MEG, and it is the linear transformation matrix from the field at each coil to the field at each channel. Gradiometer channels have 2 coils, so think of a forward model for all coils that contains (2*151)x3 fT values, a grad.tra=[eye(151) -eye(151)] and aforward model for all channels that contains 151x3 fT values (the 3 is because of the three dipole orientations). Robert From r.oostenveld at FCDONDERS.RU.NL Thu Mar 16 15:36:05 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 16 Mar 2006 15:36:05 +0100 Subject: fieldtrip version 0.9.7 released Message-ID: Dear Fieldtrip users, This week the "Toolkit of Cognitive Neuroscience: advanced data analysis and source modelling of EEG and MEG data" course has been given at the F.C. Donders Centre. During the course, the Fieldtrip toolbox has been used in the tutorial hands-on sessions. For the course we have made a new release of the fieldtrip toolbox: version 0.9.7. All the up-to-date tutorials (which are available from http:// www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:tutorial) have been tested and are known to work with this release version. If you wish, you can upgrade to this stable release version. Preferably, you should always use the daily released version, since that will always contain the latest enhancements. The fieldtrip toolbox 0.9.7 and the daily release versions are available from the homepage (http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:download) or directly from the ftp server (ftp:// ftp.fcdonders.nl/pub/fieldtrip). best regards ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From Brian.Roach at YALE.EDU Thu Mar 16 18:57:51 2006 From: Brian.Roach at YALE.EDU (Brian Roach) Date: Thu, 16 Mar 2006 12:57:51 -0500 Subject: new user questions Message-ID: Hi, I am very new to Fieldtrip, and I have a pretty basic question about loading data to process - how do I do it? Looking at example code and the tutorials, it seems like I need to have a .ds file that contains my data. I am able to load .cnt and brain vision analyzer data successfully with their related functions, but how do I then assign that data to a .ds file? If there is documentation for this that I have missed, please point me to it. Also - what kind of interpolation would the topoPlot function use for EEG data (spherical or based on a 3-d head model)? Thank you! Brian From shahink at U.WASHINGTON.EDU Fri Mar 17 01:57:31 2006 From: shahink at U.WASHINGTON.EDU (Shahin Hakimian) Date: Fri, 17 Mar 2006 01:57:31 +0100 Subject: Help a novice with EEGlab2fieldtrip() Message-ID: Hello, Please excuse my ignorance. When I tried to transfer data from EEGLab to Fieldtrip using the function above, the procedure initially seemed to work. Later, however, preprocessing of the same dataset failed since the header was not there. Am I doing something wrong? Does the EEGlab2fieldtrip automatically fill in the header fields? Thanks From Jan.Schoffelen at FCDONDERS.RU.NL Fri Mar 17 09:40:50 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Fri, 17 Mar 2006 09:40:50 +0100 Subject: new user questions In-Reply-To: <6.1.2.0.2.20060316125317.01b1ed10@email.med.yale.edu> Message-ID: Dear Brian, Please have a look at the fieldtrip website. When you go to the documentation part and then to the frequently asked questions, you'll find everything you want to know. Fieldtrip supports several data-formats, including neuroscan data. The .ds data-format is the one we have on our MEG-system. So there is no need to do complicated stuff with your own data. The interpolation for the plotting is just a linear or spline interpolation of the surface-data. Yours, Jan-Mathijs -----Original Message----- From: FieldTrip discussion list [mailto:FIELDTRIP at NIC.SURFNET.NL] On Behalf Of Brian Roach Sent: Thursday, March 16, 2006 6:58 PM To: FIELDTRIP at NIC.SURFNET.NL Subject: [FIELDTRIP] new user questions Hi, I am very new to Fieldtrip, and I have a pretty basic question about loading data to process - how do I do it? Looking at example code and the tutorials, it seems like I need to have a .ds file that contains my data. I am able to load .cnt and brain vision analyzer data successfully with their related functions, but how do I then assign that data to a .ds file? If there is documentation for this that I have missed, please point me to it. Also - what kind of interpolation would the topoPlot function use for EEG data (spherical or based on a 3-d head model)? Thank you! Brian From r.oostenveld at FCDONDERS.RU.NL Fri Mar 17 10:26:59 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Fri, 17 Mar 2006 10:26:59 +0100 Subject: Help a novice with EEGlab2fieldtrip() In-Reply-To: Message-ID: Dear Shakin The eeglab2fieldtrip function should be used if you have already done the preprocessing in EEGLAB. If you use eeglab2fieldtrip, you do not have to use preprocessing. The EEG structure from EEGLAB contains all data, whereas in Fieldtrip we work with one data object at a time (i.e. raw data is a data object which normally would result from the preprocessing function). I.e. you can do data = eeglab2fieldtrip(EEG, 'preprocessing') and get the preprocessed raw data, or timelock = eeglab2fieldtrip(EEG, 'timelockanalysis') to get the averaged ERP, or comp = eeglab2fieldtrip(EEG, 'componentanalysis') to get the component topographies and activations. best regards, Robert ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Robert Oostenveld, PhD F.C. Donders Centre for Cognitive Neuroimaging Radboud University Nijmegen phone: +31-24-3619695 http://www.ru.nl/fcdonders/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On 17 Mar 2006, at 1:57, Shahin Hakimian wrote: > Please excuse my ignorance. When I tried to transfer data from > EEGLab to > Fieldtrip using the function above, the procedure initially seemed > to work. > Later, however, preprocessing of the same dataset failed since the > header > was not there. Am I doing something wrong? Does the EEGlab2fieldtrip > automatically fill in the header fields? > Thanks > From cgra05 at HST.AUC.DK Thu Mar 23 11:24:49 2006 From: cgra05 at HST.AUC.DK (Carina Graversen) Date: Thu, 23 Mar 2006 11:24:49 +0100 Subject: problems using multiplotTFR for eeg-files. In-Reply-To: <6EA6DC7F-A7D4-4BAB-B2AB-7BF4D6845EA8@fcdonders.ru.nl> Message-ID: Hi. I'm trying to use the wavelet code for an .eeg-file, but unfortunately I run into problems when I try to plot the results. The error I get is a lot of the following messages: Warning: Divide by zero. > In fieldtrip-20060306\private\nan_mean at 57 In freqbaseline>TFabschange at 201 In freqbaseline at 109 In multiplotTFR at 142 reading layout from file CTF151.lay Warning: Divide by zero. > In mean at 31 In multiplotTFR at 251 I use the following commands: % ************************************************************************* % EVENTRELATEDAVERAGING % ************************************************************************* cfg1 = []; cfg1.datafile = 'Ken_test.eeg'; cfg1.headerfile = 'Ken_test.eeg'; cfg1.channel = 'all'; dataFIC = preprocessing(cfg1); % Preprocess! cfg2 = []; avgFIC = timelockanalysis(cfg2, dataFIC); % ************************************************************************* % WAVELET % ************************************************************************* cfg7 = []; cfg7.output = 'pow'; cfg7.method = 'wltconvol' cfg7.foi = 1:2:30; cfg7.t_ftimwin = 5./cfg7.foi; cfg7.tapsmofrq = 0.4 *cfg7.foi; cfg7.toi = -0.5:0.05:1.5; TFRmult = freqanalysis(cfg7, dataFIC); cfg8 = []; cfg8.baseline = [-0.5 -0.1]; cfg8.zlim = [-3e-27 3e-27]; cfg8.showlabels = 'yes'; cfg8.layout = 'CTF151.lay'; multiplotTFR(cfg8, TFRmult); Can anyone give me a clue on what I'm doing wrong ??? Best Regards, Carina Graversen From Jan.Schoffelen at FCDONDERS.RU.NL Thu Mar 23 12:09:58 2006 From: Jan.Schoffelen at FCDONDERS.RU.NL (Jan Mathijs Schoffelen) Date: Thu, 23 Mar 2006 12:09:58 +0100 Subject: problems using multiplotTFR for eeg-files. In-Reply-To: Message-ID: Dear Carina, cfg8.layout = 'CTF151.lay'; This is incorrect. The cfg.layout field specifies for the plotting function, how to interpret the input-data. With this configuration fieldtrip expects that your input data consists of data obtained with the 151-gradiometer CTF system. Please have a look at the help of multiplotTFR, in which it is explained how to deal with the cfg.layout field. Yours, Jan-Mathijs From r.oostenveld at FCDONDERS.RU.NL Thu Mar 23 13:25:57 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Thu, 23 Mar 2006 13:25:57 +0100 Subject: problems using multiplotTFR for eeg-files. In-Reply-To: Message-ID: Hi Carina, Here is another clue: > Warning: Divide by zero. >> In fieldtrip-20060306\private\nan_mean at 57 > In freqbaseline>TFabschange at 201 > In freqbaseline at 109 > In multiplotTFR at 142 These warnings indicate that the specified baseline period does not contain any power, which is due to the wavelet being too long. I suggest to start with plotting a single TFR without any baseline correction, using the standard matlab function imagesc. Then you can see at which latency the power starts to be real-valued (insted of nans, which indicate that the wavelet is not yet completely inside the data). Robert From will.51 at OSU.EDU Sun Mar 26 05:19:16 2006 From: will.51 at OSU.EDU (Udo Will) Date: Sat, 25 Mar 2006 21:19:16 -0600 Subject: average intertrial phase coherence Message-ID: Hi I wonder if there is a fieldtrip function that calculates 1) average intertrial phasecoherence for a set of frequencies at individual electrode locations, and 2) the timedevelopment of this intertrial phasecoherence (i.e a time/phase plot). Regards Udo Will From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 13:25:12 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 13:25:12 +0200 Subject: average intertrial phase coherence In-Reply-To: <44260834.6000802@osu.edu> Message-ID: Dear Udo, That is not implemented yet, but it is easy to compute yourself. You should do freqanalysis with method=mtmfft (for 1) or method=mtmconvol (for 2) and output=fourier, which also implies keeptaper=yes and keeptrial=yes. That results in the complex fourier representation of the data (in one large "ntrial X nchan X nfreq X ntime" array) , from which you can compute the ITC. I recommend not to use multitapering (=frequency smoothing) for the ITC, so in freqanalysis you should also specify taper=hanning (or another single taper of your choise). Even with taper=hanning, you are required to specify something as taper-smoothing-frequency (i.e. cfg.tapsmofrq), but that is neglected (the field needs to be present, but is not used). Best regards, Robert On 26 Mar 2006, at 5:19, Udo Will wrote: > Hi > > I wonder if there is a fieldtrip function that calculates 1) > average intertrial phasecoherence for a set of frequencies at > individual electrode locations, and 2) the timedevelopment of this > intertrial phasecoherence (i.e a time/phase plot). > > Regards > Udo Will > From litvak at TECHUNIX.TECHNION.AC.IL Mon Mar 27 15:15:30 2006 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Mon, 27 Mar 2006 15:15:30 +0200 Subject: LORETA to Fieldtrip In-Reply-To: <49442A5E-58F1-4A3B-84BA-0C7A60B0F21B@fcdonders.ru.nl> Message-ID: Hi Robert, I tried reading the SPM MRI file (single_subj_T1.mnc - is this the one you meant?) but in the grid variables there are just indices in the matrix. So how do I know the correspondence to LORETA voxels? Is there a way to put the MNI grid there? Thanks, Vladimir -----Original Message----- From: Robert Oostenveld [mailto:r.oostenveld at fcdonders.ru.nl] Sent: Monday, March 27, 2006 2:43 PM To: Vladimir Litvak Subject: Re: Clusterrandanalysis > The question is - can we build a gateway for reading LORETA files > in FT and > applying the same statistics as you use for the beamformer? > This > shouldn't be something very complicated I think. The only problem > is that > LORETA uses a grid of 2394 voxels which are only in the gray matter > (so > there are some holes there) and it would probably be necessary to > do some > smoothing. Also one must write a routine for transforming from > LORETA grid > to your grid (based on Tailarach coordinates of the voxels). I once started with implementing LORETA myself in sourceanalysis, but never finished it. I don't consider LORETA to be too interesting for MEG, although I do appreciate it's usefullness for EEG. I have been in contact a couple of times with Roberto Pasqual-Marqui, and he told me some of the details. LORETA is using plain SPM/MNI coordinates, which can also be used in FT. The holes can be dealt with in FT by specifying NaNs as source.avg.pow, [] as source.avg.mom, and by specifying the right source.inside and source.outside vector (those are indices specifying which voxels are inside the brain, or inside the gray matter if you wish). Writing a LORETA importer should be trivial, but I am not going to do it myself. Please point the grad student to http://www2.ru.nl/fcdonders/fieldtrip/doku.php? id=fieldtrip:documentation:frequently_asked_questions#how_is_anatomical_ functional_or_statistical_volume_data_described and tell him to use volume.inside and volume.outside to "fill" the non-gray matter so that the data fits into a 3D box. Also do addpath spm2 volume = read_fcdc_mri(filename) with filename being the canonical MRI from SPM (the collin27 one). That should belp in getting it alligned with the proper transformation matrix. Once you can read a single LORETA volume into FT, then you can repeat it for all subjects and do your statistics. Please address further questions regarding this topic to the mailing list. Robert PS I don't think that you want to smooth, our source clustering is aware of the grey/white matter differences (given the correct inside/ outside specification). From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 21:28:58 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 21:28:58 +0200 Subject: LORETA to Fieldtrip In-Reply-To: <000001c651a0$8884a750$90514484@dellgx240> Message-ID: On 27 Mar 2006, at 16:51, Vladimir Litvak wrote: > I thought about this somewhat more and there are some things I > realized and > some new questions that came up: > > 1) Why do I need the Collin brain if I don't plot the results in > fieldtrip? > A much simpler way would be to create a grid according to the > maximal values > of coordinates in LORETA (there is a list). Then I don't need any > transforms > - I just fill this grid directly using the MNI coordinates (plus some > constant). Then after the analysis I can simply export the result > back to > LORETA. You can use the collin brain to learn how volumes are represented in FT (and in SPM for that matter): with the transformation matrix. Furthermore, you can map the LORETA data onto the collin brain to check whether you have interpreted the LORETA 3D array correctly. It could be that in LORETA part of the brain has been cut off, which would mess up the matching, that is something which you need to be aware of. Spatial clustering in FT requires that you specify the shape of the 3D array correctly. The best way of knowing that it is correct is by plotting it in FT. FT sourceplotting also has options for combining anatomy+functional+statistics in one display (using grey+color +tranparency). Why not ask around whether someone has read it into Matlab before. I suspect that there is a mailing list, or you can ask Roberto Pasqual- Marqui directly. > 2) Does sourcestatistics handle multiple timeframes i.e. does > clustering > both in time and in space the same way as with scalpmaps? If yes, > how do I > specify the input for this? I haven't tried yet but I suspect that > would be > a pretty heavy operation to run. No, sofar I have not implemented Xvox-Yvox-Zvox-freq-time clustering, only Xvox-Yvox-Zvox clustering. We typically do not look at multiple frequencies or latencies, since on the channel level we can already decide (channel statistics) which time-frequency "tile" is significant. Subsequently we use multitapering on exactly that time- frequency tile to capture the complete effect in one TF-bin (with the desired width in both dimensions) and beam that single bin. So the standard way to deal with source data is that it is 3-D only. Actually it would not be too hard to implement the clustering in 4-D or 5-D, although I have no idea on the computational demands. I suspect it to be computationally feasible, since it uses the Matlab image processing toolbox, which is very efficient. For your LORETA data, the 4-D clustering does seem to be interesting so I could look at implementing it for N-D. The channel clustering is much more difficult, since the channel locations do not "code" a nice natural dimension in the data but they have a weird neighbourhood structure. Robert From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 21:52:16 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 21:52:16 +0200 Subject: COEFS In-Reply-To: <6.2.3.4.0.20060327200856.01da0858@193.62.66.20> Message-ID: Hi James. On 27 Mar 2006, at 21:14, James Kilner wrote: > I am trying to understand how one forms synthetic gradiometers from > the MEG data. I spoke to CTF about this sometime ago and they told > me that the raw data is recorded with whatever gradiometer settings > you choose but I wanted to check this. Do you use the coefs (as > defined in ctf_read_meg4) in your latest release? Do you already > have functions to change the order of the gradiometers? No, we are still using our own read_ctf_res4 without the coefs. I know that the raw data in the meg4 file can be stored in different formats, i.e. with or without the coefs being applied. Furthermore, there is also the option in CTF to only store the flag in the processing params file, whereby DataEditor remembers it the next time that you open the dataset (but the data in teh meg4 itself is not touched). The coefs can always be undone, which means that there should be a flag in the res4 header specifying whether the coefs have been applied or not. I am working on a redesign of the reading functions, which will also clear up the low-level functions: currently the mix between read_ctf_res4 and ctf_read_res4 is kind of vague. Furthermore, I have some synthetic gradient code that I would not mind sharing with you, but it requires testing and tighter integration with FT. I already want to add support for the synthetic gradients for quite some time now, but am lacking the time to implement it myself (and the MEG site in Nijmegen is relatively noise-free). I can point you to the right spots in the FT code, conceptually it is not too complex. best regards, Robert PS I just replied to your download mail before I noticed this mail in my inbox. I moved this mail over to the discussion list, since I think that it is also relevant for the other CTF users. From r.oostenveld at FCDONDERS.RU.NL Mon Mar 27 22:14:10 2006 From: r.oostenveld at FCDONDERS.RU.NL (Robert Oostenveld) Date: Mon, 27 Mar 2006 22:14:10 +0200 Subject: LORETA to fieldtrip In-Reply-To: <000001c651bd$8288a5a0$90514484@dellgx240> Message-ID: Hi Vladimir On 27 Mar 2006, at 18:42, Vladimir Litvak wrote: > I tried to do some simple calculation and it doesn't look good. The > size of > a box defined by MNI coordinates used in LORETA is 141x166x116. > Even in > single precision it takes 10 Mb. In order to do the analysis I > can't do in > LORETA (regression) I need to store 4 conditions for 10 subjects. > That gives > us 400Mb per time frame. Yes, I can follow the math (141x166x11 x 4bytes x 4conditions x 10subjects = 400MB). That means that for 20 timepoints (assuming some temporal downsampling and selection of a latency window of interest) that you need 8GB RAM just to hold the data. If you could a-priory identy a time-window of interest, then you could average over that time-window, limiting the analysis to a single 400MB. Alternatively, you could spatially downsample with a factor of 2x2x2 (using the DOWNSAMPLEVOLUME function), which would result in the data fitting in 1GB of RAM. After identifying the time of interest in this spatially downsampled volume, you could again go to the full resolution volume and only work on the (average) time of interest to localize the effect in that timewindow. > We had an idea here to solve this but I'm not sure it's > statistically sound. > The idea is to do the analysis for each timeframe separately and > then look > for clusters continuous in time and compare them to what you would > get with > reshuffled timeframes. The problem is that the null hypothesis in > the second > step is not the same as in the first step. What do you think? Yyou cannot give an unambigous interpretation of the probability that you are getting out of the second step. The hypothesis of interest is not on the timecourses (which will have a natural autocorrelation that of course will be destroyed by the shuffling), but on the data in the different conditions. As far as I can tell, shuffling the timewindows does not correspond with a hypothesis that relates in a meaningfull way to the data taht you observed in the 4 conditions. > In any case, I can define some segments to average if there is no > choice. Furthermore, applying some Bonferoni correction for the multiple time frames should not be too much of a problem. ALternatively, you can do a massive univariate test on chuncks of the data (clustering only in time and not in space), store the probabilities per voxel, and use the false discovery rate method for multiple comparison correction. I have code for FDR (but not in FT yet). The idea in pseudocode would be for slice=1:116 read 10x4 slices, each with 141x166 voxels do statistics on each slice, without multiple comparison correction over voxels, but with correction over timepoints: that gives you an interpretable probability per voxel. save the probabilities end for all slices, read all voxel probabilities and apply FDR to control for the expected proportion of false alarms over all voxels best regards, Robert From arno at SALK.EDU Tue Mar 28 12:05:43 2006 From: arno at SALK.EDU (arno) Date: Tue, 28 Mar 2006 12:05:43 +0200 Subject: LORETA to Fieldtrip In-Reply-To: <72073E3B-32D0-4A02-8A96-4E9532E1D4FD@fcdonders.ru.nl> Message-ID: > Spatial clustering in FT requires that you specify the shape of the 3D > array correctly. The best way of knowing that it is correct is by > plotting it in FT. FT sourceplotting also has options for combining > anatomy+functional+statistics in one display (using > grey+color+tranparency). > > Why not ask around whether someone has read it into Matlab before. I > suspect that there is a mailing list, or you can ask Roberto > Pasqual-Marqui directly. I do have a function to read LORETA results under Matlab and overlay them onto a custom MRI file (normalized to the MNI brain using SPM2 for example; MRI files can be read with the fieldtrip function read_fcdc_mri). The attached file LORETAtalairach.xyz is part of the LORETA distribution and contain the MNI coordinates of the LORETA voxels. Arno >> 2) Does sourcestatistics handle multiple timeframes i.e. does clustering >> both in time and in space the same way as with scalpmaps? If yes, how >> do I >> specify the input for this? I haven't tried yet but I suspect that >> would be >> a pretty heavy operation to run. > > No, sofar I have not implemented Xvox-Yvox-Zvox-freq-time clustering, > only Xvox-Yvox-Zvox clustering. We typically do not look at multiple > frequencies or latencies, since on the channel level we can already > decide (channel statistics) which time-frequency "tile" is > significant. Subsequently we use multitapering on exactly that > time-frequency tile to capture the complete effect in one TF-bin (with > the desired width in both dimensions) and beam that single bin. So the > standard way to deal with source data is that it is 3-D only. Actually > it would not be too hard to implement the clustering in 4-D or 5-D, > although I have no idea on the computational demands. I suspect it to > be computationally feasible, since it uses the Matlab image processing > toolbox, which is very efficient. For your LORETA data, the 4-D > clustering does seem to be interesting so I could look at implementing > it for N-D. The channel clustering is much more difficult, since the > channel locations do not "code" a nice natural dimension in the data > but they have a weird neighbourhood structure. > > Robert > > -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: loreta_importcomp.m URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: LORETAtalairach.xyz URL: From litvak at TECHUNIX.TECHNION.AC.IL Wed Mar 29 18:36:23 2006 From: litvak at TECHUNIX.TECHNION.AC.IL (Vladimir Litvak) Date: Wed, 29 Mar 2006 18:36:23 +0200 Subject: LORETA to fieldtrip In-Reply-To: Message-ID: Hi again, I made some progress with loreta2fieldtrip function. It supports both the new sLORETA and the old LORETA format. I had to prepare two resampled MRI scans of Collin to match to each kind of LORETA file. I attach the function, these scans, the index file that is necessary for the conversion and two example files for LORETA and for sLORETA. To test the function you should run: volume=loreta2fieldtrip('test.slor', 1); volume=loreta2fieldtrip('test.lorb', 1); Now I would like you to help me finalize this function to produce something suitable for statitistical analysis. As I said yesterday with the sizes I actually got it shouldn't be a problem to run time-space test. It's probably not necessary to include the anatomy in every volume so the final function should have this as an option. Also I'm not sure whether avg.pow is the right place to put the functional data in this case. Another issue is coordinate system. What I understood from Roberto is that his MNI coordinates correspond to voxels in the original not downsampled Collin scan (such as the one I sent you before). The origin is [91 127 73]. The lCollin was obtained by downsampling the original Collin with (4:7:end, 4:7:end, 4:7:end) and the slCollin with (1:5:end, 2:5:end, 3:5:end). So if it is necessary to store the MNI coordinates or transformation matrix in the volume, please figure out how this should be done. Then I would appreciate an example of how to run for instance a dependent sample t-test on this data with your new statistics functions. What I really need to do is dependent samples regression with 4 conditions and up to 10 subjects. If this is possible with your present functions please send me an example as well. I hope that if I have these examples I'll be able to keep further developing them as I've been doing until now. If you want, you can include this loreta2fieldtrip extension in Fieldtrip after we finish polishing and testing it. Best, Vladimir -------------- next part -------------- A non-text attachment was scrubbed... Name: loreta2fieldtrip.zip Type: application/x-zip-compressed Size: 106645 bytes Desc: not available URL: