From Hahn at psych.uni-frankfurt.de Sat Nov 1 11:27:49 2014 From: Hahn at psych.uni-frankfurt.de (Tim Hahn) Date: Sat, 01 Nov 2014 11:27:49 +0100 Subject: [FieldTrip] channel time series from simulated brain data Message-ID: <5454B5A5.5080408@psych.uni-frankfurt.de> Dear all, I simulated neural dynamics. Now, I'd like to compare it to my EEG data. To generate scalp maps (i.e. time series at each channel) from my simulation, I would need to put my simulated data into a forward model if I understand correctly. How could I do this using fieldtrip? If I'm not mistaken, I need to generate a lead-field matrix to "project" my simulated brain data onto the channel locations. Unfortunately, all examples need individual MRI data to build the model whereas I simply modeled my data in MNI space in the first place and thus don't have MRI data (nor should I need it in this case, I think). Thanks a lot for your help. Cheers, Tim From tzvetan.popov at uni-konstanz.de Sat Nov 1 13:00:53 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Sat, 1 Nov 2014 13:00:53 +0100 Subject: [FieldTrip] channel time series from simulated brain data In-Reply-To: <5454B5A5.5080408@psych.uni-frankfurt.de> References: <5454B5A5.5080408@psych.uni-frankfurt.de> Message-ID: <9953AEC7-A11C-404F-8644-DC0452EDFFCE@uni-konstanz.de> Dear Tim, you might have a look here: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit and also at this post http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008482.html good luck, tzvetan > Dear all, > I simulated neural dynamics. Now, I'd like to compare it to my EEG data. To generate scalp maps (i.e. time series at each channel) from my simulation, I would need to put my simulated data into a forward model if I understand correctly. How could I do this using fieldtrip? If I'm not mistaken, I need to generate a lead-field matrix to "project" my simulated brain data onto the channel locations. Unfortunately, all examples need individual MRI data to build the model whereas I simply modeled my data in MNI space in the first place and thus don't have MRI data (nor should I need it in this case, I think). > Thanks a lot for your help. > Cheers, > Tim > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eh776 at york.ac.uk Mon Nov 3 12:04:17 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Mon, 3 Nov 2014 11:04:17 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Hi Nietzsche, That's much clearer--thanks for your help. It seems as though I should have entered my sources estimates into data.pow.avg rather than data.avg. However, I am still getting an error. My data is structured: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.pow.avg = [902629 x 11 double] % source estimates When I try: grandavgA = ft_sourcegrandaverage(cfg, data{:}); I get the error message: ??? Error using ==> ft_checkdata>fixsource at 1259 the input does not contain an avg or trial field Error in ==> ft_checkdata at 650 data = fixsource(data, 'type', sourcerepresentation); Error in ==> ft_sourcegrandaverage at 107 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); It appears as though the function is searching for a data{i}.avg or data{i}.trial field. What data should these fields contain? The wiki (http://fieldtrip.fcdonders.nl/reference/ft_datatype_source) seems to state that these are "historical" fields, although I have updated to fieldtrip-20141030 (the same error also occurs with older versions) Best, Emma On 31 October 2014 16:02, Lam, N.H.L. (Nietzsche) wrote: > Hi Emma, > > In this part: > ??? Undefined function or method 'fieldnames' for input arguments of >type 'double'. > > > Error in ==> parameterselection at 47 > tmp = fieldnames(data.avg); > > it says that the function 'fieldnames' doesn't know how to deal with data that is of the type > double. This is because fieldnames expects your data to be in the format of a struct. I'm > guessing there was just an error in your implementation because from your message you > understood that "input data to ft_sourcegrandaverage contains a cell array of structures -- ones > for each participant. Furthermore, you need to put your source estimates in data.pow.avg. > > Based on your description, you might try something like this (but it's not guaranteed to work > because I'm not entirely sure about the details of your data) > > data.pos = [902629x3 double] > data.dim = [91 109 91] > data.time = [1 x Z double] % vector of time points > data.pow.avg = [902629 x time points] % source estimates (or potentially voxel x frequency > x time points, depending on your data). > > As a side note, the size of your data will be quite taxing on computational memory so you > might also want to consider using a lower spatial resolution. > > Finally, in the future, when describing your data, it would be best to show the structure of your > data as shown in matlab (as done above), because this makes it easier for everyone else to > see what you've done. Please check this FAQ for more details http://fieldtrip.fcdonders.nl/ > faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/ > how_to_ask_good_questions_to_the_community > > Best, > Nietzsche -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Nov 3 12:35:55 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 3 Nov 2014 12:35:55 +0100 (CET) Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: References: Message-ID: <075001cff75a$5487d8a0$fd9789e0$@vanpelt@fcdonders.ru.nl> Hi Emma, Try using data{i}.avg.pow instead of data{i}.pow.avg (or use cfg.funparameter = 'pow.avg' instead of cfg.funparameter = 'avg.pow') Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Emma Holmes Sent: maandag 3 november 2014 12:04 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Hi Nietzsche, That's much clearer--thanks for your help. It seems as though I should have entered my sources estimates into data.pow.avg rather than data.avg. However, I am still getting an error. My data is structured: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.pow.avg = [902629 x 11 double] % source estimates When I try: grandavgA = ft_sourcegrandaverage(cfg, data{:}); I get the error message: ??? Error using ==> ft_checkdata>fixsource at 1259 the input does not contain an avg or trial field Error in ==> ft_checkdata at 650 data = fixsource(data, 'type', sourcerepresentation); Error in ==> ft_sourcegrandaverage at 107 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); It appears as though the function is searching for a data{i}.avg or data{i}.trial field. What data should these fields contain? The wiki (http://fieldtrip.fcdonders.nl/reference/ft_datatype_source) seems to state that these are "historical" fields, although I have updated to fieldtrip-20141030 (the same error also occurs with older versions) Best, Emma On 31 October 2014 16:02, Lam, N.H.L. (Nietzsche) wrote: > Hi Emma, > > In this part: > ??? Undefined function or method 'fieldnames' for input arguments of >type > 'double'. > > > Error in ==> parameterselection at 47 > tmp = fieldnames(data.avg); > > it says that the function 'fieldnames' doesn't know how to deal with data > that is of the type > double. This is because fieldnames expects your data to be in the format > of a struct. I'm > guessing there was just an error in your implementation because from your > message you > understood that "input data to ft_sourcegrandaverage contains a cell array > of structures -- ones > for each participant. Furthermore, you need to put your source estimates > in data.pow.avg. > > Based on your description, you might try something like this (but it's not > guaranteed to work > because I'm not entirely sure about the details of your data) > > data.pos = [902629x3 double] > data.dim = [91 109 91] > data.time = [1 x Z double] % vector of time points > data.pow.avg = [902629 x time points] % source estimates (or > potentially voxel x frequency > x time points, depending on your data). > > As a side note, the size of your data will be quite taxing on > computational memory so you > might also want to consider using a lower spatial resolution. > > Finally, in the future, when describing your data, it would be best to > show the structure of your > data as shown in matlab (as done above), because this makes it easier for > everyone else to > see what you've done. Please check this FAQ for more details > http://fieldtrip.fcdonders.nl/ > > faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/ > > how_to_ask_good_questions_to_the_community > > > Best, > Nietzsche -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Mon Nov 3 14:01:32 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Mon, 3 Nov 2014 13:01:32 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Hi Stan, Thanks for the suggestion. When I try that, I get the following error ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Error in ==> ft_sourcegrandaverage at 82 varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I am unsure why this occurs. My data is now structured in the following way: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.avg.pow = [902629 x 11 double] % source estimates The following is the method I use: cfg = []; cfg.keepindividual = 'yes'; cfg.parameter = 'pow'; grandavgA = ft_sourcegrandaverage(cfg, data{:}); Best, Emma On 31 October 2014 16:02, Stan van Pelt wrote: > Hi Emma, > > > > Try using data{i}.avg.pow instead of data{i}.pow.avg > > > > (or use cfg.funparameter = 'pow.avg' instead of cfg.funparameter = > 'avg.pow') > > > > Best, > > Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Mon Nov 3 16:24:31 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Mon, 3 Nov 2014 16:24:31 +0100 Subject: [FieldTrip] Radiological convention In-Reply-To: References: Message-ID: Hello, Please how I can flip the template MRI from Nuerological convention to radiological convention. Mercy Azeez A. Adebimpe "Knowledge and good manner, the beauty of a man" -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Nov 3 16:54:15 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 3 Nov 2014 16:54:15 +0100 (CET) Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: References: Message-ID: <07bb01cff77e$6b7a9790$426fc6b0$@vanpelt@fcdonders.ru.nl> Hi Emma, I am unfamiliar with this type of error. It seems however that you still have an inconsistency in your data. You define “data{i}.avg.pow”, but later on use “cfg.parameter = 'pow';”. You should change one of the two (e.g. use cfg.parameter = 'avg.pow';) Hope that helps. Stan From: Emma Holmes [mailto:eh776 at york.ac.uk] Sent: maandag 3 november 2014 14:02 To: fieldtrip at science.ru.nl Cc: s.vanpelt at fcdonders.ru.nl Subject: Spatio-temporal cluster-based permutation analysis on EEG sources Hi Stan, Thanks for the suggestion. When I try that, I get the following error ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Error in ==> ft_sourcegrandaverage at 82 varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I am unsure why this occurs. My data is now structured in the following way: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.avg.pow = [902629 x 11 double] % source estimates The following is the method I use: cfg = []; cfg.keepindividual = 'yes'; cfg.parameter = 'pow'; grandavgA = ft_sourcegrandaverage(cfg, data{:}); Best, Emma On 31 October 2014 16:02, Stan van Pelt wrote: > Hi Emma, > > > > Try using data{i}.avg.pow instead of data{i}.pow.avg > > > > (or use cfg.funparameter = 'pow.avg' instead of cfg.funparameter = > 'avg.pow') > > > > Best, > > Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Nov 3 17:27:57 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 3 Nov 2014 17:27:57 +0100 Subject: [FieldTrip] Radiological convention In-Reply-To: <4cf51038d81e4fdeba513bc77268f0d8@EXPRD01.hosting.ru.nl> References: <4cf51038d81e4fdeba513bc77268f0d8@EXPRD01.hosting.ru.nl> Message-ID: Hi Azeez, Have a look at the private (and hence untested for direct use by end-users) function /private/volumeflip.m . Best, Eelke On 3 November 2014 16:24, Azeez Adebimpe wrote: > > > Hello, > > Please how I can flip the template MRI from Nuerological convention to > radiological convention. > > Mercy > > Azeez A. Adebimpe > > > "Knowledge and good manner, the beauty of a man" From f.roux at bcbl.eu Tue Nov 4 11:59:18 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 4 Nov 2014 11:59:18 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <0d9c01cff523$322a09b0$967e1d10$@maris@psych.ru.nl> Message-ID: <537192336.3738792.1415098758947.JavaMail.root@bcbl.eu> Dear all, I would like to follow up on this, as I am currently struggling myself with the coding of the design matrix of my analysis. I have MEG data from n = 95 participants aged between 12 and 27 years on a WM-task with 3 WM-load conditions. I would like to investigate the effects of age (continuous variable ranging from 12 to 27) and WM-load (categorical variable ranging from 1-3) on delay-activity in different frequency-bands. What would be the correct way to perform such an analysis in fieldtrip? Would this be akin to a mixed-effects design? Best regards, Fred Frédéric Roux ----- Original Message ----- From: "Eric Maris" To: "FieldTrip discussion list" Sent: Friday, October 31, 2014 4:56:16 PM Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Dear Dylan, I replied to your question on the Fieldtrip faq page that you refer to. Although the problem can be solved, it is not implemented yet, because it requires the implementation of three new statfuns: Hotelling’s T-square for dependent samples, Hotelling’s T-square for independent samples, and Wilk’s lambda. A good statistics book (e.g., Johnson & Wichern) will show you how to do this yourself. Otherwise, you have to be patient. Although your statistical problem can be solved, with neurobiological data, it is almost never wise to statistically test interaction effects in designs more complicated than the 2-by-2 factorial design. In these more complicated designs, you always end up with F-tests, which do not inform you about the pattern in the data that is responsible for the interaction effect. Best, Eric From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] Sent: dinsdag 28 oktober 2014 13:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Thank you, Eelke. I'm sorry I am not picking this up more quickly. Your examples of passing either multiple structs or cell arrays to ft_freqstatistics deals with one group of subjects in multiple conditions, or two groups in one condition, respectively. I have two groups, both doing multiple (11) conditions and I would like to know how to handle that in ft_freqstatistics. What I require seems to be similar to what Eric Maris wrote about here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests but instead of a 2-by-2 factorial design, I am using a 2-by-11 factorial design. As such, I am not sure how this translates when making difference data structures. I hope I am not missing something obvious. Thanks again, Dylan On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > wrote: Dear Dylan, You don't want (or need) a single struct with a subj X chan X freq X time powspctrm. Instead, it is often convenient to collect each individual subject's struct in a *cell* array (rather than a struct array). See, for example, here: http://www.mathworks.nl/help/matlab/cell-arrays.html and here: http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ . At the statistics step you should pass in multiple structs, each one corresponding to one unit-of-observation, to ft_freqstatistics. This can be done like so: stat = ft_freqstatistics(cfg, struct11, struct12, struct13,...struct21, struct22, ...); or, using the cell arrays, like so: stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); Make sure that each column in your design matrix describes one unit-of-observation, in the order in which the structs are passed into ft_freqstatistics. Best, Eelke On 21 October 2014 03:41, Dylan DeLosAngeles < dylan.delosangeles at gmail.com > wrote: > Dear Eelke, > > Thank you for help regarding cluster-based permutation analysis of two or more conditions. > > I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum. > > My code below loads 12 subjects from the first group, but I end up with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x 3 frequencies x 2049 time points, rather than one struct with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x time points. > > for k = 1:Nmt, % states > for i = 1%:Ng, % groups > for j = 1:Ns, % subjects > > % load files > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > % convert to eeglab to get channel locations > EEG(j) = eeg2eeglab( p(j)); > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > % preprocessing in fieldtrip > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > % specify length of time to use in config > time = EEG(j).xmax-EEG(j).xmin; > > % setup configuration for freqanalysis > cfg = []; % clear cfg > cfg.output = 'pow'; > cfg.channel = 'EEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 0.5:3; % delta > cfg.toi = 1:0.05:time; % length of each state > cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > cfg.keeptrials = 'yes'; > > % do freqanalysis > freqdata(j) = ft_freqanalysis( cfg, d(j)); > end > end > end > > My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics. > > Lastly, I just want to confirm what you said in your previous email, that I should be using indepsamplesF for more than two conditions (I have 11), and therefore my design should look like this; > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > Any help would be appreciated. > > Kind regards, > Dylan > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < eelke.spaak at donders.ru.nl > wrote: > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > < dylan.delosangeles at gmail.com > wrote: >> Hello, >> >> So far, the tutorial on "Cluster-based permutation tests on time-frequency >> data" has been very helpful. >> >> Out of the four combinations from the two UO-types (subjects and trials) and >> the two experimental designs (between- and within-UO), the tutorial covers >> statistics on data in two conditions in a between-trials, in a within-trials >> and in a within-subjects design. However, I am wondering if there is any >> information about the fourth type of experiment design: between-subjects. >> >> I have data for 2 groups with 12 subjects in each group. Both groups are >> measured during 11 conditions. >> Can I approach this in a similar fashion to within-subjects design (multiple >> subjects in multiple experimental conditions), such that my design is >> multiple groups in multiple experimental conditions. Is it a case of first >> averaging over all trials belonging to each of the experimental conditions >> for each subject (as instructed in tutorial), and then averaging over all >> subjects in each group? >> >> Configuration code for setting up the design currently looks like this; >> grp = 2; >> subj = 11; >> design = zeros(2, subj*grp); >> >> for i = 1:grp >> design(1,i:2:end) = i; >> end >> >> idx = 1; >> for i = 1:subj >> design(2,idx:idx+1) = i; >> idx = idx+2; >> end >> >> Is there anything else I need to take into consideration when doing these >> statistics? >> >> Thank you, >> Dr Dylan DeLosAngeles >> Research Fellow >> Brain Signal Laboratory >> Flinders University >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.maris at psych.ru.nl Tue Nov 4 12:22:12 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 4 Nov 2014 12:22:12 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <537192336.3738792.1415098758947.JavaMail.root@bcbl.eu> References: <0d9c01cff523$322a09b0$967e1d10$@maris@psych.ru.nl> <537192336.3738792.1415098758947.JavaMail.root@bcbl.eu> Message-ID: <020d01cff821$91fab690$b5f023b0$@maris@psych.ru.nl> Hi Fred, What you ask can definitely be done in Fieldtrip. The analyses you need are very similar to those of Vladimir Litvak, for who I implemented the statfuns indepsamplesRegrT and depsamplesRegrT. To give you the recipe, I would have to go back to the code, because it is such a long time ago. Anyhow, you now know where to look, and I trust that you can get a long way yourself. Best, Eric Maris > -----Original Message----- > From: Frédéric Roux [mailto:f.roux at bcbl.eu] > Sent: dinsdag 4 november 2014 11:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > Dear all, > > I would like to follow up on this, as I am currently struggling > myself with the coding of the design matrix of my analysis. > > I have MEG data from n = 95 participants aged between 12 and 27 years > on a WM-task with 3 WM-load conditions. > > I would like to investigate the effects of age (continuous variable > ranging from 12 to 27) and WM-load (categorical variable ranging from > 1-3) on delay-activity in different frequency-bands. > > What would be the correct way to perform such an analysis in > fieldtrip? > > Would this be akin to a mixed-effects design? > > Best regards, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Eric Maris" > To: "FieldTrip discussion list" > Sent: Friday, October 31, 2014 4:56:16 PM > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > > > > > > Dear Dylan, > > > > I replied to your question on the Fieldtrip faq page that you refer > to. Although the problem can be solved, it is not implemented yet, > because it requires the implementation of three new statfuns: > Hotelling’s T-square for dependent samples, Hotelling’s T-square for > independent samples, and Wilk’s lambda. A good statistics book (e.g., > Johnson & Wichern) will show you how to do this yourself. Otherwise, > you have to be patient. > > > > Although your statistical problem can be solved, with neurobiological > data, it is almost never wise to statistically test interaction > effects in designs more complicated than the 2-by-2 factorial design. > In these more complicated designs, you always end up with F-tests, > which do not inform you about the pattern in the data that is > responsible for the interaction effect. > > > > Best, > > > > Eric > > > > > > > > > From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] > Sent: dinsdag 28 oktober 2014 13:22 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > > > > Thank you, Eelke. > I'm sorry I am not picking this up more quickly. > > > > > > Your examples of passing either multiple structs or cell arrays to > ft_freqstatistics deals with one group of subjects in multiple > conditions, or two groups in one condition, respectively. I have two > groups, both doing multiple (11) conditions and I would like to know > how to handle that in ft_freqstatistics. What I require seems to be > similar to what Eric Maris wrote about here: > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effec > t_using_cluster-based_permutation_tests > > > > > > but instead of a 2-by-2 factorial design, I am using a 2-by-11 > factorial design. As such, I am not sure how this translates when > making difference data structures. I hope I am not missing something > obvious. > > > > > > Thanks again, > > > Dylan > > > > > > On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > > wrote: > > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their- > contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one unit- > of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles < > dylan.delosangeles at gmail.com > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of > two or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up > with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 > electrodes x 3 frequencies x 2049 time points, rather than one struct > with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x > time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config time = > > EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis cfg = []; % clear cfg > > cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = > 1:0.05:time; > > % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end > > > > My second problem is loading in the second group of 12 subjects and > what that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous > email, > > that I should be using indepsamplesF for more than two conditions > (I > > have 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < > eelke.spaak at donders.ru.nl > > wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two > groups > > of observations, and not to the same group of observations measured > in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then > use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) > cell > > arrays, corresponding to the conditions, you can input them into > the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above > is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles < > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > >> time-frequency data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > >> trials) and the two experimental designs (between- and within-UO), > >> the tutorial covers statistics on data in two conditions in a > >> between-trials, in a within-trials and in a within-subjects > design. > >> However, I am wondering if there is any information about the > fourth type of experiment design: between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both > groups > >> are measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > >> (multiple subjects in multiple experimental conditions), such that > my > >> design is multiple groups in multiple experimental conditions. Is > it > >> a case of first averaging over all trials belonging to each of the > >> experimental conditions for each subject (as instructed in > tutorial), > >> and then averaging over all subjects in each group? > >> > >> Configuration code for setting up the design currently looks like > >> this; grp = 2; subj = 11; design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when > doing > >> these statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From f.roux at bcbl.eu Tue Nov 4 12:40:29 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 4 Nov 2014 12:40:29 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <020d01cff821$91fab690$b5f023b0$@maris@psych.ru.nl> Message-ID: <746608921.3739439.1415101229761.JavaMail.root@bcbl.eu> Hi Eric, thanks for getting back about this so quickly. This is very helpful. Do you think I could also combine depsamplesT with indepsamplesregrT? I was thinking to do something like this: % First test for the general effect of WM-load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'depsamplesT'; cfg.ivar = 1; cfg.uvar = 2; cfg.design = []; cfg.design(1,:) = [ones(1,length(dat3)) 2*ones(1,length(dat2))]; cfg.design(2,:) = [1:length(dat3) 1:length(dat2)]; [depT1] = ft_freqstatistics(cfg,dat3{:},dat2{:});% WM-load effect #1 cfg.design = []; cfg.design(1,:) = [ones(1,length(dat2)) 2*ones(1,length(dat1))]; cfg.design(2,:) = [1:length(dat2) 1:length(dat1)]; [depT2] = ft_freqstatistics(cfg,dat2{:},dat1{:});% WM-load effect #2 % Second test for the general effect of age in the data while controlling for load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'indepsamplesregrT'; cfg.ivar = 1; cfg.cvar = 2; cfg.design = []; cfg.design(1,:) = [Age Age Age]; cfg.design(2,:) = [ones(1,length(dat1)) 2*ones(1,length(dat2)) 3*ones(1,length(dat3))]; indepregT = ft_freqstatistics(cfg,dat1{:},dat2{:},dat3{:}); % Finally get the mixed-effects for Age and WM-load by combining the mask-data from the previous steps mixed_effects.mask = depT1.mask.*depT2.mask.*indepregT.mask; That way I would identify the channelxtimexfrequency data-points showing both an effect of WM-load and Age. Do you think that this would make sense or should I stick to depsamplesregrT and indepsamplesregrT? Best, Fred Frédéric Roux ----- Original Message ----- From: "Eric Maris" To: "FieldTrip discussion list" Sent: Tuesday, November 4, 2014 12:22:12 PM Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Hi Fred, What you ask can definitely be done in Fieldtrip. The analyses you need are very similar to those of Vladimir Litvak, for who I implemented the statfuns indepsamplesRegrT and depsamplesRegrT. To give you the recipe, I would have to go back to the code, because it is such a long time ago. Anyhow, you now know where to look, and I trust that you can get a long way yourself. Best, Eric Maris > -----Original Message----- > From: Frédéric Roux [mailto:f.roux at bcbl.eu] > Sent: dinsdag 4 november 2014 11:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > Dear all, > > I would like to follow up on this, as I am currently struggling > myself with the coding of the design matrix of my analysis. > > I have MEG data from n = 95 participants aged between 12 and 27 years > on a WM-task with 3 WM-load conditions. > > I would like to investigate the effects of age (continuous variable > ranging from 12 to 27) and WM-load (categorical variable ranging from > 1-3) on delay-activity in different frequency-bands. > > What would be the correct way to perform such an analysis in > fieldtrip? > > Would this be akin to a mixed-effects design? > > Best regards, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Eric Maris" > To: "FieldTrip discussion list" > Sent: Friday, October 31, 2014 4:56:16 PM > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > > > > > > Dear Dylan, > > > > I replied to your question on the Fieldtrip faq page that you refer > to. Although the problem can be solved, it is not implemented yet, > because it requires the implementation of three new statfuns: > Hotelling’s T-square for dependent samples, Hotelling’s T-square for > independent samples, and Wilk’s lambda. A good statistics book (e.g., > Johnson & Wichern) will show you how to do this yourself. Otherwise, > you have to be patient. > > > > Although your statistical problem can be solved, with neurobiological > data, it is almost never wise to statistically test interaction > effects in designs more complicated than the 2-by-2 factorial design. > In these more complicated designs, you always end up with F-tests, > which do not inform you about the pattern in the data that is > responsible for the interaction effect. > > > > Best, > > > > Eric > > > > > > > > > From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] > Sent: dinsdag 28 oktober 2014 13:22 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > > > > Thank you, Eelke. > I'm sorry I am not picking this up more quickly. > > > > > > Your examples of passing either multiple structs or cell arrays to > ft_freqstatistics deals with one group of subjects in multiple > conditions, or two groups in one condition, respectively. I have two > groups, both doing multiple (11) conditions and I would like to know > how to handle that in ft_freqstatistics. What I require seems to be > similar to what Eric Maris wrote about here: > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effec > t_using_cluster-based_permutation_tests > > > > > > but instead of a 2-by-2 factorial design, I am using a 2-by-11 > factorial design. As such, I am not sure how this translates when > making difference data structures. I hope I am not missing something > obvious. > > > > > > Thanks again, > > > Dylan > > > > > > On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > > wrote: > > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their- > contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one unit- > of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles < > dylan.delosangeles at gmail.com > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of > two or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up > with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 > electrodes x 3 frequencies x 2049 time points, rather than one struct > with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x > time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config time = > > EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis cfg = []; % clear cfg > > cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = > 1:0.05:time; > > % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end > > > > My second problem is loading in the second group of 12 subjects and > what that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous > email, > > that I should be using indepsamplesF for more than two conditions > (I > > have 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < > eelke.spaak at donders.ru.nl > > wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two > groups > > of observations, and not to the same group of observations measured > in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then > use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) > cell > > arrays, corresponding to the conditions, you can input them into > the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above > is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles < > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > >> time-frequency data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > >> trials) and the two experimental designs (between- and within-UO), > >> the tutorial covers statistics on data in two conditions in a > >> between-trials, in a within-trials and in a within-subjects > design. > >> However, I am wondering if there is any information about the > fourth type of experiment design: between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both > groups > >> are measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > >> (multiple subjects in multiple experimental conditions), such that > my > >> design is multiple groups in multiple experimental conditions. Is > it > >> a case of first averaging over all trials belonging to each of the > >> experimental conditions for each subject (as instructed in > tutorial), > >> and then averaging over all subjects in each group? > >> > >> Configuration code for setting up the design currently looks like > >> this; grp = 2; subj = 11; design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when > doing > >> these statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From f.roux at bcbl.eu Tue Nov 4 12:40:29 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 4 Nov 2014 12:40:29 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <020d01cff821$91fab690$b5f023b0$@maris@psych.ru.nl> Message-ID: <746608921.3739439.1415101229761.JavaMail.root@bcbl.eu> Hi Eric, thanks for getting back about this so quickly. This is very helpful. Do you think I could also combine depsamplesT with indepsamplesregrT? I was thinking to do something like this: % First test for the general effect of WM-load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'depsamplesT'; cfg.ivar = 1; cfg.uvar = 2; cfg.design = []; cfg.design(1,:) = [ones(1,length(dat3)) 2*ones(1,length(dat2))]; cfg.design(2,:) = [1:length(dat3) 1:length(dat2)]; [depT1] = ft_freqstatistics(cfg,dat3{:},dat2{:});% WM-load effect #1 cfg.design = []; cfg.design(1,:) = [ones(1,length(dat2)) 2*ones(1,length(dat1))]; cfg.design(2,:) = [1:length(dat2) 1:length(dat1)]; [depT2] = ft_freqstatistics(cfg,dat2{:},dat1{:});% WM-load effect #2 % Second test for the general effect of age in the data while controlling for load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'indepsamplesregrT'; cfg.ivar = 1; cfg.cvar = 2; cfg.design = []; cfg.design(1,:) = [Age Age Age]; cfg.design(2,:) = [ones(1,length(dat1)) 2*ones(1,length(dat2)) 3*ones(1,length(dat3))]; indepregT = ft_freqstatistics(cfg,dat1{:},dat2{:},dat3{:}); % Finally get the mixed-effects for Age and WM-load by combining the mask-data from the previous steps mixed_effects.mask = depT1.mask.*depT2.mask.*indepregT.mask; That way I would identify the channelxtimexfrequency data-points showing both an effect of WM-load and Age. Do you think that this would make sense or should I stick to depsamplesregrT and indepsamplesregrT? Best, Fred Frédéric Roux ----- Original Message ----- From: "Eric Maris" To: "FieldTrip discussion list" Sent: Tuesday, November 4, 2014 12:22:12 PM Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Hi Fred, What you ask can definitely be done in Fieldtrip. The analyses you need are very similar to those of Vladimir Litvak, for who I implemented the statfuns indepsamplesRegrT and depsamplesRegrT. To give you the recipe, I would have to go back to the code, because it is such a long time ago. Anyhow, you now know where to look, and I trust that you can get a long way yourself. Best, Eric Maris > -----Original Message----- > From: Frédéric Roux [mailto:f.roux at bcbl.eu] > Sent: dinsdag 4 november 2014 11:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > Dear all, > > I would like to follow up on this, as I am currently struggling > myself with the coding of the design matrix of my analysis. > > I have MEG data from n = 95 participants aged between 12 and 27 years > on a WM-task with 3 WM-load conditions. > > I would like to investigate the effects of age (continuous variable > ranging from 12 to 27) and WM-load (categorical variable ranging from > 1-3) on delay-activity in different frequency-bands. > > What would be the correct way to perform such an analysis in > fieldtrip? > > Would this be akin to a mixed-effects design? > > Best regards, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Eric Maris" > To: "FieldTrip discussion list" > Sent: Friday, October 31, 2014 4:56:16 PM > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > > > > > > Dear Dylan, > > > > I replied to your question on the Fieldtrip faq page that you refer > to. Although the problem can be solved, it is not implemented yet, > because it requires the implementation of three new statfuns: > Hotelling’s T-square for dependent samples, Hotelling’s T-square for > independent samples, and Wilk’s lambda. A good statistics book (e.g., > Johnson & Wichern) will show you how to do this yourself. Otherwise, > you have to be patient. > > > > Although your statistical problem can be solved, with neurobiological > data, it is almost never wise to statistically test interaction > effects in designs more complicated than the 2-by-2 factorial design. > In these more complicated designs, you always end up with F-tests, > which do not inform you about the pattern in the data that is > responsible for the interaction effect. > > > > Best, > > > > Eric > > > > > > > > > From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] > Sent: dinsdag 28 oktober 2014 13:22 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > > > > Thank you, Eelke. > I'm sorry I am not picking this up more quickly. > > > > > > Your examples of passing either multiple structs or cell arrays to > ft_freqstatistics deals with one group of subjects in multiple > conditions, or two groups in one condition, respectively. I have two > groups, both doing multiple (11) conditions and I would like to know > how to handle that in ft_freqstatistics. What I require seems to be > similar to what Eric Maris wrote about here: > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effec > t_using_cluster-based_permutation_tests > > > > > > but instead of a 2-by-2 factorial design, I am using a 2-by-11 > factorial design. As such, I am not sure how this translates when > making difference data structures. I hope I am not missing something > obvious. > > > > > > Thanks again, > > > Dylan > > > > > > On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > > wrote: > > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their- > contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one unit- > of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles < > dylan.delosangeles at gmail.com > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of > two or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up > with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 > electrodes x 3 frequencies x 2049 time points, rather than one struct > with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x > time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config time = > > EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis cfg = []; % clear cfg > > cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = > 1:0.05:time; > > % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end > > > > My second problem is loading in the second group of 12 subjects and > what that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous > email, > > that I should be using indepsamplesF for more than two conditions > (I > > have 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < > eelke.spaak at donders.ru.nl > > wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two > groups > > of observations, and not to the same group of observations measured > in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then > use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) > cell > > arrays, corresponding to the conditions, you can input them into > the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above > is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles < > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > >> time-frequency data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > >> trials) and the two experimental designs (between- and within-UO), > >> the tutorial covers statistics on data in two conditions in a > >> between-trials, in a within-trials and in a within-subjects > design. > >> However, I am wondering if there is any information about the > fourth type of experiment design: between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both > groups > >> are measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > >> (multiple subjects in multiple experimental conditions), such that > my > >> design is multiple groups in multiple experimental conditions. Is > it > >> a case of first averaging over all trials belonging to each of the > >> experimental conditions for each subject (as instructed in > tutorial), > >> and then averaging over all subjects in each group? > >> > >> Configuration code for setting up the design currently looks like > >> this; grp = 2; subj = 11; design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when > doing > >> these statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ktyler at swin.edu.au Wed Nov 5 14:50:48 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Wed, 5 Nov 2014 13:50:48 +0000 Subject: [FieldTrip] (no subject) Message-ID: Dear Field trippers, And especially dear Neuromag users, I have been going back over the analysis of my study, ironing out issues, and am finding that I am still having problems with source analysis coming up with some unexpected and probably inaccurate locations for clusters of significant effects. I have decided to go back and look at a simple right handed button push, in one subject, to check if I was able to locate a realistic region in M1. >From the attached jpeg, you will see that the analysis is not accurately locating left hemisphere motor regions. I know I can't expect absolute accuracy, but I would be hoping for more than this. I have included my code (below) and if any one has any suggestions about how to remedy this and produce more accurate results, please let me know!!! I am wondering if I have realigned my mri to the neuromag system correctly, and have attached another jpeg of my volume conduction model, plotted alongside the neuromag sensors. Neuromag users, does this look accurate to you? As a general fix, I was wondering if any neuromag users would be happy to supply their FT code for use of mri, including realignment of mri to the neuromag system, segmentation and the creation of the volume conduction model? As always, any help is much appreciated! Here is the code as I have been currently using it: %% Load MRI mri = ft_read_mri('Subject1.nii'); %% Realigning cfg=[]; cfg.coordsys = 'neuromag'; mri = ft_volumerealign(cfg, mri); %% Segmentation. cfg = []; cfg.coordsys='neuromag'; cfg.units='mm'; seg = ft_volumesegment(cfg, mri); %% Prepare volumne conduction model cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); %% Non warped grid for use in single subject comparison btw conditions cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.vol = vol; sourcemodel = ft_prepare_sourcemodel(cfg); %% Calculates leadfields cfg = []; cfg.grid=sourcemodel; cfg.vol = vol; cfg.channel={'MEGGRAD'};% For Planar gradiometers only cfg.grad=grad;%This needs to be edited to represent the MEG data set which has just been loaded grid = ft_prepare_leadfield(cfg, Condition1); %% Append individuals data from two conditions. %This is so as to create a common filter, from the two conditions. cfg=[]; cfg.appenddim = 'rpt'; combined = ft_appendtimelock(cfg, Condition1, Condition2); %% Calculate covariance and timelock. Input data should NOT have been timelocked before this. cfg = []; cfg.keeptrials = 'yes'; cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; cfg.vartrllength = 2; cfg.channel='MEGGRAD'; tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); tlckavgCombined = ft_timelockanalysis(cfg, combined); %% Create spatial filter using the lcmv beamformer cfg = []; cfg.grid = grid; % leadfield, which has the grid information cfg.grad=grad; cfg.vol = vol; % volume conduction model (headmodel) cfg.keepfilter = 'yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD cfg.channel='MEGGRAD'; sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% %% cfg.grid.filter = sourceCombined.avg.filter; cfg.rawtrial='yes'; sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); %% The cluster stats at source space: %% cfg=[]; cfg.dim=sourceCond1.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.05; cfg.tail = 0; cfg.clusteralpha = 0.005; cfg.minnbchan = 8; cfg.correcttail = 'alpha'; cfg.clusterstatistic = 'maxsum'; Nsub = 84; cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; cfg.ivar = 1; % the 1st row in cfg.design contains the independent variable cfg.uvar = 2; % the 2nd row in cfg.design contains the subject number stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); %% interpolate the t maps to the structural MRI of the subject % cfg = []; cfg.parameter = 'mask'; statplot = ft_sourceinterpolate(cfg,stat, mri); %% plot the t values on the MRI % cfg = []; cfg.method = 'slice'; cfg.funparameter = 'mask'; cfg.maskparameter = 'funparameter'; figure ft_sourceplot(cfg, statplot); %% -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RH_ButtonPush.jpg Type: image/jpeg Size: 37138 bytes Desc: RH_ButtonPush.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Sensors_Volume.jpg Type: image/jpeg Size: 26947 bytes Desc: Sensors_Volume.jpg URL: From stephen.whitmarsh at gmail.com Wed Nov 5 15:59:09 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 5 Nov 2014 15:59:09 +0100 Subject: [FieldTrip] (no subject) In-Reply-To: References: Message-ID: Hi Kaelasha, It's hard to evaluate why the localization in not exactly how you would expect it, but here are some idea you could try from the top of my head. Note I never used LCMV beamformer myself, although I've done DICS. Also, to me there seems to be not something obviously *wrong *in the code or pictures, so I'm just suggesting some thoughts here. - Beamformer performance is VERY dependent on the data. Check your sensor level data, clean it more if necessary. - Play around with including more or less data centered around the component you are localizing for both the common filter as the data you localize. Since I don't know the details of the data (nor do i have experience with LCMV) your choices here are hard to evaluate. - Plot the scalp as well to get a better idea whether your co-registration is accurate. If you have additional headpoints e.g. by using a Polhemus, that would help. - Play around with some regularization - in ft_sourceanalysis use e.g.: cfg.alpha = '10%'; - Evaluate your lcmv beamformer with a dipole fit. - Check other subjects/recordings - other recordings might be better (or worse...) Finally, if you haven't already, take a look at the scripts we used in our recent workshop using a Neuromag system (although as I said I see nothing wrong with your script): http://fieldtrip.fcdonders.nl/workshop/stockholm2014q3 The beamformer lecture there given by Robert on Beamforming is also online: http://natmeg.se/wp/activities/natmeg-lectures/ Good luck! Stephen On 5 November 2014 14:50, Kaelasha Tyler wrote: > Dear Field trippers, > And especially dear Neuromag users, > > I have been going back over the analysis of my study, ironing out > issues, and am finding that I am still having problems with source analysis > coming up with some unexpected and probably inaccurate locations for > clusters of significant effects. > > I have decided to go back and look at a simple right handed button push, > in one subject, to check if I was able to locate a realistic region in M1. > > From the attached jpeg, you will see that the analysis is not accurately > locating left hemisphere motor regions. I know I can't expect absolute > accuracy, but I would be hoping for more than this. > > I have included my code (below) and if any one has any suggestions about > how to remedy this and produce more accurate results, please let me know!!! > > I am wondering if I have realigned my mri to the neuromag system > correctly, and have attached another jpeg of my volume conduction model, > plotted alongside the neuromag sensors. > > Neuromag users, does this look accurate to you? > > As a general fix, I was wondering if any neuromag users would be happy > to supply their FT code for use of mri, including realignment of mri to the > neuromag system, segmentation and the creation of the volume conduction > model? > > As always, any help is much appreciated! > > Here is the code as I have been currently using it: > > %% Load MRI > > mri = ft_read_mri('Subject1.nii'); > > %% Realigning > cfg=[]; > cfg.coordsys = 'neuromag'; > mri = ft_volumerealign(cfg, mri); > > %% Segmentation. > > cfg = []; > cfg.coordsys='neuromag'; > cfg.units='mm'; > seg = ft_volumesegment(cfg, mri); > > %% Prepare volumne conduction model > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > %% Non warped grid for use in single subject comparison btw conditions > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.vol = vol; > sourcemodel = ft_prepare_sourcemodel(cfg); > > %% Calculates leadfields > > cfg = []; > cfg.grid=sourcemodel; > cfg.vol = vol; > cfg.channel={'MEGGRAD'};% For Planar gradiometers only > cfg.grad=grad;%This needs to be edited to represent the MEG data set which > has just been loaded > grid = ft_prepare_leadfield(cfg, Condition1); > > %% Append individuals data from two conditions. > %This is so as to create a common filter, from the two conditions. > cfg=[]; > cfg.appenddim = 'rpt'; > combined = ft_appendtimelock(cfg, Condition1, Condition2); > > %% Calculate covariance and timelock. Input data should NOT have been > timelocked before this. > > cfg = []; > cfg.keeptrials = 'yes'; > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > cfg.vartrllength = 2; > cfg.channel='MEGGRAD'; > tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); > tlckavgCombined = ft_timelockanalysis(cfg, combined); > > %% Create spatial filter using the lcmv beamformer > cfg = []; > cfg.grid = grid; % leadfield, which has the grid information > cfg.grad=grad; > cfg.vol = vol; % volume conduction model (headmodel) > cfg.keepfilter = 'yes'; > cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD > cfg.channel='MEGGRAD'; > sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% > %% > cfg.grid.filter = sourceCombined.avg.filter; > cfg.rawtrial='yes'; > sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); > > %% The cluster stats at source space: > > %% > cfg=[]; > cfg.dim=sourceCond1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.05; > cfg.tail = 0; > cfg.clusteralpha = 0.005; > cfg.minnbchan = 8; > cfg.correcttail = 'alpha'; > cfg.clusterstatistic = 'maxsum'; > Nsub = 84; > cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > cfg.ivar = 1; % the 1st row in cfg.design contains the > independent variable > cfg.uvar = 2; % the 2nd row in cfg.design contains the > subject number > > stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); > > %% interpolate the t maps to the structural MRI of the subject % > cfg = []; > cfg.parameter = 'mask'; > statplot = ft_sourceinterpolate(cfg,stat, mri); > %% plot the t values on the MRI % > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'mask'; > cfg.maskparameter = 'funparameter'; > figure > ft_sourceplot(cfg, statplot); > %% > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Wed Nov 5 16:15:31 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Wed, 5 Nov 2014 16:15:31 +0100 Subject: [FieldTrip] (no subject) In-Reply-To: References: Message-ID: Dear Kaelasha, I recently came across the exact same problem in my Neuromag source analysis: mislocalization of motor beta over M1 (it was too posterior in my case). I used LCMV, so my analyses are quite similar to yours. Do you use the Elekta Maxfilter routine of *tSSS *(a preprocessing step to remove non-brain noise)? There, I had the option *-trans* enabled, which transforms the sensor data of every subject to a common space, so that subjects become better comparable *in sensor space*. But this should not be used if you do source analysis, because the forward model uses the coregistered MRI, taking into account how that subject was positioned in the scanner. When I redid tSSS without the -trans option, and recomputed the forward model, motor beta suppression was right where it should be. As for the coregistration, we used a polhemus point method of digitized 3D points, which allows for continuous tracking of head position in the Elekta scanner. With those points, there are built-in ways to coregister the MRI using the Elekta software (somebody else helped me with that, so I don't know the details how to do this). With the coregistered MRIs, I just followed the fieldtrip tutorial up to ft_prepare_leadfield, and everything went fine. Best, Joram On Wed, Nov 5, 2014 at 2:50 PM, Kaelasha Tyler wrote: > Dear Field trippers, > And especially dear Neuromag users, > > I have been going back over the analysis of my study, ironing out > issues, and am finding that I am still having problems with source analysis > coming up with some unexpected and probably inaccurate locations for > clusters of significant effects. > > I have decided to go back and look at a simple right handed button push, > in one subject, to check if I was able to locate a realistic region in M1. > > From the attached jpeg, you will see that the analysis is not accurately > locating left hemisphere motor regions. I know I can't expect absolute > accuracy, but I would be hoping for more than this. > > I have included my code (below) and if any one has any suggestions about > how to remedy this and produce more accurate results, please let me know!!! > > I am wondering if I have realigned my mri to the neuromag system > correctly, and have attached another jpeg of my volume conduction model, > plotted alongside the neuromag sensors. > > Neuromag users, does this look accurate to you? > > As a general fix, I was wondering if any neuromag users would be happy > to supply their FT code for use of mri, including realignment of mri to the > neuromag system, segmentation and the creation of the volume conduction > model? > > As always, any help is much appreciated! > > Here is the code as I have been currently using it: > > %% Load MRI > > mri = ft_read_mri('Subject1.nii'); > > %% Realigning > cfg=[]; > cfg.coordsys = 'neuromag'; > mri = ft_volumerealign(cfg, mri); > > %% Segmentation. > > cfg = []; > cfg.coordsys='neuromag'; > cfg.units='mm'; > seg = ft_volumesegment(cfg, mri); > > %% Prepare volumne conduction model > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > %% Non warped grid for use in single subject comparison btw conditions > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.vol = vol; > sourcemodel = ft_prepare_sourcemodel(cfg); > > %% Calculates leadfields > > cfg = []; > cfg.grid=sourcemodel; > cfg.vol = vol; > cfg.channel={'MEGGRAD'};% For Planar gradiometers only > cfg.grad=grad;%This needs to be edited to represent the MEG data set which > has just been loaded > grid = ft_prepare_leadfield(cfg, Condition1); > > %% Append individuals data from two conditions. > %This is so as to create a common filter, from the two conditions. > cfg=[]; > cfg.appenddim = 'rpt'; > combined = ft_appendtimelock(cfg, Condition1, Condition2); > > %% Calculate covariance and timelock. Input data should NOT have been > timelocked before this. > > cfg = []; > cfg.keeptrials = 'yes'; > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > cfg.vartrllength = 2; > cfg.channel='MEGGRAD'; > tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); > tlckavgCombined = ft_timelockanalysis(cfg, combined); > > %% Create spatial filter using the lcmv beamformer > cfg = []; > cfg.grid = grid; % leadfield, which has the grid information > cfg.grad=grad; > cfg.vol = vol; % volume conduction model (headmodel) > cfg.keepfilter = 'yes'; > cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD > cfg.channel='MEGGRAD'; > sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% > %% > cfg.grid.filter = sourceCombined.avg.filter; > cfg.rawtrial='yes'; > sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); > > %% The cluster stats at source space: > > %% > cfg=[]; > cfg.dim=sourceCond1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.05; > cfg.tail = 0; > cfg.clusteralpha = 0.005; > cfg.minnbchan = 8; > cfg.correcttail = 'alpha'; > cfg.clusterstatistic = 'maxsum'; > Nsub = 84; > cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > cfg.ivar = 1; % the 1st row in cfg.design contains the > independent variable > cfg.uvar = 2; % the 2nd row in cfg.design contains the > subject number > > stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); > > %% interpolate the t maps to the structural MRI of the subject % > cfg = []; > cfg.parameter = 'mask'; > statplot = ft_sourceinterpolate(cfg,stat, mri); > %% plot the t values on the MRI % > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'mask'; > cfg.maskparameter = 'funparameter'; > figure > ft_sourceplot(cfg, statplot); > %% > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Nov 5 19:30:29 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 5 Nov 2014 19:30:29 +0100 Subject: [FieldTrip] Timestamp format using ft_spike functions In-Reply-To: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> References: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> Message-ID: Hi Dominic, Timestamps are encoded in the original representation of the corresponding acquisition system. For Plexon that means that they are at 40kHz, for Neuralynx they are approximately 1MHz. This allows the different types of data acquired with the system (spikes, LFP, events) to be synchronized. best regards, Robert On 31 Oct 2014, at 16:47, Dominic Depke wrote: > Dear all, > > I have a question regarding the data structure of spikedata. > Especially I would like to ask how timestamps are encoded in the spike.timestamp structure (which timecode format e.g. clockticks, micro/mili/seconds) for further analysis in fieldtrip. > > > Thanks and best wishes, > Dominic > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > Dominic Depke, M.Sc. > PhD student > Institut für Physiologie I > Robert-Koch-Straße 27a > DE-48149 Münster > Tel. : +49 251-83-58112 > Email: depke at uni-muenster.de > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Wed Nov 5 21:55:25 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Wed, 5 Nov 2014 20:55:25 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Hi Stan, Thanks for the suggestion. However, the same error also occurs when i use cfg.parameter = 'avg.pow'. I wonder if anyone else has encountered problems when inputting data to ft_sourcegrandaverag and might be able to help me? Or if anyone has encountered the following error before or knows why it might be occurring? ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Best, Emma Date: Mon, 3 Nov 2014 16:54:15 +0100 (CET) From: "Stan van Pelt" To: "'FieldTrip discussion list'" Subject: Re: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: <07bb01cff77e$6b7a9790$ 426fc6b0$@vanpelt at fcdonders.ru.nl> Content-Type: text/plain; charset="utf-8" Hi Emma, I am unfamiliar with this type of error. It seems however that you still have an inconsistency in your data. You define ?data{i}.avg.pow?, but later on use ?cfg.parameter = 'pow';?. You should change one of the two (e.g. use cfg.parameter = 'avg.pow';) Hope that helps. Stan From: Emma Holmes [mailto:eh776 at york.ac.uk] Sent: maandag 3 november 2014 14:02 To: fieldtrip at science.ru.nl Cc: s.vanpelt at fcdonders.ru.nl Subject: Spatio-temporal cluster-based permutation analysis on EEG sources Hi Stan, Thanks for the suggestion. When I try that, I get the following error ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Error in ==> ft_sourcegrandaverage at 82 varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I am unsure why this occurs. My data is now structured in the following way: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.avg.pow = [902629 x 11 double] % source estimates The following is the method I use: cfg = []; cfg.keepindividual = 'yes'; cfg.parameter = 'pow'; grandavgA = ft_sourcegrandaverage(cfg, data{:}); Best, Emma -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Thu Nov 6 06:20:31 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Thu, 6 Nov 2014 05:20:31 +0000 Subject: [FieldTrip] (no subject) In-Reply-To: References: , Message-ID: Hi all, Some great suggestions and resources here. I'll try a few of these suggestions out and get back to the post with results. Cheers, Kaelasha ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Joram van Driel [joramvandriel at gmail.com] Sent: Thursday, 6 November 2014 2:15 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] (no subject) Dear Kaelasha, I recently came across the exact same problem in my Neuromag source analysis: mislocalization of motor beta over M1 (it was too posterior in my case). I used LCMV, so my analyses are quite similar to yours. Do you use the Elekta Maxfilter routine of tSSS (a preprocessing step to remove non-brain noise)? There, I had the option -trans enabled, which transforms the sensor data of every subject to a common space, so that subjects become better comparable in sensor space. But this should not be used if you do source analysis, because the forward model uses the coregistered MRI, taking into account how that subject was positioned in the scanner. When I redid tSSS without the -trans option, and recomputed the forward model, motor beta suppression was right where it should be. As for the coregistration, we used a polhemus point method of digitized 3D points, which allows for continuous tracking of head position in the Elekta scanner. With those points, there are built-in ways to coregister the MRI using the Elekta software (somebody else helped me with that, so I don't know the details how to do this). With the coregistered MRIs, I just followed the fieldtrip tutorial up to ft_prepare_leadfield, and everything went fine. Best, Joram Thursday, 6 November 2014 2:14 AM Hi Kaelasha, It's hard to evaluate why the localization in not exactly how you would expect it, but here are some idea you could try from the top of my head. Note I never used LCMV beamformer myself, although I've done DICS. Also, to me there seems to be not something obviously wrong in the code or pictures, so I'm just suggesting some thoughts here. - Beamformer performance is VERY dependent on the data. Check your sensor level data, clean it more if necessary. - Play around with including more or less data centered around the component you are localizing for both the common filter as the data you localize. Since I don't know the details of the data (nor do i have experience with LCMV) your choices here are hard to evaluate. - Plot the scalp as well to get a better idea whether your co-registration is accurate. If you have additional headpoints e.g. by using a Polhemus, that would help. - Play around with some regularization - in ft_sourceanalysis use e.g.: cfg.alpha = '10%'; - Evaluate your lcmv beamformer with a dipole fit. - Check other subjects/recordings - other recordings might be better (or worse...) Finally, if you haven't already, take a look at the scripts we used in our recent workshop using a Neuromag system (although as I said I see nothing wrong with your script): http://fieldtrip.fcdonders.nl/workshop/stockholm2014q3 The beamformer lecture there given by Robert on Beamforming is also online: http://natmeg.se/wp/activities/natmeg-lectures/ Good luck! Stephen On Wed, Nov 5, 2014 at 2:50 PM, Kaelasha Tyler > wrote: Dear Field trippers, And especially dear Neuromag users, I have been going back over the analysis of my study, ironing out issues, and am finding that I am still having problems with source analysis coming up with some unexpected and probably inaccurate locations for clusters of significant effects. I have decided to go back and look at a simple right handed button push, in one subject, to check if I was able to locate a realistic region in M1. >From the attached jpeg, you will see that the analysis is not accurately locating left hemisphere motor regions. I know I can't expect absolute accuracy, but I would be hoping for more than this. I have included my code (below) and if any one has any suggestions about how to remedy this and produce more accurate results, please let me know!!! I am wondering if I have realigned my mri to the neuromag system correctly, and have attached another jpeg of my volume conduction model, plotted alongside the neuromag sensors. Neuromag users, does this look accurate to you? As a general fix, I was wondering if any neuromag users would be happy to supply their FT code for use of mri, including realignment of mri to the neuromag system, segmentation and the creation of the volume conduction model? As always, any help is much appreciated! Here is the code as I have been currently using it: %% Load MRI mri = ft_read_mri('Subject1.nii'); %% Realigning cfg=[]; cfg.coordsys = 'neuromag'; mri = ft_volumerealign(cfg, mri); %% Segmentation. cfg = []; cfg.coordsys='neuromag'; cfg.units='mm'; seg = ft_volumesegment(cfg, mri); %% Prepare volumne conduction model cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); %% Non warped grid for use in single subject comparison btw conditions cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.vol = vol; sourcemodel = ft_prepare_sourcemodel(cfg); %% Calculates leadfields cfg = []; cfg.grid=sourcemodel; cfg.vol = vol; cfg.channel={'MEGGRAD'};% For Planar gradiometers only cfg.grad=grad;%This needs to be edited to represent the MEG data set which has just been loaded grid = ft_prepare_leadfield(cfg, Condition1); %% Append individuals data from two conditions. %This is so as to create a common filter, from the two conditions. cfg=[]; cfg.appenddim = 'rpt'; combined = ft_appendtimelock(cfg, Condition1, Condition2); %% Calculate covariance and timelock. Input data should NOT have been timelocked before this. cfg = []; cfg.keeptrials = 'yes'; cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; cfg.vartrllength = 2; cfg.channel='MEGGRAD'; tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); tlckavgCombined = ft_timelockanalysis(cfg, combined); %% Create spatial filter using the lcmv beamformer cfg = []; cfg.grid = grid; % leadfield, which has the grid information cfg.grad=grad; cfg.vol = vol; % volume conduction model (headmodel) cfg.keepfilter = 'yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD cfg.channel='MEGGRAD'; sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% %% cfg.grid.filter = sourceCombined.avg.filter; cfg.rawtrial='yes'; sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); %% The cluster stats at source space: %% cfg=[]; cfg.dim=sourceCond1.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.05; cfg.tail = 0; cfg.clusteralpha = 0.005; cfg.minnbchan = 8; cfg.correcttail = 'alpha'; cfg.clusterstatistic = 'maxsum'; Nsub = 84; cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; cfg.ivar = 1; % the 1st row in cfg.design contains the independent variable cfg.uvar = 2; % the 2nd row in cfg.design contains the subject number stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); %% interpolate the t maps to the structural MRI of the subject % cfg = []; cfg.parameter = 'mask'; statplot = ft_sourceinterpolate(cfg,stat, mri); %% plot the t values on the MRI % cfg = []; cfg.method = 'slice'; cfg.funparameter = 'mask'; cfg.maskparameter = 'funparameter'; figure ft_sourceplot(cfg, statplot); %% _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominic.depke at ruhr-uni-bochum.de Thu Nov 6 13:57:47 2014 From: dominic.depke at ruhr-uni-bochum.de (Dominic Depke) Date: Thu, 6 Nov 2014 13:57:47 +0100 Subject: [FieldTrip] Timestamp format using ft_spike functions In-Reply-To: References: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> Message-ID: <005401cff9c1$43aba340$cb02e9c0$@ruhr-uni-bochum.de> Hi Robert, Thanks for your answer. Actually I’m working with a dataformat which is currently not supported (Sonfiles, .smr), but it is possible to access and export the data in various timeformats (including clockticks, microseconds etc.) using functions from the SON-library provided by SigTOOL. Now I would like to know whether I can simply create my own raw data structure for further analysis using functions from the spike-toolbox or do ft_spike functions still deal with different timecode-formats once the raw data has been read into memory (so how should the (raw) spike data be represented if no fileformat is specified)? Here’s just an example of my import procedure: fid = fopen(‘filename.smr'); %open file and return filehandle info_tmp = SONChanList(fid); %get channelinformation spike = []; kind = reshape({info_tmp.kind},size({info_tmp.kind},2),1); %find units and LFP if any(cell2mat(kind(:)) == 6) == 0 error('no spike channels detected') end %find indices and names of spikechannels %kind = 1 -> waveform, kind = 6 -> wavemark (spikes) [wvmk] = find((cell2mat({info_tmp.kind})) == 6); %get index of wavemarkchannels spikechan = [info_tmp(wvmk)]; spike.label = reshape({spikechan.title},size({spikechan.title},2),1); sident = [spikechan.number]; %import channeldata for i = 1:length(sident) n = sident(i); tmp = [SONGetChannel(fid,n,'ticks')]; %export as clockticks spike.timestamp{1,i} = reshape([tmp.timings],1,size([tmp.timings],1)); %index (clockticks) of first spike-sample spike.waveform{1,i}(1,:,:) = double(tmp.adc)*1/6553.6; %10 V range; 16 bit int units to double (1x 32 datapoints per sike x timestamps) %create channelheader: %samplinginterval in Hz spike.hdr.Fs{1,i} = 1/(SONGetSampleInterval(fid,sident)*1e-6); spike.hdr.label{1,i} = {spikechan.title(i)}; end So in this case spikes are just represented by their clocktick-indices as well as the rest of the data. Since I know the sampling rate and the index of the first spike-datapoint (which would be similar to the timestamppersample field in the tutorials) it should be easy to synchronize them with the continuous LFP data. I assume that all the required fields are present in my spike structure but I am unsure about how fieldtrip functions deal with my timestamp representation. Thanks and best regards, Dominic Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Robert Oostenveld Gesendet: Mittwoch, 5. November 2014 19:30 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Timestamp format using ft_spike functions Hi Dominic, Timestamps are encoded in the original representation of the corresponding acquisition system. For Plexon that means that they are at 40kHz, for Neuralynx they are approximately 1MHz. This allows the different types of data acquired with the system (spikes, LFP, events) to be synchronized. best regards, Robert On 31 Oct 2014, at 16:47, Dominic Depke wrote: Dear all, I have a question regarding the data structure of spikedata. Especially I would like to ask how timestamps are encoded in the spike.timestamp structure (which timecode format e.g. clockticks, micro/mili/seconds) for further analysis in fieldtrip. Thanks and best wishes, Dominic _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Dominic Depke, M.Sc. PhD student Institut für Physiologie I Robert-Koch-Straße 27a DE-48149 Münster Tel. : +49 251-83-58112 Email: depke at uni-muenster.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From longjinyi at gmail.com Fri Nov 7 00:23:47 2014 From: longjinyi at gmail.com (Jinyi Long) Date: Thu, 6 Nov 2014 18:23:47 -0500 Subject: [FieldTrip] power-frequency figure Message-ID: Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! Best, Jinyi -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 7 07:33:13 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 7 Nov 2014 07:33:13 +0100 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: Message-ID: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Dear Jinyi, You can use ft_singleplotER to plot the power spectrum of a single channel. If you are interested in the same but for multiple channels than use ft_multiplotER. Finally if you are interested in the topography of a particular frequency you'd specify it in cfg.xlim=[begin end] and call ft_topoplotER. Good luck Tzvetan > Am 07.11.2014 um 00:23 schrieb Jinyi Long : > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! > > Best, > Jinyi > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From wangpele at gmail.com Fri Nov 7 08:12:30 2014 From: wangpele at gmail.com (Wang Jing) Date: Fri, 7 Nov 2014 15:12:30 +0800 Subject: [FieldTrip] Newbie question on WPLI Message-ID: Hi, I am a newbie in FieldTrip. I want to calculate wpli (weighted phase lag index) of two time series, e.g. EEG collected from C3 and C4. The data are ASCII format. Could you indicate me how to proceed? Thanks a lot! Regards, Wang Jing -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 7 09:27:39 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 7 Nov 2014 09:27:39 +0100 Subject: [FieldTrip] Newbie question on WPLI In-Reply-To: References: Message-ID: Dear Wang Jing, one way to get you started would be: 1.Read the ascii delimited data into matlab: http://www.mathworks.de/help/matlab/ref/dlmread.html 2.Create a data structure FieldTrip can deal with. Something along this lines: tmpdat.label={'C3' ;'C4'};% subfield with your labels fsample=1000; % for a sampling rate of 1000 this would be one second tmpdat.time = {nan(1,1000)};% create your time vector tmpdat.time{1}=(1:1:1000);% fill the time vector tmpdat.trial = {nan(2,length(tmpdat.time{1}))}; 3. Fill the NaN fields with your data from step 1. Good luck tzvetan > Hi, > > I am a newbie in FieldTrip. I want to calculate wpli (weighted phase lag index) of two time series, e.g. EEG collected from C3 and C4. The data are ASCII format. Could you indicate me how to proceed? Thanks a lot! > > Regards, > Wang Jing > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From longjinyi at gmail.com Fri Nov 7 14:24:18 2014 From: longjinyi at gmail.com (Jinyi Long) Date: Fri, 7 Nov 2014 08:24:18 -0500 Subject: [FieldTrip] power-frequency figure In-Reply-To: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Message-ID: Dear Tzvetan, Thanks for your help. First, to plot the spectral power for one channel with the 'ft_singleplotER', how can I calculate the power spectrum with 'ft_freqanalsis'? Can I use the following code to calculate and plot power spectrum? Thanks a lot! Best, Jinyi %% frequency analysis cfg = []; cfg.output = 'pow';%'fourier';% % cfg.channel = 'MEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0.5:0.05:4; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, data); %% visualize cfg = []; cfg.baseline = [-0.9 -0.1]; cfg.baselinetype = 'absolute'; cfg.maskstyle = 'saturation'; cfg.zlim = [-3e-7 3e-7]; % cfg.channel = '26'; figure ft_singleplotER(cfg, TFRhann) 2014-11-07 1:33 GMT-05:00 Tzvetan Popov : > Dear Jinyi, > You can use ft_singleplotER to plot the power spectrum of a single > channel. If you are interested in the same but for multiple channels than > use ft_multiplotER. Finally if you are interested in the topography of a > particular frequency you'd specify it in cfg.xlim=[begin end] and call > ft_topoplotER. > Good luck > Tzvetan > > > > > Am 07.11.2014 um 00:23 schrieb Jinyi Long : > > > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. > When I perform the frequency analysis with the function of > 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D > time-frequency figure at single channel? Thanks! > > > > Best, > > Jinyi > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Fri Nov 7 14:55:01 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 7 Nov 2014 13:55:01 +0000 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de>, Message-ID: Hi Jinyi, The name of the function gives you a clue on what function to use for plotting. ft_singleplotER vs. ft_singleplotTFR. ER for event-related potentials/fields, and TFR = time frequency data. Please take a look at this tutorial, all the questions you have asked can be found here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysishttp://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis Nietzsche ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Jinyi Long [longjinyi at gmail.com] Sent: 07 November 2014 14:24 To: FieldTrip discussion list Subject: Re: [FieldTrip] power-frequency figure Dear Tzvetan, Thanks for your help. First, to plot the spectral power for one channel with the 'ft_singleplotER', how can I calculate the power spectrum with 'ft_freqanalsis'? Can I use the following code to calculate and plot power spectrum? Thanks a lot! Best, Jinyi %% frequency analysis cfg = []; cfg.output = 'pow';%'fourier';% % cfg.channel = 'MEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0.5:0.05:4; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, data); %% visualize cfg = []; cfg.baseline = [-0.9 -0.1]; cfg.baselinetype = 'absolute'; cfg.maskstyle = 'saturation'; cfg.zlim = [-3e-7 3e-7]; % cfg.channel = '26'; figure ft_singleplotER(cfg, TFRhann) 2014-11-07 1:33 GMT-05:00 Tzvetan Popov >: Dear Jinyi, You can use ft_singleplotER to plot the power spectrum of a single channel. If you are interested in the same but for multiple channels than use ft_multiplotER. Finally if you are interested in the topography of a particular frequency you'd specify it in cfg.xlim=[begin end] and call ft_topoplotER. Good luck Tzvetan > Am 07.11.2014 um 00:23 schrieb Jinyi Long >: > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! > > Best, > Jinyi > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 7 14:56:41 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 7 Nov 2014 14:56:41 +0100 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Message-ID: Dear Jinyi, what you’re referring to is time-frequency analysis. From your e-mail I assumed that you’ve already performed frequency analysis, yet apparently not. You can compute the power spectrum bei using something like this: cfg = []; cfg.output = 'pow'; cfg.method = 'mtmfft'; cfg.taper = 'dpss'; cfg.foilim = [1 20]; cfg.tapsmofrq = 2; fft_data= ft_freqanalysis(cfg,data); Subsequently you can plot fft_data with the functions I mentioned in my previous e-mail. Note that we have also a video lectures section where you can get some detailed insight into frequency domain analysis. Please have a look here: http://fieldtrip.fcdonders.nl/video and also here https://www.youtube.com/watch?v=QLvsa1r1Voc best tzvetan > Dear Tzvetan, Thanks for your help. First, to plot the spectral power for one channel with the 'ft_singleplotER', how can I calculate the power spectrum with 'ft_freqanalsis'? Can I use the following code to calculate and plot power spectrum? Thanks a lot! > > Best, > Jinyi > > > %% frequency analysis > cfg = []; > cfg.output = 'pow';%'fourier';% > % cfg.channel = 'MEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 2:1:40; % analysis 2 to 30 Hz in steps of 2 Hz > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec > cfg.toi = -0.5:0.05:4; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > TFRhann = ft_freqanalysis(cfg, data); > %% visualize > cfg = []; > cfg.baseline = [-0.9 -0.1]; > cfg.baselinetype = 'absolute'; > cfg.maskstyle = 'saturation'; > cfg.zlim = [-3e-7 3e-7]; % > cfg.channel = '26'; > figure > ft_singleplotER(cfg, TFRhann) > > > > > 2014-11-07 1:33 GMT-05:00 Tzvetan Popov : > Dear Jinyi, > You can use ft_singleplotER to plot the power spectrum of a single channel. If you are interested in the same but for multiple channels than use ft_multiplotER. Finally if you are interested in the topography of a particular frequency you'd specify it in cfg.xlim=[begin end] and call ft_topoplotER. > Good luck > Tzvetan > > > > > Am 07.11.2014 um 00:23 schrieb Jinyi Long : > > > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! > > > > Best, > > Jinyi > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From longjinyi at gmail.com Fri Nov 7 16:13:15 2014 From: longjinyi at gmail.com (Jinyi Long) Date: Fri, 7 Nov 2014 10:13:15 -0500 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Message-ID: Thanks Tzvetan. 2014-11-07 8:56 GMT-05:00 Tzvetan Popov : > Dear Jinyi, > what you’re referring to is time-frequency analysis. From your e-mail I > assumed that you’ve already performed frequency analysis, yet apparently > not. You can compute the power spectrum bei using something like this: > > cfg = []; > cfg.output = 'pow'; > cfg.method = 'mtmfft'; > cfg.taper = 'dpss'; > cfg.foilim = [1 20]; > cfg.tapsmofrq = 2; > fft_data= ft_freqanalysis(cfg,data); > > Subsequently you can plot fft_data with the functions I mentioned in my > previous e-mail. > Note that we have also a video lectures section where you can get some > detailed insight into frequency domain analysis. Please have a look here: > http://fieldtrip.fcdonders.nl/video > and also here > https://www.youtube.com/watch?v=QLvsa1r1Voc > > > best > tzvetan > > Dear Tzvetan, Thanks for your help. First, to plot the spectral power for > one channel with the 'ft_singleplotER', how can I calculate the power > spectrum with 'ft_freqanalsis'? Can I use the following code to calculate > and plot power spectrum? Thanks a lot! > > Best, > Jinyi > > > %% frequency analysis > cfg = []; > cfg.output = 'pow';%'fourier';% > % cfg.channel = 'MEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 2:1:40; % analysis 2 to 30 Hz > in steps of 2 Hz > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time > window = 0.5 sec > cfg.toi = -0.5:0.05:4; % time window "slides" > from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > TFRhann = ft_freqanalysis(cfg, data); > %% visualize > cfg = []; > cfg.baseline = [-0.9 -0.1]; > cfg.baselinetype = 'absolute'; > cfg.maskstyle = 'saturation'; > cfg.zlim = [-3e-7 3e-7]; % > cfg.channel = '26'; > figure > ft_singleplotER(cfg, TFRhann) > > > > > 2014-11-07 1:33 GMT-05:00 Tzvetan Popov : > >> Dear Jinyi, >> You can use ft_singleplotER to plot the power spectrum of a single >> channel. If you are interested in the same but for multiple channels than >> use ft_multiplotER. Finally if you are interested in the topography of a >> particular frequency you'd specify it in cfg.xlim=[begin end] and call >> ft_topoplotER. >> Good luck >> Tzvetan >> >> >> >> > Am 07.11.2014 um 00:23 schrieb Jinyi Long : >> > >> > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. >> When I perform the frequency analysis with the function of >> 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D >> time-frequency figure at single channel? Thanks! >> > >> > Best, >> > Jinyi >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.heldmann at neuro.uni-luebeck.de Fri Nov 7 17:51:02 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Fri, 7 Nov 2014 17:51:02 +0100 Subject: [FieldTrip] strange time frequency results after converting data with eeglab2fieldtrip Message-ID: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> I preprocessed my data (6 channels, 1Kz, minimum 97 trial/condition) with eeglab. Since I’d like to perform the time frequency analysis with field trip, I converted the data to field trip using the eegalb2fieldtrip function. However, after the conversion I’ve got very strange results, meaning that for most of the frequencies I get zeros or NaNs. I am wondering, if I have to change something in the file structure. Does anybody has an idea what’s wrong? Thanx for any help or hints, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 From rmontefusco at med.uchile.cl Fri Nov 7 21:13:54 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Fri, 7 Nov 2014 15:13:54 -0500 Subject: [FieldTrip] strange time frequency results after converting data with eeglab2fieldtrip In-Reply-To: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> References: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> Message-ID: It's hard to say at what level is the problem, for me works perfect. Can you check your data using ft_databrowser([],data) before the spectral decomposition? Can you copy how your data structure looks like? Best On Fri, Nov 7, 2014 at 11:51 AM, Marcus Heldmann < marcus.heldmann at neuro.uni-luebeck.de> wrote: > I preprocessed my data (6 channels, 1Kz, minimum 97 trial/condition) with > eeglab. Since I’d like to perform the time frequency analysis with field > trip, I converted the data to field trip using the eegalb2fieldtrip > function. However, after the conversion I’ve got very strange results, > meaning that for most of the frequencies I get zeros or NaNs. I am > wondering, if I have to change something in the file structure. Does > anybody has an idea what’s wrong? > > Thanx for any help or hints, Marcus > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.S.Beauchamp at uth.tmc.edu Sat Nov 8 01:20:22 2014 From: Michael.S.Beauchamp at uth.tmc.edu (Beauchamp, Michael S) Date: Sat, 8 Nov 2014 00:20:22 +0000 Subject: [FieldTrip] Postdoctoral position in Houston--Multisensory Integration and Visual Perception Message-ID: <2EDEDA4E3AFFFB44B07F320540CA2B6E2EDCE1@UTHMAIL1.uthouston.edu> The Beauchamp Lab at the University of Texas Medical School at Houston (http://openwetware.org/wiki/Beauchamp) seeks a postdoctoral fellow for a federally-funded research program. The main focus of the lab is to understand the neural substrates of multisensory integration and visual perception. The laboratory uses multiple techniques, including fMRI and electrocorticography: experience with one of these techniques (or related) is a requirement. Data analysis is carried out with specialized software, including AFNI, EEGlab and Fieldtrip, requiring that applicants be comfortable with writing and modifying C-shell scripts. An interest in computational and quantitative modeling of behavioral and neuroimaging data is an asset. Houston has a rich neuroimaging and neuroscience community, with Rice University, Baylor College of Medicine, and the University of Texas Health Science Center at Houston as partners in the Gulf Coast Consortia for quantitative biomedical sciences. Facilities include multiple research‑dedicated 3 T scanners, a Blackrock Microsystems 128‑channel recording system, infrared eye trackers, and MR-compatible transcranial magnetic stimulation (TMS). The position is available immediately and the review of applications will continue until the position is filled. Please send your CV to beauchamplab at gmail.com for an immediate reply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Sat Nov 8 02:14:57 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Fri, 7 Nov 2014 17:14:57 -0800 Subject: [FieldTrip] FFT Message-ID: Hello I'm new to programming and to fieldtrip, but I'd like to run a basic FFT using fieldtrip. I've done all other preprocessing in EEGlab. I've looked through the wiki and watched some videos about fieldtrips FFT functions (which were great) I just need help with implementation. Could someone give me some example code for running an FFT? These are my more specific questions: 1. I found that eeglab2filedtrip is a function I can use to convert my file from the eeglab format to fieldtrip format. Can someone give me an example as to what that code would look like? 2. I was a 40% hanning window for my FFT. How do I specify the 40%? 3. What will the output look like? What I ideally want is the power for each electrode site within a certain frequency (whichever I specify as being of interest). Thanks for the help! Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.wutzke at gmail.com Sun Nov 9 21:54:32 2014 From: alex.wutzke at gmail.com (Alexander Wutzke) Date: Sun, 9 Nov 2014 21:54:32 +0100 Subject: [FieldTrip] Coherence calculation in phalow_amphigh advanced Message-ID: Dear Ladies and Gentlemen, i have some problem by using the example code "phalow_amphigh" in advanced (link: http://fieldtrip.fcdonders.nl/example/crossfreq/phalow_amphigh ). I do my best in the last days to understand my issue, which i will described below: First, the code will generate a powerspectrum with the 'mtmconvol' method. For Signal2 at every 2Hz until 60Hz. After that it will do a 'mtmfft' calculation, so that we get on both axies the frequency range. What will happened to the powerspectrum of signal2 at 2Hz etc. in this case? Powerspectrum of powerspectrum? This is another confusing point. Finally, when i calculate the coherence between the created channels (singal1 between signal2 at 2Hz etc.) i get some strange output. I use the example signals in the code at your homepage. The plotting with imagesc generate a picture which seems to be wrong. But maybe it can also be, that i cant understand the result and therefore my interpretation is false. In general, the signal1 and signal2 are independend at different frequencys and the result should be a blue (low or no coherence) picture. But i get some blue jets and the rest of the picture is amlost red (high coherence). This is very confusing to me! Please tell me what i do wrong or is there a fieldtrip bug? Thanks a lot and you will make me very happy with your answer! I used the Fieldtrip version from 9.11.14. Yours sincerely Alexander The code part for this issue: cfg = []; cfg.method = 'mtmconvol'; cfg.channel = 's2 (high)'; cfg.output = 'pow'; cfg.taper = 'hanning'; cfg.foi = [2:2:60]; cfg.toi = data.time{1}(3001:7000); %power is calculated at every sample cfg.t_ftimwin = 4./cfg.foi; %timewindow used to calculated power is 4 cycles long and therefore differs over frequencies cfg.keeptrials = 'yes'; freq4 = ft_freqanalysis(cfg,data); % Make data same length as freq1 data_cut = data; for iTr = 1:length(data.trial) data_cut.trial{iTr} = data.trial{iTr}(:,3001:7000); data_cut.time{iTr} = data.time{iTr}(3001:7000); end data_app = ft_appenddata([],data_cut, freq4); %contains original channel and channels with power %FieldTrip automatically converts the freq4 data to raw data. % mtmfft output cross-spectral-density between s2 (high)(raw) and freq4 cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 1; cfg.foilim = [2 60]; cfg.keeptrials = 'no'; cfg.pad = 4; cfg.channelcmb = {'s1 (AM)' 's2 (high)@2Hz'; 's1 (AM)' 's2 (high)@4Hz'; 's1 (AM)' 's2 (high)@6Hz'; 's1 (AM)' 's2 (high)@8Hz'; 's1 (AM)' 's2 (high)@10Hz'; 's1 (AM)' 's2 (high)@12Hz'; 's1 (AM)' 's2 (high)@14Hz'; 's1 (AM)' 's2 (high)@16Hz'; 's1 (AM)' 's2 (high)@18Hz'; 's1 (AM)' 's2 (high)@20Hz'; 's1 (AM)' 's2 (high)@22Hz'; 's1 (AM)' 's2 (high)@24Hz'; 's1 (AM)' 's2 (high)@26Hz'; 's1 (AM)' 's2 (high)@28Hz'; 's1 (AM)' 's2 (high)@30Hz'; 's1 (AM)' 's2 (high)@32Hz'; 's1 (AM)' 's2 (high)@34Hz'; 's1 (AM)' 's2 (high)@36Hz'; 's1 (AM)' 's2 (high)@38Hz'; 's1 (AM)' 's2 (high)@40Hz'; 's1 (AM)' 's2 (high)@42Hz'; 's1 (AM)' 's2 (high)@44Hz'; 's1 (AM)' 's2 (high)@46Hz'; 's1 (AM)' 's2 (high)@48Hz'; 's1 (AM)' 's2 (high)@50Hz'; 's1 (AM)' 's2 (high)@52Hz'; 's1 (AM)' 's2 (high)@54Hz'; 's1 (AM)' 's2 (high)@56Hz'; 's1 (AM)' 's2 (high)@58Hz'; 's1 (AM)' 's2 (high)@60Hz';}; freq5 = ft_freqanalysis(cfg,data_app); %calculate coherence cfg = []; cfg.method = 'coh'; coh = ft_connectivityanalysis(cfg,freq5); coh.freq5 = [2:2:60]; figure; imagesc(coh.freq, coh.freq5, coh.cohspctrm); colorbar xlabel('Frequency(1/Hz)'); ylabel('Frequency(1/Hz)');title('Coherencespectra S1 - S2'); axis xy print -dpng phalow_amphigh_fig11.png -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Nov 10 01:06:01 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 10 Nov 2014 00:06:01 +0000 Subject: [FieldTrip] connectivity on DICS beamformer Message-ID: <2C4DB885-EFD0-4EA1-98CD-7E13247E7E95@flinders.edu.au> Hello fieldtrip, I was just wondering about the steps are doing a DICS beamformer on ft_freqanalysis output in terms of connectivity. (pointing me towards a tutorial is fine!). Ive already used the LCMV beamformer for a different purpose, where I made virtual channels and calculated connectivity between those virtual channels, but I am stumped what to do now with the ft_sourceanalysis output and the ft_freqanalysis output and how to do some connectivity analysis. Was the connectivity analysis ie granger causality, only designed to work with the ft_freqanalysis output? Thanking you in advance, please correct my inaccurate thinking! Tyler Sent from my iPad From balperin07 at gmail.com Mon Nov 10 04:30:51 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Sun, 9 Nov 2014 19:30:51 -0800 Subject: [FieldTrip] 40% hanning window Message-ID: Hello I converted my preprocessed data from eeglab to fieldtrip and successfully ran an FFT, but I would like to apply a 40% hanning window. I'm assuming by choosing hanning as my taper, it's applied to the entire trial. Here is what I have: %convert dataset from an EEGlab structure to a fieldtrip structure data = eeglab2fieldtrip(EEG,'preprocessing','none') cfg = []; cfg.method = 'mtmfft'; %run an fft cfg.taper = 'hanning'; %chose a hanning window cfg.foilim = [4 7] %frequencies of interest. In this case, theta cfg.output = 'pow' freq = ft_freqanalysis(cfg,data) Also, my data is made up of 2 second epochs. I'm assuming each cell in the output (freq.powspctrm) is the average of the power of a specific frequency (e.g. 4Hz) within each epoch. Is this accurate? Thanks for the help, Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From martine.vanschouwenburg at ucsf.edu Tue Nov 11 02:45:42 2014 From: martine.vanschouwenburg at ucsf.edu (Martine van Schouwenburg) Date: Mon, 10 Nov 2014 17:45:42 -0800 Subject: [FieldTrip] reading in ascii files Message-ID: <05b401cffd51$3400a6f0$9c01f4d0$@vanschouwenburg@ucsf.edu> Hi all, I have been using a new (wireless and dry!) EEG cap called Enobio (http://www.neuroelectrics.com/ ). It saves the data in a non-traditional format called .easy files, but they are basically just ascii files that can be read with dlmread into matlab. Is anyone aware of a way I can read these files into Fieldtrip? I tried changing the extension to .txt, because on the Fieldtrip website it mentions this as one of the supported data formats (for NIRS though..), but I get the following error. Error using ft_read_header (line 1833) unsupported header format (ascii_txt) I guess it makes sense cause there is no header in the file. J It is just a table with number of electrodes x number of data points. If anyone has succeeded in the past to read in ascii files into Fieldtrip, or has any idea on how to achieve this, I would very much appreciate your advice! Thanks! Best, Martine van Schouwenburg -------------- next part -------------- An HTML attachment was scrubbed... URL: From kumar at cbs.mpg.de Tue Nov 11 12:23:42 2014 From: kumar at cbs.mpg.de (Saurabh Kumar) Date: Tue, 11 Nov 2014 12:23:42 +0100 (CET) Subject: [FieldTrip] group_statistics_question In-Reply-To: <1346914686.4185.1415704812808.JavaMail.root@zimbra> Message-ID: <356719912.4230.1415705022318.JavaMail.root@zimbra> Hello fellow researchers, I have a general problem and am only seeking the solution in the correct direction. I am working with the EEG data and I have been able to locate the source in the brain using the MNE method that is implemented in the fieldtrip. My next step would be to do group statistics and for this I wanna know if there are some functions already implemented in fieldtrip. I have been doing source_statictics and as I understand it is used to find the significant difference between source conditions. Seeking a way, ---------------------------------------------------- Saurabh Kumar Cognitive Neurology Max Planck Institute for Human Cognitive and Brain Sciences Stephanstr. 1a 04103 Leipzig From m.stoica at uke.de Wed Nov 12 12:58:15 2014 From: m.stoica at uke.de (Stoica, Mircea) Date: Wed, 12 Nov 2014 11:58:15 +0000 Subject: [FieldTrip] How to plot hyper networks? Message-ID: Dear all, do you know any way to plot connections between two brains, i.e. two topoplots with lines connecting them? Thanks in advance. Best, Mircea Dept. of Neurophysiology and Pathophysiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg Germany -- DANKE FÜR 125 JAHRE ENGAGEMENT UND VERTRAUEN. www.uke.de/125 _____________________________________________________________________ Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- An HTML attachment was scrubbed... URL: From laura.marzetti at gmail.com Wed Nov 12 15:54:14 2014 From: laura.marzetti at gmail.com (Laura Marzetti) Date: Wed, 12 Nov 2014 15:54:14 +0100 Subject: [FieldTrip] intertrial coherence estimation Message-ID: Dear all, I want to compute the intertrial phase coherence and its variation across trials with a one taper hanning approach as in *cfg = [];* *cfg.output = 'fourier';* *cfg.channel = 'all';* *cfg.method = 'mtmconvol';* *cfg.taper = 'hanning';* *cfg.foi = 5:2:80;* *cfg.t_ftimwin = 5./cfg.foi; * *cfg.tapsmofrq = 0.4*cfg.foi; * *cfg.toi = time_vect;* *cfg.pad = 'maxperlen'; * *cfg.keeptrials = 'yes';* *% cfg.keeptapers = 'no';* *freqscprm = ft_freqanalysis(cfg, data);* *tmpdat = freqscprm.fourierspctrm;* *tmpdat = tmpdat./abs(tmpdat);* *itc = abs(mean(tmpdat)); * Nevertheless, the option *cfg.keeptrials = 'yes'; *does not seem to be applied and the output is already the average across trials, e.g. of size nfreq x ntimepoints and not of size ntrials x nfreq x ntimepoints as I would have expected due to the settings for *cfg.keeptrials.* Can anyone suggest me how to manage the configuration in order to have estimates in each trial as an output? Thanks, Laura -- Laura Marzetti, PhD Istituto di Tecnologie Avanzate Biomediche Università di Chieti "G. D'Annunzio" Via dei Vestini - Campus Universitario 66013 Chieti - ITALY phone: 0039-0871-3556944 fax: 0039-0871-3556930 -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.thomas at nin.knaw.nl Wed Nov 12 16:39:43 2014 From: r.thomas at nin.knaw.nl (Rajat Thomas) Date: Wed, 12 Nov 2014 15:39:43 +0000 Subject: [FieldTrip] EEG cap layout to SPM Message-ID: <4c7352a592774821a165217b5c0da029@EXNHI01.herseninstituut.knaw.nl> Dear FieldTrippers, ? I am trying to use both FieldTrip and SPM do to my SPM analysis. I have made my cap in the format of FT and would like to port it to SPM. Any ideas? I am using MATLAB scripts to do my analysis and I am not sure how to update the D.sensors and D.fiducials fields (where D is an SPM M/EEG structure) Thanks. Rajat Rajat Mani Thomas Social Brain Lab Netherlands Institute for Neuroscience Amsterdam -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Wed Nov 12 17:30:30 2014 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Wed, 12 Nov 2014 16:30:30 +0000 Subject: [FieldTrip] EEG cap layout to SPM In-Reply-To: <4c7352a592774821a165217b5c0da029@EXNHI01.herseninstituut.knaw.nl> References: <4c7352a592774821a165217b5c0da029@EXNHI01.herseninstituut.knaw.nl> Message-ID: Dear Rajat, One thing you can try is to save your elec struct in a mat file and then load it via Prepare in SPM (for both sensors and fiducials). Note that for things like standard 10-20 labels SPM assigns default channel locations so if your locations are not custom or individually measured it might be easier for you to go with that (also via Prepare). Best, Vladimir On Wed, Nov 12, 2014 at 3:39 PM, Rajat Thomas wrote: > Dear FieldTrippers, > > ​ > > I am trying to use both FieldTrip and SPM do to my SPM analysis. I have > made my cap in the > > format of FT and would like to port it to SPM. > > Any ideas? > > I am using MATLAB scripts to do my analysis and I am not sure how to > update the D.sensors > > and D.fiducials fields (where D is an SPM M/EEG structure) > > > Thanks. > > > Rajat > > > > > Rajat Mani Thomas > Social Brain Lab > Netherlands Institute for Neuroscience > Amsterdam > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnmark.taylor at yale.edu Wed Nov 12 17:45:31 2014 From: johnmark.taylor at yale.edu (JohnMark Taylor) Date: Wed, 12 Nov 2014 11:45:31 -0500 Subject: [FieldTrip] How to Crop .cnt files? (Forgot to stop recording) Message-ID: Hello, I have a quick question about how to manipulate .cnt files. While running one subject, we forgot to stop the EEG recording after the experiment was done (so there is about 20 minutes of empty data). This has made the .cnt file size unwieldy and too large for some of our analysis programs. We were wondering, then: is there some fieldtrip tool that can be used to crop .cnt files? We would like to get rid of all parts of the recording that happened after the experiment was finished. Thank you very much for your help, JohnMark -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerome.manson at utoronto.ca Thu Nov 13 10:07:21 2014 From: gerome.manson at utoronto.ca (Gerome Manson) Date: Thu, 13 Nov 2014 10:07:21 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip Message-ID: Hello All, I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) Thanks alot, Gerome Here is the brain vision sequence I am trying to replicate - Read in Data - Reference to mastiod - 100Hz Band rejection filter - bandwidth 8, slope 2 - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) - Notch Filter at 50Hz - Segmentation - Baseline Correction -200 ms to - 5 ms - Averaging segments Here is my Field trip code: %rereference all trials cfg.reref = 'yes'; cfg.continuous = 'yes'; % reference what channels cfg.channel = 'all'; %choose the reference channel cfg.refchannel = {'EXG1' 'EXG2'}; % cfg.dataset = 'CVP1S1.bdf'; cfg.continuous = 'yes'; % %bandfilter cfg.bsfilter = 'yes'; cfg.bsfiltord = 2; % cfg.bsfiltdir = 'onepass-zerophase'; cfg.bsfreq = [92 108]; % %DFT cfg.dftfilter = 'yes'; % IIR Filters cfg.lpfilter = 'yes'; cfg.lpfilttype = 'but'; % cfg.lpfiltdir = 'onepass-zerophase'; cfg.lpfreq = 45; cfg.hpfilter = 'yes'; cfg.hpfilttype = 'but'; % cfg.hpfiltdir = 'onepass-zerophase'; cfg.hpfreq = 0.53; data = ft_preprocessing(cfg); % Define Trial cfg = []; cfg.trialdef.eventtype = 'STATUS'; cfg.dataset = eeg_file; cfg.trialdef.eventvalue = 65522; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 0.3; cfg = ft_definetrial(cfg); data_vep = ft_redefinetrial(cfg, data); % Baseline Correction cfg = []; cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 -0.05]; data_vep = ft_preprocessing(cfg, data_vep); %Averaging cfg=[]; avg_data = ft_timelockanalysis(cfg, data_vep); cfg.ylim = [-10 10]; cfg.channel = 'O1'; ft_singleplotER(cfg,avg_data); -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Thu Nov 13 11:13:43 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 13 Nov 2014 11:13:43 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: <040E6541-0D1E-4675-92D8-88B1578C7FE8@uni-konstanz.de> Dear Gerome, one thing you could change is keep the reference the same in both cases. So far you are referencing the data against the mastoids in BVA and a common reference in FieldTrip. This is a potential source of variance in the waveforms you’ll get. best tzvetan > Hello All, > > I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) > > > Thanks alot, > Gerome > > Here is the brain vision sequence I am trying to replicate > - Read in Data > - Reference to mastiod > - 100Hz Band rejection filter - bandwidth 8, slope 2 > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) > - Notch Filter at 50Hz > - Segmentation > - Baseline Correction -200 ms to - 5 ms > - Averaging segments > > > > Here is my Field trip code: > > %rereference all trials > cfg.reref = 'yes'; > cfg.continuous = 'yes'; > > % reference what channels > cfg.channel = 'all'; > %choose the reference channel > cfg.refchannel = {'EXG1' 'EXG2'}; > > % cfg.dataset = 'CVP1S1.bdf'; > cfg.continuous = 'yes'; > % > > %bandfilter > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; > % cfg.bsfiltdir = 'onepass-zerophase'; > cfg.bsfreq = [92 108]; > > > % > %DFT > cfg.dftfilter = 'yes'; > > % IIR Filters > cfg.lpfilter = 'yes'; > cfg.lpfilttype = 'but'; > % cfg.lpfiltdir = 'onepass-zerophase'; > cfg.lpfreq = 45; > > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > % cfg.hpfiltdir = 'onepass-zerophase'; > cfg.hpfreq = 0.53; > > data = ft_preprocessing(cfg); > > > % Define Trial > cfg = []; > cfg.trialdef.eventtype = 'STATUS'; > cfg.dataset = eeg_file; > cfg.trialdef.eventvalue = 65522; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 0.3; > cfg = ft_definetrial(cfg); > > data_vep = ft_redefinetrial(cfg, data); > > % Baseline Correction > cfg = []; > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 -0.05]; > data_vep = ft_preprocessing(cfg, data_vep); > > %Averaging > cfg=[]; > avg_data = ft_timelockanalysis(cfg, data_vep); > > > cfg.ylim = [-10 10]; > cfg.channel = 'O1'; > > ft_singleplotER(cfg,avg_data); > > -- > _____________________ > Gerome Manson PhD Student > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > Perceptual Motor Behavior lab- University of Toronto > gerome.manson at utoronto.ca > gerome.manson at univ-amu.fr > 416-978-6109 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Thu Nov 13 13:16:25 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 13 Nov 2014 12:16:25 +0000 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: <040E6541-0D1E-4675-92D8-88B1578C7FE8@uni-konstanz.de> References: <040E6541-0D1E-4675-92D8-88B1578C7FE8@uni-konstanz.de> Message-ID: <3D00B7615FB58D46A0B49B9AD67A33EB0C2076@exprd01.hosting.ru.nl> Hi Gerome and Tzvetan, Actually, you are referencing to the linked mastoids if EXG1 and EXG2 represent the mastoid channels as you specified them in cfg.refchannel. cfg.channel only specifies on what channels to apply the re-referencing on. At a first glance I can see that in Fieldtrip you are applying a band-stop filter between 92 and 108 Hz, while in BVA you are applying a band-stop filter at 100Hz with a bandwidth of 8. I am not that familiar with BVA but does that mean plus AND minus 8Hz or 8Hz around 100Hz, so 96 - 104Hz? Also, in BVA you are applying a notch filter at 50Hz, in Fieldtrip you are applying a DFT filter at 50, 100 and 150Hz. A notch filter is a band-stop filter with a narrow band (usually 1-2Hz). DFT filters try to fit and subtract sinusoids at the specified frequency. To make it more similar to BVA I would suggest a band-stop filter between 49 and 51Hz. Furthermore, in Fieldtrip you are applying Butterworth filters, is this the same filter-type applied in BVA? Additionally, in BVA your baseline is from -200 to -5ms, while in Fieldtrip you specify: cfg.baselinewindow = [-0.2 -0.05]; which is from -200 to -50ms. I hope this can help you make the analysis more similar. Could you perhaps make a picture of a result that you find is different (e.g. ERPs calculated in Fieldtrip and BVA)?. That could help identifying the exact problem if this did not help you. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Tzvetan Popov Sent: donderdag 13 november 2014 11:14 To: FieldTrip discussion list Subject: Re: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip Dear Gerome, one thing you could change is keep the reference the same in both cases. So far you are referencing the data against the mastoids in BVA and a common reference in FieldTrip. This is a potential source of variance in the waveforms you'll get. best tzvetan Hello All, I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) Thanks alot, Gerome Here is the brain vision sequence I am trying to replicate - Read in Data - Reference to mastiod - 100Hz Band rejection filter - bandwidth 8, slope 2 - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) - Notch Filter at 50Hz - Segmentation - Baseline Correction -200 ms to - 5 ms - Averaging segments Here is my Field trip code: %rereference all trials cfg.reref = 'yes'; cfg.continuous = 'yes'; % reference what channels cfg.channel = 'all'; %choose the reference channel cfg.refchannel = {'EXG1' 'EXG2'}; % cfg.dataset = 'CVP1S1.bdf'; cfg.continuous = 'yes'; % %bandfilter cfg.bsfilter = 'yes'; cfg.bsfiltord = 2; % cfg.bsfiltdir = 'onepass-zerophase'; cfg.bsfreq = [92 108]; % %DFT cfg.dftfilter = 'yes'; % IIR Filters cfg.lpfilter = 'yes'; cfg.lpfilttype = 'but'; % cfg.lpfiltdir = 'onepass-zerophase'; cfg.lpfreq = 45; cfg.hpfilter = 'yes'; cfg.hpfilttype = 'but'; % cfg.hpfiltdir = 'onepass-zerophase'; cfg.hpfreq = 0.53; data = ft_preprocessing(cfg); % Define Trial cfg = []; cfg.trialdef.eventtype = 'STATUS'; cfg.dataset = eeg_file; cfg.trialdef.eventvalue = 65522; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 0.3; cfg = ft_definetrial(cfg); data_vep = ft_redefinetrial(cfg, data); % Baseline Correction cfg = []; cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 -0.05]; data_vep = ft_preprocessing(cfg, data_vep); %Averaging cfg=[]; avg_data = ft_timelockanalysis(cfg, data_vep); cfg.ylim = [-10 10]; cfg.channel = 'O1'; ft_singleplotER(cfg,avg_data); -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From widmann at uni-leipzig.de Thu Nov 13 16:44:28 2014 From: widmann at uni-leipzig.de (Andreas Widmann) Date: Thu, 13 Nov 2014 16:44:28 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: Hi, besides the already mentioned differences, you cannot easily replicate the Brainvision Analyzer Butterworth filters with Fieldtrip. The Analyzer internally adjusts filter order *and* cutoff frequency to compensate for two-pass filtering. The (onepass) filter order actually applied by Analyzer is half the requested order. You can correspondingly reduce filter order in Fieldtrip to replicate this behavior. The (onepass) filter cutoff frequency actually applied by Analyzer is undocumented. It is adjusted so that the requested cutoff has -3dB attenuation after *twopass* filtering. You can measure the -6dB cutoff (applicable in Fieldtrip) by feeding an impulse into Analyzer and checking the frequency response. This problem is discussed here in more detail: http://www.ncbi.nlm.nih.gov/pubmed/25128257 Hope this helps, Andreas > Am 13.11.2014 um 10:07 schrieb Gerome Manson : > > Hello All, > > I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) > > > Thanks alot, > Gerome > > Here is the brain vision sequence I am trying to replicate > - Read in Data > - Reference to mastiod > - 100Hz Band rejection filter - bandwidth 8, slope 2 > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) > - Notch Filter at 50Hz > - Segmentation > - Baseline Correction -200 ms to - 5 ms > - Averaging segments > > > > Here is my Field trip code: > > %rereference all trials > cfg.reref = 'yes'; > cfg.continuous = 'yes'; > > % reference what channels > cfg.channel = 'all'; > %choose the reference channel > cfg.refchannel = {'EXG1' 'EXG2'}; > > % cfg.dataset = 'CVP1S1.bdf'; > cfg.continuous = 'yes'; > % > > %bandfilter > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; > % cfg.bsfiltdir = 'onepass-zerophase'; > cfg.bsfreq = [92 108]; > > > % > %DFT > cfg.dftfilter = 'yes'; > > % IIR Filters > cfg.lpfilter = 'yes'; > cfg.lpfilttype = 'but'; > % cfg.lpfiltdir = 'onepass-zerophase'; > cfg.lpfreq = 45; > > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > % cfg.hpfiltdir = 'onepass-zerophase'; > cfg.hpfreq = 0.53; > > data = ft_preprocessing(cfg); > > > % Define Trial > cfg = []; > cfg.trialdef.eventtype = 'STATUS'; > cfg.dataset = eeg_file; > cfg.trialdef.eventvalue = 65522; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 0.3; > cfg = ft_definetrial(cfg); > > data_vep = ft_redefinetrial(cfg, data); > > % Baseline Correction > cfg = []; > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 -0.05]; > data_vep = ft_preprocessing(cfg, data_vep); > > %Averaging > cfg=[]; > avg_data = ft_timelockanalysis(cfg, data_vep); > > > cfg.ylim = [-10 10]; > cfg.channel = 'O1'; > > ft_singleplotER(cfg,avg_data); > > -- > _____________________ > Gerome Manson PhD Student > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > Perceptual Motor Behavior lab- University of Toronto > gerome.manson at utoronto.ca > gerome.manson at univ-amu.fr > 416-978-6109 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gerome.manson at utoronto.ca Thu Nov 13 19:09:41 2014 From: gerome.manson at utoronto.ca (Gerome Manson) Date: Thu, 13 Nov 2014 19:09:41 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: Thank you for your help everyone, the solution was fairly simple (although the datasets still don't quite match up) I adjusted the baseline window and also the filters as stated in the answers by Andreas, and Jim, and changed the reference -as stated by tzvetan these changes did the trick. I do have one more question though that I couldn't quite find enough information on: Is it possible to create and eletrode pool (for instance a new channel that is the average of some channels (eg: PO3, O1 and PO7) and have it added as a new channel (in a similar way that we can create new channels for eog). Thanks again, Gerome 2014-11-13 16:44 GMT+01:00 Andreas Widmann : > Hi, > > besides the already mentioned differences, you cannot easily replicate the > Brainvision Analyzer Butterworth filters with Fieldtrip. The Analyzer > internally adjusts filter order *and* cutoff frequency to compensate for > two-pass filtering. The (onepass) filter order actually applied by Analyzer > is half the requested order. You can correspondingly reduce filter order in > Fieldtrip to replicate this behavior. The (onepass) filter cutoff frequency > actually applied by Analyzer is undocumented. It is adjusted so that the > requested cutoff has -3dB attenuation after *twopass* filtering. You can > measure the -6dB cutoff (applicable in Fieldtrip) by feeding an impulse > into Analyzer and checking the frequency response. This problem is > discussed here in more detail: > http://www.ncbi.nlm.nih.gov/pubmed/25128257 > > Hope this helps, > Andreas > > > Am 13.11.2014 um 10:07 schrieb Gerome Manson >: > > > > Hello All, > > > > I would like some help to replicate an analysis done in brain vision > analyzer in field trip. Here is the details of the analysis in brain > vision. I have done most of the code but I get almost completely different > results which is puzziling. Maybe some of the filteres are not defined > properly- so if anyone has some time I would appreciate the help :-) > > > > > > Thanks alot, > > Gerome > > > > Here is the brain vision sequence I am trying to replicate > > - Read in Data > > - Reference to mastiod > > - 100Hz Band rejection filter - bandwidth 8, slope 2 > > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, > 24db/ oct) > > - Notch Filter at 50Hz > > - Segmentation > > - Baseline Correction -200 ms to - 5 ms > > - Averaging segments > > > > > > > > Here is my Field trip code: > > > > %rereference all trials > > cfg.reref = 'yes'; > > cfg.continuous = 'yes'; > > > > % reference what channels > > cfg.channel = 'all'; > > %choose the reference channel > > cfg.refchannel = {'EXG1' 'EXG2'}; > > > > % cfg.dataset = 'CVP1S1.bdf'; > > cfg.continuous = 'yes'; > > % > > > > %bandfilter > > cfg.bsfilter = 'yes'; > > cfg.bsfiltord = 2; > > % cfg.bsfiltdir = 'onepass-zerophase'; > > cfg.bsfreq = [92 108]; > > > > > > % > > %DFT > > cfg.dftfilter = 'yes'; > > > > % IIR Filters > > cfg.lpfilter = 'yes'; > > cfg.lpfilttype = 'but'; > > % cfg.lpfiltdir = 'onepass-zerophase'; > > cfg.lpfreq = 45; > > > > cfg.hpfilter = 'yes'; > > cfg.hpfilttype = 'but'; > > % cfg.hpfiltdir = 'onepass-zerophase'; > > cfg.hpfreq = 0.53; > > > > data = ft_preprocessing(cfg); > > > > > > % Define Trial > > cfg = []; > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.dataset = eeg_file; > > cfg.trialdef.eventvalue = 65522; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 0.3; > > cfg = ft_definetrial(cfg); > > > > data_vep = ft_redefinetrial(cfg, data); > > > > % Baseline Correction > > cfg = []; > > cfg.demean = 'yes'; > > cfg.baselinewindow = [-0.2 -0.05]; > > data_vep = ft_preprocessing(cfg, data_vep); > > > > %Averaging > > cfg=[]; > > avg_data = ft_timelockanalysis(cfg, data_vep); > > > > > > cfg.ylim = [-10 10]; > > cfg.channel = 'O1'; > > > > ft_singleplotER(cfg,avg_data); > > > > -- > > _____________________ > > Gerome Manson PhD Student > > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > > Perceptual Motor Behavior lab- University of Toronto > > gerome.manson at utoronto.ca > > gerome.manson at univ-amu.fr > > 416-978-6109 > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Thu Nov 13 20:19:40 2014 From: nathanweisz at mac.com (Nathan Weisz) Date: Thu, 13 Nov 2014 20:19:40 +0100 Subject: [FieldTrip] Postdoc opportunity @Centre for Cognitive Neuroscience Salzburg Message-ID: <4E925DA8-F688-494F-B0AC-2BF31F8535C8@mac.com> I am sending this job add on behalf of Manuel Schabus. Please see attached doc-file for details and contact him directly in case of questions. -------------- next part -------------- A non-text attachment was scrubbed... Name: Stellenausschreibung_PostDoc_E REV2.doc Type: application/msword Size: 52224 bytes Desc: not available URL: From j.herring at fcdonders.ru.nl Thu Nov 13 21:50:20 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 13 Nov 2014 20:50:20 +0000 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: <121EA1A7-B55C-4E7B-AE2D-CFC3E03FA66F@donders.ru.nl> Hi Gerome, Have a look at ft_apply_montage (http://fieldtrip.fcdonders.nl/reference/ft_apply_montage), I think it will do what you want. Best, Jim On 13 Nov 2014, at 19:09, Gerome Manson > wrote: Thank you for your help everyone, the solution was fairly simple (although the datasets still don't quite match up) I adjusted the baseline window and also the filters as stated in the answers by Andreas, and Jim, and changed the reference -as stated by tzvetan these changes did the trick. I do have one more question though that I couldn't quite find enough information on: Is it possible to create and eletrode pool (for instance a new channel that is the average of some channels (eg: PO3, O1 and PO7) and have it added as a new channel (in a similar way that we can create new channels for eog). Thanks again, Gerome 2014-11-13 16:44 GMT+01:00 Andreas Widmann >: Hi, besides the already mentioned differences, you cannot easily replicate the Brainvision Analyzer Butterworth filters with Fieldtrip. The Analyzer internally adjusts filter order *and* cutoff frequency to compensate for two-pass filtering. The (onepass) filter order actually applied by Analyzer is half the requested order. You can correspondingly reduce filter order in Fieldtrip to replicate this behavior. The (onepass) filter cutoff frequency actually applied by Analyzer is undocumented. It is adjusted so that the requested cutoff has -3dB attenuation after *twopass* filtering. You can measure the -6dB cutoff (applicable in Fieldtrip) by feeding an impulse into Analyzer and checking the frequency response. This problem is discussed here in more detail: http://www.ncbi.nlm.nih.gov/pubmed/25128257 Hope this helps, Andreas > Am 13.11.2014 um 10:07 schrieb Gerome Manson >: > > Hello All, > > I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) > > > Thanks alot, > Gerome > > Here is the brain vision sequence I am trying to replicate > - Read in Data > - Reference to mastiod > - 100Hz Band rejection filter - bandwidth 8, slope 2 > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) > - Notch Filter at 50Hz > - Segmentation > - Baseline Correction -200 ms to - 5 ms > - Averaging segments > > > > Here is my Field trip code: > > %rereference all trials > cfg.reref = 'yes'; > cfg.continuous = 'yes'; > > % reference what channels > cfg.channel = 'all'; > %choose the reference channel > cfg.refchannel = {'EXG1' 'EXG2'}; > > % cfg.dataset = 'CVP1S1.bdf'; > cfg.continuous = 'yes'; > % > > %bandfilter > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; > % cfg.bsfiltdir = 'onepass-zerophase'; > cfg.bsfreq = [92 108]; > > > % > %DFT > cfg.dftfilter = 'yes'; > > % IIR Filters > cfg.lpfilter = 'yes'; > cfg.lpfilttype = 'but'; > % cfg.lpfiltdir = 'onepass-zerophase'; > cfg.lpfreq = 45; > > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > % cfg.hpfiltdir = 'onepass-zerophase'; > cfg.hpfreq = 0.53; > > data = ft_preprocessing(cfg); > > > % Define Trial > cfg = []; > cfg.trialdef.eventtype = 'STATUS'; > cfg.dataset = eeg_file; > cfg.trialdef.eventvalue = 65522; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 0.3; > cfg = ft_definetrial(cfg); > > data_vep = ft_redefinetrial(cfg, data); > > % Baseline Correction > cfg = []; > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 -0.05]; > data_vep = ft_preprocessing(cfg, data_vep); > > %Averaging > cfg=[]; > avg_data = ft_timelockanalysis(cfg, data_vep); > > > cfg.ylim = [-10 10]; > cfg.channel = 'O1'; > > ft_singleplotER(cfg,avg_data); > > -- > _____________________ > Gerome Manson PhD Student > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > Perceptual Motor Behavior lab- University of Toronto > gerome.manson at utoronto.ca > gerome.manson at univ-amu.fr > 416-978-6109 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Fri Nov 14 00:57:46 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Thu, 13 Nov 2014 15:57:46 -0800 Subject: [FieldTrip] average power Message-ID: Hello I'm using mtmfft and want the average theta power. I was under the impression that (cfg.foilim = [4 7];) would give me the average of the power between 4 and 8 Hz, however my output is in .5 Hz steps. Am I missing something? Also, if I can get the average output rather than stepwise, is there a way that I can get several bands in one pass. For example [4 7] for theta and [12 30] for beta? Thanks, Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Nov 14 01:16:17 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 14 Nov 2014 01:16:17 +0100 Subject: [FieldTrip] average power In-Reply-To: References: Message-ID: hey Brittany, I am far from being a fieldtrip profi, but as far as I can get you can either use ft_freqgrandaverage and average over frequencies (cfg.parameter='freg'), or you precise cfg.avgoverfreq = 'yes' in the ft_freqstatistics. Of course you could also change the steps of ft_freqanalysis to bigger steps... (for example cfg.foi = 7:1:31 for analysis from 7 to 31 in steps of 1 hertz cheers k 2014-11-14 0:57 GMT+01:00 Brittany Alperin : > Hello > > I'm using mtmfft and want the average theta power. I was under the > impression that (cfg.foilim = [4 7];) would give me the average of the > power between 4 and 8 Hz, however my output is in .5 Hz steps. Am I missing > something? > > Also, if I can get the average output rather than stepwise, is there a way > that I can get several bands in one pass. For example [4 7] for theta and > [12 30] for beta? > > Thanks, > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Nov 14 05:45:53 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 14 Nov 2014 04:45:53 +0000 Subject: [FieldTrip] beamformer and granger casuality Message-ID: <99973235-3756-4005-A68D-2902FC8271A7@flinders.edu.au> Hello fieldtrip, I was just wondering whether it was possible to perform a beamformer analysis on some EEG data and then perform a connectivity analysis on the source using the granger casuality method. Currently I am following the connectivity/extended tutorials and just doing granger casuality connectivity analysis on EEG data (ft_mvaranalysis-ft_freqanalysis-ft_connectivityanalysis) and its working fine, just curious to see if it works on beamformed data. >From what Ive tested so far, ft_connectivityanalysis seems to want a 'mom' field, which doesnt appear to be present when you conduct a DICS beamformer (I am aware 'mom' refers to moment, which is in the time domain). Regards, Tyler From tzvetan.popov at uni-konstanz.de Fri Nov 14 08:03:12 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 14 Nov 2014 08:03:12 +0100 Subject: [FieldTrip] average power In-Reply-To: References: Message-ID: Hi Brittany, in addition to Katrin’s suggestions you can also rug ft_freqanalysis with cfg.foi = [4:1:30];, and then call ft_selectdata twice. Once with cfg.frequency = [4 7]; cfg.avgoverfreq = ‘yes’; and accordingly for your other freq band of interest. best tzvetan > hey Brittany, I am far from being a fieldtrip profi, but as far as I can get you can either use > ft_freqgrandaverage and average over frequencies (cfg.parameter='freg'), or you precise cfg.avgoverfreq = 'yes' in the ft_freqstatistics. Of course you could also change the steps of ft_freqanalysis to bigger steps... (for example cfg.foi = 7:1:31 for analysis from 7 to 31 in steps of 1 hertz > > > > cheers k > > > 2014-11-14 0:57 GMT+01:00 Brittany Alperin : > Hello > > I'm using mtmfft and want the average theta power. I was under the impression that (cfg.foilim = [4 7];) would give me the average of the power between 4 and 8 Hz, however my output is in .5 Hz steps. Am I missing something? > > Also, if I can get the average output rather than stepwise, is there a way that I can get several bands in one pass. For example [4 7] for theta and [12 30] for beta? > > Thanks, > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 14 08:38:54 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 14 Nov 2014 08:38:54 +0100 Subject: [FieldTrip] beamformer and granger casuality In-Reply-To: <99973235-3756-4005-A68D-2902FC8271A7@flinders.edu.au> References: <99973235-3756-4005-A68D-2902FC8271A7@flinders.edu.au> Message-ID: Dear Tyler, ‘mom’ refers indeed to a moment, yet not a moment in time (-domain) but a dipole moment. The modeling of brain activity at location X as dipolar activity at that location is used in many inverse solutions including spatial filtering. You can specify cfg.keepmom = ‘yes’; and subsequently call ft_sourcedescriptives with cfg.projectmom = ‘yes’; in order to obtain the dominant orientation. good luck tzvetan > Hello fieldtrip, > > I was just wondering whether it was possible to perform a beamformer analysis on some EEG data and then perform a connectivity analysis on the source using the granger casuality method. Currently I am following the connectivity/extended tutorials and just doing granger casuality connectivity analysis on EEG data (ft_mvaranalysis-ft_freqanalysis-ft_connectivityanalysis) and its working fine, just curious to see if it works on beamformed data. > > From what Ive tested so far, ft_connectivityanalysis seems to want a 'mom' field, which doesnt appear to be present when you conduct a DICS beamformer (I am aware 'mom' refers to moment, which is in the time domain). > > Regards, > > Tyler > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From marcus.heldmann at neuro.uni-luebeck.de Fri Nov 14 12:50:20 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Fri, 14 Nov 2014 12:50:20 +0100 Subject: [FieldTrip] strange time frequency results after converting data with eeglab2fieldtrip In-Reply-To: References: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> Message-ID: <69BA0730-3891-4603-8992-8FCC164DB6E4@neuro.uni-luebeck.de> Sorry for this late reply. Yes, I can display the data and they do look like expected. The cell-structure contains label (6 entries), sample (1kHz, this is correct), elec (structure containing the electrode positions ), cell structure trial (388 trials, each containing sample x channel data), time and cfg, just containing version information like name and id. Hope this helps. Strange enough, I performed a time frequency already in EEGLAB, but I’d like to use the statistical testing. I have no idea what#s going wrong. Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 Am 07.11.2014 um 21:13 schrieb Rodrigo Montefusco : > It's hard to say at what level is the problem, for me works perfect. Can you check your data using ft_databrowser([],data) before the spectral decomposition? > Can you copy how your data structure looks like? > > Best > > On Fri, Nov 7, 2014 at 11:51 AM, Marcus Heldmann wrote: > I preprocessed my data (6 channels, 1Kz, minimum 97 trial/condition) with eeglab. Since I’d like to perform the time frequency analysis with field trip, I converted the data to field trip using the eegalb2fieldtrip function. However, after the conversion I’ve got very strange results, meaning that for most of the frequencies I get zeros or NaNs. I am wondering, if I have to change something in the file structure. Does anybody has an idea what’s wrong? > > Thanx for any help or hints, Marcus > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > From polomacnenad at gmail.com Fri Nov 14 13:18:17 2014 From: polomacnenad at gmail.com (Nenad Polomac) Date: Fri, 14 Nov 2014 13:18:17 +0100 Subject: [FieldTrip] ICA subspace reduction with PCA eigenvalues Message-ID: Dear all, I have one question regarding ICA calculation subspace. I have high pass filtered MEG data (> 30 Hz) on which I calculated ICA. I know there are different methods to limit data dimensionality by ICA calculation, usually performed by PCA prior to ICA. E.g. taking 99% of variance explained or selecting first N components... However I did it by taking specific eigenvalue (2.5^27) and assuming that all components which have eigenvalue smaller than this represented noise. Argument for this would be that eigenvalue of one component represent scale of the variance explained by this component (for example, muscle artifacts component would have high eigenvalues while noise component oscillate in narrower range, hence variance and eigenvalue would be smaller). I have found this value to result in a stable number of components of around 45 per participant which is large enough to contain most of the signal and small enough to obtain stable and meaningful ICA components. Does anybody know any studies that used this constant eigenvalue approach to limit ICA subspace? Thank you very much in advance? all the best! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From DrakesmithM at cardiff.ac.uk Fri Nov 14 14:29:29 2014 From: DrakesmithM at cardiff.ac.uk (Mark Drakesmith) Date: Fri, 14 Nov 2014 13:29:29 +0000 Subject: [FieldTrip] using megplanar on cross-spectra In-Reply-To: <5465E4BE.5020802@cardiff.ac.uk> References: <5465E4BE.5020802@cardiff.ac.uk> Message-ID: <546603B9.3070508@cardiff.ac.uk> Dear FieldTripers I want to ask a quick question about applying megplanar to cross-spectra and coherence data. I want to compute sensor-sensor connectivity after the planar transform. I can do this quite easily after doing the initial planar transformation (run ft_megplanar and ft_freqanalysis). However, when I combine the channels after ft_freqanalysis using ft_combineplanar, the crssprtm field is no longer there, only the powsptrm. I havn't tried it with the coherence spectrum yet but I'm guessing the same thing will happen there. I dont want to work on the full uncombined planar data as this is quite expensive in terms of computer resources and harder to visualise. Does anyone have advise on how best to get planar-combined cross-spectra and coherences? Many thanks Mark Mark Drakesmith CUBRIC / NMHRI, Cardiff University From arno at cerco.ups-tlse.fr Fri Nov 14 16:41:03 2014 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Fri, 14 Nov 2014 07:41:03 -0800 Subject: [FieldTrip] ICA subspace reduction with PCA eigenvalues In-Reply-To: References: Message-ID: <87A56D60-8339-4357-9B75-DBAACF9539D4@cerco.ups-tlse.fr> Hi Nehad, This is Arno from UCSD (developer of EEGLAB, the software which popularized ICA). All commercial software preprocess the data using PCA to reduce the dimensionality. This can not only bias ICA but also introduce artifacts in the data. ICA should only be done full rank if possible. You might want to contact Stepehn Shall Jones (shall-jones at infoscience.otago.ac.nz) which student Carl Leichter has written a thesis on that subject "Eigenspecters: Information Misallocation in Lossy Principal Component Reductions of Magnetoencephalographic and Electoencephalographic Data". He shows which artifacts are introduced by doing PCA before ICA. Cheers, Arno On Nov 14, 2014, at 4:18 AM, Nenad Polomac wrote: > Dear all, > > I have one question regarding ICA calculation subspace. I have high pass filtered MEG data (> 30 Hz) on which I calculated ICA. > I know there are different methods to limit data dimensionality by ICA calculation, usually performed by PCA prior to ICA. E.g. taking 99% of variance explained or selecting first N components... > However I did it by taking specific eigenvalue (2.5^27) and assuming that all components which have eigenvalue smaller than this represented noise. Argument for this would be that eigenvalue of one component represent scale of the variance explained by this component (for example, muscle artifacts component would have high eigenvalues while noise component oscillate in narrower range, hence variance and eigenvalue would be smaller). I have found this value to result in a stable number of components of around 45 per participant which is large enough to contain most of the signal and small enough to obtain stable and meaningful ICA components. > Does anybody know any studies that used this constant eigenvalue approach to limit ICA subspace? > Thank you very much in advance? > > all the best! > > Nenad > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Sun Nov 16 01:29:37 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Sun, 16 Nov 2014 01:29:37 +0100 Subject: [FieldTrip] ROI midpoint Message-ID: Dear experts, please how can I identify the midpoint of each of the region of AAL atlas. thank you Azeez A. Adebimpe "Knowledge and good manner, the beauty of a man" -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Sun Nov 16 06:32:58 2014 From: roeysc at gmail.com (Roey) Date: Sun, 16 Nov 2014 07:32:58 +0200 Subject: [FieldTrip] ROI midpoint In-Reply-To: References: Message-ID: <752FD823-1B22-4F77-9902-EC28BF688B8E@gmail.com> Dear Azeez, It depends on whether you want an actual point (whose activity you want to use, for example) or just an (x,y,z) coordinate. In the latter case you could go over all the point of a given ROI in the atlas, and compute the mean of their x value, the mean if their y value and the mean of their x value (notice that you know which coordinate system you're using, e.g. SPM). If you want an actual point that resides on the atlas grid, you can then find the point closest to the point you computed above (for example, you could use the marlab function "norm" on the difference between the two points, which would be represented as vectors). I'm not sitting in front of fieldtrip at the moment, so hopefully this made sense to you. Best, Roey ‫ב-16 בנוב׳ 2014, בשעה 02:29, ‏‏Azeez Adebimpe ‏ כתב/ה:‬ > Dear experts, > > please how can I identify the midpoint of each of the region of AAL atlas. > > thank you > > Azeez A. Adebimpe > > > "Knowledge and good manner, the beauty of a man" > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Mon Nov 17 11:12:39 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Mon, 17 Nov 2014 10:12:39 +0000 Subject: [FieldTrip] Postdoctoral research positions, University of Nottingham Message-ID: On behalf of Matt: ---------- Forwarded message ---------- From: Matthew Brookes Date: 2014-11-11 16:54 GMT+00:00 Subject: [megcommunity] Postdoctoral research positions, University of Nottingham To: MEGCOMMUNITY at jiscmail.ac.uk The Sir Peter Mansfield Magnetic Resonance Centre, University of Nottingham is seeking to recruit two Research Associate/Fellows in the field of magnetoencephalography (MEG). Successful candidates will work on developing and applying novel ways to measure and understand the intrinsic modes of functional coupling between functionally specific brain regions. Specifically, areas of development will include: i) New ways to model neural oscillations in local circuits; ii) Novel methods to characterize long range linear and non-linear coupling and iii) Measurement of dynamic changes in functional connectivity during basic sensory and cognitive tasks. In addition, since electrophysiological activity and connectivity is mediated by neurochemistry, successful candidates will also be involved in performing parallel ultra-high field (7T) magnetic resonance spectroscopy (1H and 13C) experiments in order to relate the concentration of cortical neurotransmitters (glutamate/GABA) to electrophysiological metrics in MEG. Finally these metrics will be applied in schizophrenia in order to gain new insight into how impaired network activity and connectivity underlies core symptoms. The University of Nottingham has been at the forefront of imaging since the introduction of MRI in the 1970’s. Indeed a rich history of novel developments resulted in the award of a Nobel Prize to Sir Peter Mansfield in 2003. The Sir Peter Mansfield Magnetic Resonance Centre (SPMMRC), now headed by Prof. Peter Morris, remains at the forefront of neuroimaging development with significant contributions in the fields of MRI, MEG, multi-modal imaging, and simultaneous EEG/fMRI. The Centre is equipped with a 275 channel MEG, 7T, 3T and 1.5T MR systems as well as MR compatible 64 channel EEG. In addition, a £9m investment by the Medical Research Council (announced in October 2014) will see upgrades to 7T and MEG as well as the introduction of wide bore 3T and upright MRI systems, to begin in 2015. Candidates should have a PhD (or equivalent) or be nearing completion in neuroimaging and strong interest/experience in developing methods plus an undergraduate degree in Physics, Engineering, Mathematics or appropriately related discipline. There are two fixed term posts available, one for two years and one for three years duration from 1 January 2015. Informal enquiries may be addressed to Dr Matt Brookes, tel: 0115 9515188 or email matthew.brookes at nottingham.ac.uk. Please note that applications sent directly to this email address will not be accepted. This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.chait at ucl.ac.uk Mon Nov 17 15:18:30 2014 From: m.chait at ucl.ac.uk (Chait, Maria) Date: Mon, 17 Nov 2014 14:18:30 +0000 Subject: [FieldTrip] 4 year Post-Doc position in UCL Message-ID: <19cc8ff590b3487b85373b27556c4417@DB4PR01MB0414.eurprd01.prod.exchangelabs.com> A 4 year post-doctoral research associate position is available to work on a European Council-funded project that will use psychophysics, eye tracking and EEG to investigate auditory attention. We aim to understand the brain mechanisms involved in selective attention, and create a brain-machine interface able to identify listeners attentional focus in real time. This research program is part of an international project ("Cognitively controlled Hearing Aid") which includes partners in ENS, France (Shihab Shamma, Alain de Cheveigne, Daniel Pressnitzer), DTU, Denmark (Torsten Dau), UZH, Switzerland (Shih-Chii Liu) and Oticon (Thomas Lunner) . You will be supervised by Dr Maria Chait and based at the UCL Ear Institute (http://www.ucl.ac.uk/ear/research/chaitlab). Salary (inclusive of London allowance) £33,353 - £37,152 per annum Applicants should hold a PhD degree (or equivalent) in an engineering or Neuroscience-related subject and have substantial experience in digital signal processing and computer programming. Previous experience with auditory research and/or functional brain imaging is desirable. For an informal discussion please contact Dr. Maria Chait (m.chait at ucl.ac.uk). Application should be made via the UCL website: http://www.ucl.ac.uk/hr/jobs/ (Ref:1443980). Application deadline: 07 Dec 2014. Start date: Early 2015. The UCL Ear Institute provides state-of-the-art research facilities across a wide range of disciplines and is one of the foremost centres for hearing, speech and language-related research within Europe. Maria Chait PhD m.chait at ucl.ac.uk Reader in Auditory Cognitive Neuroscience Lab site: http://www.ucl.ac.uk/ear/research/chaitlab/ UCL Ear Institute 332 Gray's Inn Road London WC1X 8EE -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Nov 18 11:53:08 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Nov 2014 11:53:08 +0100 Subject: [FieldTrip] reading in ascii files In-Reply-To: References: Message-ID: Hi Martine, You mentioned that you are already able to get it into Matlab, so my guess is that the best way to read it into FieldTrip is to get it into a generic Matlab array first, and then hack a bit to make it FT-compatible. If the data is not segmented yet, you can convert it into one big 'trial', and subsequently use ft_redefinetrial to get it segmented. A typical raw data structure would be: data = []; data.label = {'chan1'...'chanN'}; data.time = {0:1/fsample:tEnd}; data.trial = {dat}; % where dat is channel X timepoint For more details, see the help and code of ft_datatype_raw. Hope that helps! Best, Eelke On 11 November 2014 02:45, Martine van Schouwenburg wrote: > Hi all, > > > > I have been using a new (wireless and dry!) EEG cap called Enobio > (http://www.neuroelectrics.com/ ). It saves the data in a non-traditional > format called .easy files, but they are basically just ascii files that can > be read with dlmread into matlab. Is anyone aware of a way I can read these > files into Fieldtrip? I tried changing the extension to .txt, because on the > Fieldtrip website it mentions this as one of the supported data formats (for > NIRS though..), but I get the following error. > > > > Error using ft_read_header (line 1833) > > unsupported header format (ascii_txt) > > > > I guess it makes sense cause there is no header in the file. J It is just a > table with number of electrodes x number of data points. If anyone has > succeeded in the past to read in ascii files into Fieldtrip, or has any idea > on how to achieve this, I would very much appreciate your advice! > > > > Thanks! > > > > Best, > > Martine van Schouwenburg > > From eelke.spaak at donders.ru.nl Tue Nov 18 11:57:12 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Nov 2014 11:57:12 +0100 Subject: [FieldTrip] intertrial coherence estimation In-Reply-To: <19b158f3bc354e6f8f14294a05077d78@EXPRD03.hosting.ru.nl> References: <19b158f3bc354e6f8f14294a05077d78@EXPRD03.hosting.ru.nl> Message-ID: Dear Laura, Indeed, it should work the way you specified. If you did not find any other possible mistake in your script, could you file a bug on bugzilla and attach a small snippet of data and your cfg that reproduce the issue? Then we can look into it. Best, Eelke On 12 November 2014 15:54, Laura Marzetti wrote: > > Dear all, > > I want to compute the intertrial phase coherence and its variation across > trials with a one taper hanning approach as in > > > > cfg = []; > > > > cfg.output = 'fourier'; > > cfg.channel = 'all'; > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 5:2:80; > > cfg.t_ftimwin = 5./cfg.foi; > > cfg.tapsmofrq = 0.4*cfg.foi; > > cfg.toi = time_vect; > > cfg.pad = 'maxperlen'; > > cfg.keeptrials = 'yes'; > > % cfg.keeptapers = 'no'; > > freqscprm = ft_freqanalysis(cfg, data); > > tmpdat = freqscprm.fourierspctrm; > > > > tmpdat = tmpdat./abs(tmpdat); > > itc = abs(mean(tmpdat)); > > > > > > Nevertheless, the option cfg.keeptrials = 'yes'; does not seem to be applied > and the output is already the average across trials, e.g. of size nfreq x > ntimepoints and not of size ntrials x nfreq x ntimepoints as I would have > expected due to the settings for cfg.keeptrials. > > > > Can anyone suggest me how to manage the configuration in order to have > estimates in each trial as an output? > > > > Thanks, > > Laura > > > -- > Laura Marzetti, PhD > Istituto di Tecnologie Avanzate Biomediche > Università di Chieti "G. D'Annunzio" > Via dei Vestini - Campus Universitario > 66013 Chieti - ITALY > > phone: 0039-0871-3556944 > fax: 0039-0871-3556930 From jan.schoffelen at fcdonders.ru.nl Tue Nov 18 13:46:40 2014 From: jan.schoffelen at fcdonders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 18 Nov 2014 12:46:40 +0000 Subject: [FieldTrip] intertrial coherence estimation In-Reply-To: References: <19b158f3bc354e6f8f14294a05077d78@EXPRD03.hosting.ru.nl> Message-ID: Please don’t file a bug on bugzilla because it’s a misconception that intertrial coherence can be estimated at the level of the single trials and not a bug. By definition it is defined across trials (as multiple previous threads on this list have discussed). If you want to get a variance estimate, you should use a jackknife approach or something similar. The only reason why I can think of you ending up without more than 1 trial in the output of ft_freqanalysis is that you only had 1 trial in the input. If you want to get multiple ’trials’ from a single long trial, please use ft_redefinetrial and subsequently cfg.method = ‘mtmfft’ in ft_freqanalysis. Jan-Mathijs On Nov 18, 2014, at 11:57 AM, Eelke Spaak wrote: > Dear Laura, > > Indeed, it should work the way you specified. If you did not find any > other possible mistake in your script, could you file a bug on > bugzilla and attach a small snippet of data and your cfg that > reproduce the issue? Then we can look into it. > > Best, > Eelke > > On 12 November 2014 15:54, Laura Marzetti wrote: >> >> Dear all, >> >> I want to compute the intertrial phase coherence and its variation across >> trials with a one taper hanning approach as in >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'fourier'; >> >> cfg.channel = 'all'; >> >> cfg.method = 'mtmconvol'; >> >> cfg.taper = 'hanning'; >> >> cfg.foi = 5:2:80; >> >> cfg.t_ftimwin = 5./cfg.foi; >> >> cfg.tapsmofrq = 0.4*cfg.foi; >> >> cfg.toi = time_vect; >> >> cfg.pad = 'maxperlen'; >> >> cfg.keeptrials = 'yes'; >> >> % cfg.keeptapers = 'no'; >> >> freqscprm = ft_freqanalysis(cfg, data); >> >> tmpdat = freqscprm.fourierspctrm; >> >> >> >> tmpdat = tmpdat./abs(tmpdat); >> >> itc = abs(mean(tmpdat)); >> >> >> >> >> >> Nevertheless, the option cfg.keeptrials = 'yes'; does not seem to be applied >> and the output is already the average across trials, e.g. of size nfreq x >> ntimepoints and not of size ntrials x nfreq x ntimepoints as I would have >> expected due to the settings for cfg.keeptrials. >> >> >> >> Can anyone suggest me how to manage the configuration in order to have >> estimates in each trial as an output? >> >> >> >> Thanks, >> >> Laura >> >> >> -- >> Laura Marzetti, PhD >> Istituto di Tecnologie Avanzate Biomediche >> Università di Chieti "G. D'Annunzio" >> Via dei Vestini - Campus Universitario >> 66013 Chieti - ITALY >> >> phone: 0039-0871-3556944 >> fax: 0039-0871-3556930 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Tue Nov 18 13:59:43 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Nov 2014 13:59:43 +0100 Subject: [FieldTrip] FieldTrip data format In-Reply-To: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl> References: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl> Message-ID: Dear Xiong Xiao, First, in general, I would recommend you send questions like this to the general FieldTrip mailing list (cc), instead of to any of the developers personally. Responses on the general list will usually be faster, and will benefit other FieldTrip users as well. See here: http://fieldtrip.fcdonders.nl/discussion_list for instructions how to register. Then, I have never worked with the spike data formats, so I cannot tell you how to import them into FieldTrip. You could have a look at the various ft_datatype_xxx functions, which outline the structure of the data format. Best, Eelke On 10 November 2014 15:06, Xiong Xiao wrote: > Hi Eelke, > Sorry to trouble you, but I really want to use FieldTrip for my data > analysis. I am a graduate student from the Institute of Neuroscience, > Shanghai. I am a new FieldTrp user with good programming skills. But I > totally do not know how to convert my raw data (spikes, LFP and events) into > appropriate format for using FieldTrip. So I converted my data (spikes, LFP > and events) into .nex format. However, error occured when I read the events > from .nex files; but it was OK to read spikes. > > BTW, the data was converted to .nex files by using the toolbox provided by > NeuroExplorer. > > spike = ft_read_spike('xx1_SpikeEvents.nex'); > cfg = []; > cfg.spikechannel = {'N1xx1', 'N1xx3'}; % select only the two single units > spike = ft_spike_select(cfg, spike); > > event = ft_read_event('xx1_SpikeEvents.nex'); % there is error here > > > Error message: > Attempted to access adindx(1); index out of bounds because numel(adindx)=0. > > Error in read_nex_event (line 38) > smpfrq = hdr.varheader(adindx(1)).wfrequency; > > Error in ft_read_event (line 1528) > event = read_nex_event(filename); > > > Still I think this is not so convenient to convert my data into .nex files > and then to process it. Is there some other ways to convert the data into > appropriate formats? > > The structure of my data is like this: > > (1) Spikes: cell structure, { n*1 vector (timestamps) } > > (2) Waveform: cell structure, { n*4*32 matrix (waveforms for tetrodes)} > > (2) Events: m*2 matrix (the first column is the onset time of events, and > the second column is the duration of each event) > > (3) LFP: lfp (1*n vector, voltage of the LFP signal), lfp_time (1*n vector, > time of the LFP signal) > > > > Thank you for your time. > > Best regards, > Xiong Xiao > > ________________________________ > ************************************************* > PhD student > Lab of Neural Circuits and Animal Behavior > Institute of Neuroscience, Chinese Academy of Sciences > Room A0738, The New Life Science Building > 320, Yue Yang Road > Shanghai 200031, China > Email: xxiong at ion.ac.cn > Phone: 86-21-54921769 > Web: http://www.ion.ac.cn/laboratories/int.asp?id=46 > ************************************************* From sarita.tamang at mssm.edu Tue Nov 18 15:27:30 2014 From: sarita.tamang at mssm.edu (Tamang, Sarita) Date: Tue, 18 Nov 2014 14:27:30 +0000 Subject: [FieldTrip] FieldTrip data format In-Reply-To: References: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl>, Message-ID: <284E8105C3E44A4EA4C52972E5D13E8836C4BC@EXCHMBXCSM2.ExchMail.mssm.edu> Hi All, I had the same problem as I couldn't convert my LFP data into the field-trip format. I kept getting problems with defining trials. Any input on this would be very helpful. Thank you, Sarita ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Tuesday, November 18, 2014 7:59 AM To: Xiong Xiao Cc: Email discussion list for the FieldTrip project Subject: Re: [FieldTrip] FieldTrip data format Dear Xiong Xiao, First, in general, I would recommend you send questions like this to the general FieldTrip mailing list (cc), instead of to any of the developers personally. Responses on the general list will usually be faster, and will benefit other FieldTrip users as well. See here: https://urldefense.proofpoint.com/v2/url?u=http-3A__fieldtrip.fcdonders.nl_discussion-5Flist&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=xff7mp7yN1139dfVCzoRkmhWTwB1tTM97tyVCAxNb8U&e= for instructions how to register. Then, I have never worked with the spike data formats, so I cannot tell you how to import them into FieldTrip. You could have a look at the various ft_datatype_xxx functions, which outline the structure of the data format. Best, Eelke On 10 November 2014 15:06, Xiong Xiao wrote: > Hi Eelke, > Sorry to trouble you, but I really want to use FieldTrip for my data > analysis. I am a graduate student from the Institute of Neuroscience, > Shanghai. I am a new FieldTrp user with good programming skills. But I > totally do not know how to convert my raw data (spikes, LFP and events) into > appropriate format for using FieldTrip. So I converted my data (spikes, LFP > and events) into .nex format. However, error occured when I read the events > from .nex files; but it was OK to read spikes. > > BTW, the data was converted to .nex files by using the toolbox provided by > NeuroExplorer. > > spike = ft_read_spike('xx1_SpikeEvents.nex'); > cfg = []; > cfg.spikechannel = {'N1xx1', 'N1xx3'}; % select only the two single units > spike = ft_spike_select(cfg, spike); > > event = ft_read_event('xx1_SpikeEvents.nex'); % there is error here > > > Error message: > Attempted to access adindx(1); index out of bounds because numel(adindx)=0. > > Error in read_nex_event (line 38) > smpfrq = hdr.varheader(adindx(1)).wfrequency; > > Error in ft_read_event (line 1528) > event = read_nex_event(filename); > > > Still I think this is not so convenient to convert my data into .nex files > and then to process it. Is there some other ways to convert the data into > appropriate formats? > > The structure of my data is like this: > > (1) Spikes: cell structure, { n*1 vector (timestamps) } > > (2) Waveform: cell structure, { n*4*32 matrix (waveforms for tetrodes)} > > (2) Events: m*2 matrix (the first column is the onset time of events, and > the second column is the duration of each event) > > (3) LFP: lfp (1*n vector, voltage of the LFP signal), lfp_time (1*n vector, > time of the LFP signal) > > > > Thank you for your time. > > Best regards, > Xiong Xiao > > ________________________________ > ************************************************* > PhD student > Lab of Neural Circuits and Animal Behavior > Institute of Neuroscience, Chinese Academy of Sciences > Room A0738, The New Life Science Building > 320, Yue Yang Road > Shanghai 200031, China > Email: xxiong at ion.ac.cn > Phone: 86-21-54921769 > Web: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ion.ac.cn_laboratories_int.asp-3Fid-3D46&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=SPtddSTcRAxVHLC13eNxpQiAypQksJ9BrQpLZq6h3zU&e= > ************************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=Rq0Z-baW1Wo6TdBuJ8U4pVOYUQI9LUEiIkEcL7k1Ud4&e= From sarita.tamang at mssm.edu Tue Nov 18 15:27:30 2014 From: sarita.tamang at mssm.edu (Tamang, Sarita) Date: Tue, 18 Nov 2014 14:27:30 +0000 Subject: [FieldTrip] FieldTrip data format In-Reply-To: References: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl>, Message-ID: <284E8105C3E44A4EA4C52972E5D13E8836C4BC@EXCHMBXCSM2.ExchMail.mssm.edu> Hi All, I had the same problem as I couldn't convert my LFP data into the field-trip format. I kept getting problems with defining trials. Any input on this would be very helpful. Thank you, Sarita ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Tuesday, November 18, 2014 7:59 AM To: Xiong Xiao Cc: Email discussion list for the FieldTrip project Subject: Re: [FieldTrip] FieldTrip data format Dear Xiong Xiao, First, in general, I would recommend you send questions like this to the general FieldTrip mailing list (cc), instead of to any of the developers personally. Responses on the general list will usually be faster, and will benefit other FieldTrip users as well. See here: https://urldefense.proofpoint.com/v2/url?u=http-3A__fieldtrip.fcdonders.nl_discussion-5Flist&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=xff7mp7yN1139dfVCzoRkmhWTwB1tTM97tyVCAxNb8U&e= for instructions how to register. Then, I have never worked with the spike data formats, so I cannot tell you how to import them into FieldTrip. You could have a look at the various ft_datatype_xxx functions, which outline the structure of the data format. Best, Eelke On 10 November 2014 15:06, Xiong Xiao wrote: > Hi Eelke, > Sorry to trouble you, but I really want to use FieldTrip for my data > analysis. I am a graduate student from the Institute of Neuroscience, > Shanghai. I am a new FieldTrp user with good programming skills. But I > totally do not know how to convert my raw data (spikes, LFP and events) into > appropriate format for using FieldTrip. So I converted my data (spikes, LFP > and events) into .nex format. However, error occured when I read the events > from .nex files; but it was OK to read spikes. > > BTW, the data was converted to .nex files by using the toolbox provided by > NeuroExplorer. > > spike = ft_read_spike('xx1_SpikeEvents.nex'); > cfg = []; > cfg.spikechannel = {'N1xx1', 'N1xx3'}; % select only the two single units > spike = ft_spike_select(cfg, spike); > > event = ft_read_event('xx1_SpikeEvents.nex'); % there is error here > > > Error message: > Attempted to access adindx(1); index out of bounds because numel(adindx)=0. > > Error in read_nex_event (line 38) > smpfrq = hdr.varheader(adindx(1)).wfrequency; > > Error in ft_read_event (line 1528) > event = read_nex_event(filename); > > > Still I think this is not so convenient to convert my data into .nex files > and then to process it. Is there some other ways to convert the data into > appropriate formats? > > The structure of my data is like this: > > (1) Spikes: cell structure, { n*1 vector (timestamps) } > > (2) Waveform: cell structure, { n*4*32 matrix (waveforms for tetrodes)} > > (2) Events: m*2 matrix (the first column is the onset time of events, and > the second column is the duration of each event) > > (3) LFP: lfp (1*n vector, voltage of the LFP signal), lfp_time (1*n vector, > time of the LFP signal) > > > > Thank you for your time. > > Best regards, > Xiong Xiao > > ________________________________ > ************************************************* > PhD student > Lab of Neural Circuits and Animal Behavior > Institute of Neuroscience, Chinese Academy of Sciences > Room A0738, The New Life Science Building > 320, Yue Yang Road > Shanghai 200031, China > Email: xxiong at ion.ac.cn > Phone: 86-21-54921769 > Web: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ion.ac.cn_laboratories_int.asp-3Fid-3D46&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=SPtddSTcRAxVHLC13eNxpQiAypQksJ9BrQpLZq6h3zU&e= > ************************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=Rq0Z-baW1Wo6TdBuJ8U4pVOYUQI9LUEiIkEcL7k1Ud4&e= From marcus.heldmann at neuro.uni-luebeck.de Wed Nov 19 09:58:08 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Wed, 19 Nov 2014 09:58:08 +0100 Subject: [FieldTrip] tfa produces zeros Message-ID: Dear all, I have a dataset with surface and local field potential recordings and I’d like to perform a tfa. The data are recorded with a BrainVision Recorder, 1KHz sampling frequency, bp 0.05-200Hz. After epoching (-1 to 2 s), filtering (bsfilter 49:51, lpfilter 70) and baseline correction I tried to perform a tfa using a wavelet analysis described in the tutorial (http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis, Time-frequency analysis IV). However, the powspctrm-field just contains NaNs (which is ok) and zeros (not ok). The data seem to be correct, I am able to plot single trials. The strange thing is, that my EEGLAB analysis provides some meaningful results. You can fined the preprocessed data for one condition under the following link https://drive.google.com/file/d/0B4-NxS-suG8dOXZnVHcxUDFyYXM/view?usp=sharing Any idea, why this happen’s? Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 From sarathykousik at gmail.com Wed Nov 19 10:12:29 2014 From: sarathykousik at gmail.com (kousik sarathy) Date: Wed, 19 Nov 2014 10:12:29 +0100 Subject: [FieldTrip] tfa produces zeros In-Reply-To: References: Message-ID: Dear Marcus, I tried running the "data_clean" through the same snippet of code (IV). It works fine for me. Could post the exact code you used? -- Regards, Kousik Sarathy, S On Wed, Nov 19, 2014 at 9:58 AM, Marcus Heldmann < marcus.heldmann at neuro.uni-luebeck.de> wrote: > Dear all, > I have a dataset with surface and local field potential recordings and I’d > like to perform a tfa. The data are recorded with a BrainVision Recorder, > 1KHz sampling frequency, bp 0.05-200Hz. After epoching (-1 to 2 s), > filtering (bsfilter 49:51, lpfilter 70) and baseline correction I tried to > perform a tfa using a wavelet analysis described in the tutorial ( > http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis, > Time-frequency analysis IV). However, the powspctrm-field just contains > NaNs (which is ok) and zeros (not ok). The data seem to be correct, I am > able to plot single trials. The strange thing is, that my EEGLAB analysis > provides some meaningful results. You can fined the preprocessed data for > one condition under the following link > > > https://drive.google.com/file/d/0B4-NxS-suG8dOXZnVHcxUDFyYXM/view?usp=sharing > > Any idea, why this happen’s? > > Greetings, Marcus > > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.heldmann at neuro.uni-luebeck.de Wed Nov 19 10:40:08 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Wed, 19 Nov 2014 10:40:08 +0100 Subject: [FieldTrip] tfa produces zeros In-Reply-To: References: Message-ID: <62B835A2-EFFD-47D0-90EA-FF26A6F63F8D@neuro.uni-luebeck.de> I used this code cfg = []; cfg.channel = '1_Fz'; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 1:2:30; cfg.toi = -0.5:0.05:1.5; TFRwave = ft_freqanalysis(cfg, data_clean); Thanks, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 Am 19.11.2014 um 10:12 schrieb kousik sarathy : > Dear Marcus, > > I tried running the "data_clean" through the same snippet of code (IV). It works fine for me. > > Could post the exact code you used? > > -- > Regards, > Kousik Sarathy, S > > > On Wed, Nov 19, 2014 at 9:58 AM, Marcus Heldmann wrote: > Dear all, > I have a dataset with surface and local field potential recordings and I’d like to perform a tfa. The data are recorded with a BrainVision Recorder, 1KHz sampling frequency, bp 0.05-200Hz. After epoching (-1 to 2 s), filtering (bsfilter 49:51, lpfilter 70) and baseline correction I tried to perform a tfa using a wavelet analysis described in the tutorial (http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis, Time-frequency analysis IV). However, the powspctrm-field just contains NaNs (which is ok) and zeros (not ok). The data seem to be correct, I am able to plot single trials. The strange thing is, that my EEGLAB analysis provides some meaningful results. You can fined the preprocessed data for one condition under the following link > > https://drive.google.com/file/d/0B4-NxS-suG8dOXZnVHcxUDFyYXM/view?usp=sharing > > Any idea, why this happen’s? > > Greetings, Marcus > > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > From marcus.heldmann at neuro.uni-luebeck.de Wed Nov 19 13:06:18 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Wed, 19 Nov 2014 13:06:18 +0100 Subject: [FieldTrip] tfa produces zeros Message-ID: Dear all, thanks to kousik saraty my problem is solved. I used the field trip lite version instead of the full version. With the full version, the expected results appear. Thanks for the kind and patient support, Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 From ma447 at leicester.ac.uk Wed Nov 19 13:48:11 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 12:48:11 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam -------------- next part -------------- An HTML attachment was scrubbed... URL: From ma447 at leicester.ac.uk Wed Nov 19 14:00:30 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 13:00:30 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk>, <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BB9BB6@exp-dag1-n2.uol.le.ac.uk> ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Wednesday, November 19, 2014 12:48 PM To: fieldtrip at science.ru.nl Subject: FW: problem with my data Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Wed Nov 19 15:52:33 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Wed, 19 Nov 2014 14:52:33 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> Message-ID: Dear Maryam, It should be: cfg=ft_databrowser(cfg,avgdata2) not cfg=ft_databrowser(avgdata2,cfg) Best, Johanna 2014-11-19 12:48 GMT+00:00 Ahmadi Shapourabadi, Maryam (Dr.) < ma447 at leicester.ac.uk>: > Dear Sir/Madam, > > I am new to feildtrip and I wanted to start analyzing my data using the > field trip. I have 64 channels of EEG recordings and I tried to convert my > data to fieldtrip cell type to be able to browse the data > using ft_databrowser, but there is a problem and I am not sure if it > because of my data format or some other problems. I have reported the error > and the structure of my data in the following. > Please do me a favor and check my data and help me with this issue. > > Regards, > Maryam > ------------------------------ > *From:* Ahmadi Shapourabadi, Maryam (Dr.) > *Sent:* Tuesday, November 18, 2014 6:20 PM > *To:* fieldtrip at science.ru.nl > *Subject:* problem with my data > > Dear Sir/Madam, > > I have tried to browse my data in fieldtrip but have got the following > error: > > cfg=ft_databrowser(avgdata2,cfg) > ??? Warning: Struct field assignment overwrites a value with class > "single". > See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As > Structures Displays Warning for details. > > In utilities\private\ft_preamble_provenance at 54 > In ft_preamble at 54 > In ft_databrowser at 138 > ??? Error using ==> ft_checkdata at 462 > This function requires raw+comp or raw data as input. > > Error in ==> ft_databrowser at 261 > data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, > 'feedback', 'yes', 'hassampleinfo', 'yes'); > > This is my data: > ftdata2 = > > trial: {1x251 cell} > time: {1x251 cell} > fsample: 512 > label: {1x64 cell} > > trial is single. I changed to double by the command 'double', but I got > similar error: > > cfg=ft_databrowser(avgdata2,cfg) > ??? Warning: Struct field assignment overwrites a value with class > "single". > See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As > Structures Displays Warning for details. > > In utilities\private\ft_preamble_provenance at 54 > In ft_preamble at 54 > In ft_databrowser at 138 > ??? Error using ==> ft_checkdata at 462 > This function requires raw+comp or raw data as input. > > Error in ==> ft_databrowser at 261 > data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, > 'feedback', 'yes', 'hassampleinfo', 'yes'); > > > detail of my data: > > ftdata2.trial > > ans = > > Columns 1 through 3 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 4 through 6 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 7 through 9 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 10 through 12 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 13 through 15 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 16 through 18 > ... > > ftdata2.trial > > ans = > > Columns 1 through 3 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 4 through 6 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 7 through 9 > .... > > ftdata2.fsample > > ans = > > 512 > > > Could you please help me with this problem? > > Regards, > Maryam > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From emmanuelle.kristensen at gipsa-lab.grenoble-inp.fr Wed Nov 19 16:04:23 2014 From: emmanuelle.kristensen at gipsa-lab.grenoble-inp.fr (Emmanuelle Kristensen) Date: Wed, 19 Nov 2014 16:04:23 +0100 Subject: [FieldTrip] offset between eeglab and fieldtrip Message-ID: <2395D5EC-A4C2-43E9-B78C-1206E73C8B8E@gipsa-lab.grenoble-inp.fr> Hi, I am a new user of fieldtrip. I made ICA with Eeglab, then I saved the signal in BrainAmp format (.dat,.vrmk .vhdr). I opened it in fieldtrip with ft_preprocessing. And when I compare the signal opened in Eeglab with the signal opened in fieldtrip, I have an offset for amplitude, for each channel, between the two signals. Does anyone know why? Regards, Emmanuelle -------------- next part -------------- An HTML attachment was scrubbed... URL: From ma447 at leicester.ac.uk Wed Nov 19 16:23:42 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 15:23:42 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk>, Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BB9C1A@exp-dag1-n2.uol.le.ac.uk> Dear Johanna, Thanks for your reply. I tried it but got the same error: cfg=ft_databrowser(cfg,avgdata2) ??? Error using ==> ft_checkdata at 442 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 257 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Bests, Maryam ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Johanna Zumer [johanna.zumer at gmail.com] Sent: Wednesday, November 19, 2014 2:52 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] FW: problem with my data Dear Maryam, It should be: cfg=ft_databrowser(cfg,avgdata2) not cfg=ft_databrowser(avgdata2,cfg) Best, Johanna 2014-11-19 12:48 GMT+00:00 Ahmadi Shapourabadi, Maryam (Dr.) >: Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From poil.simonshlomo at gmail.com Wed Nov 19 16:51:47 2014 From: poil.simonshlomo at gmail.com (Simon-Shlomo Poil) Date: Wed, 19 Nov 2014 15:51:47 +0000 Subject: [FieldTrip] offset between eeglab and fieldtrip References: <2395D5EC-A4C2-43E9-B78C-1206E73C8B8E@gipsa-lab.grenoble-inp.fr> Message-ID: Dear Emmanuelle, Did you maybe apply a filter somewhere in the process. Otherwise it sounds as a bug. Simon On Wed, Nov 19, 2014, 16:05 Emmanuelle Kristensen < emmanuelle.kristensen at gipsa-lab.grenoble-inp.fr> wrote: > Hi, > I am a new user of fieldtrip. I made ICA with Eeglab, then I saved the > signal in BrainAmp format (.dat,.vrmk .vhdr). > I opened it in fieldtrip with ft_preprocessing. And when I compare the > signal opened in Eeglab with the signal opened in fieldtrip, I have an > offset for amplitude, for each channel, between the two signals. > Does anyone know why? > > Regards, > Emmanuelle > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ma447 at leicester.ac.uk Wed Nov 19 17:00:26 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 16:00:26 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9C1A@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk>, , <05F556AD0303584F8A24EE56D63FEE2714BB9C1A@exp-dag1-n2.uol.le.ac.uk> Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BBAC42@exp-dag1-n2.uol.le.ac.uk> Johanna, I had a problem in my data that I fixed and tried what you mentioned one more time and it worked. Thanks, Maryam ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Ahmadi Shapourabadi, Maryam (Dr.) [ma447 at leicester.ac.uk] Sent: Wednesday, November 19, 2014 3:23 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] FW: problem with my data Dear Johanna, Thanks for your reply. I tried it but got the same error: cfg=ft_databrowser(cfg,avgdata2) ??? Error using ==> ft_checkdata at 442 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 257 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Bests, Maryam ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Johanna Zumer [johanna.zumer at gmail.com] Sent: Wednesday, November 19, 2014 2:52 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] FW: problem with my data Dear Maryam, It should be: cfg=ft_databrowser(cfg,avgdata2) not cfg=ft_databrowser(avgdata2,cfg) Best, Johanna 2014-11-19 12:48 GMT+00:00 Ahmadi Shapourabadi, Maryam (Dr.) >: Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.dinov13 at imperial.ac.uk Wed Nov 19 17:24:43 2014 From: m.dinov13 at imperial.ac.uk (Martin Dinov) Date: Wed, 19 Nov 2014 16:24:43 +0000 Subject: [FieldTrip] About huge delay for ft_read_data to return Message-ID: <546CC44B.1040800@imperial.ac.uk> Dear all, I'm trying to do something with realtime EEG data and I'm using the ft_read_data function get data from BrainVision Recorder via rda2ft. In MATLAB, calling ft_read_data seems to always take >=500ms (even for a single sample point from data with srate of 1000Hz) which is unacceptably slow for what I want to do. Perhaps specifying channel indices to read only some of the data would speed it up, but I haven't managed to get this to work. As I am trying to phase lock to the alpha band, I need to be able to read in single sample points (after an initial larger block that can take longer) much quicker than 500ms (<50ms). I highly appreciate any help with this! Thanks in advance -- Martin Dinov, MSc PhD postgraduate Imperial College London Computational, Cognitive and Clinical Neuroimaging Laboratory 3rd Floor, Burlington Danes Building, Hammersmith Hospital Du Cane Road London W12 0NN From a.maye at uke.de Thu Nov 20 10:13:59 2014 From: a.maye at uke.de (Alexander Maye) Date: Thu, 20 Nov 2014 10:13:59 +0100 Subject: [FieldTrip] About huge delay for ft_read_data to return In-Reply-To: <546CC44B.1040800@imperial.ac.uk> References: <546CC44B.1040800@imperial.ac.uk> Message-ID: <1828503.8MUoyVSXsK@mars.neurophys.uke.uni-hamburg.de> Hi Martin, if I remember correctly, it helps to read the header once (ft_read_header) and then pass it to the ft_read_data calls. For continuous reading you need to update the sample information inside the header struct with the data from ft_poll_buffer. Best, ALEX. Am Mittwoch, 19. November 2014, 16:24:43 schrieb Martin Dinov: > Dear all, > > I'm trying to do something with realtime EEG data and I'm using the > ft_read_data function get data from BrainVision Recorder via rda2ft. In > MATLAB, calling ft_read_data seems to always take >=500ms (even for a > single sample point from data with srate of 1000Hz) which is > unacceptably slow for what I want to do. Perhaps specifying channel > indices to read only some of the data would speed it up, but I haven't > managed to get this to work. As I am trying to phase lock to the alpha > band, I need to be able to read in single sample points (after an > initial larger block that can take longer) much quicker than 500ms > (<50ms). I highly appreciate any help with this! > > Thanks in advance -------------- next part -------------- -- DANKE FÜR 125 JAHRE ENGAGEMENT UND VERTRAUEN. www.uke.de/125 _____________________________________________________________________ Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING From j.herring at fcdonders.ru.nl Thu Nov 20 16:38:23 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 20 Nov 2014 15:38:23 +0000 Subject: [FieldTrip] tfa produces zeros In-Reply-To: References: Message-ID: <3D00B7615FB58D46A0B49B9AD67A33EB0D5D7C@exprd01.hosting.ru.nl> Dear Marcus (and all), The problem occurred due to a recently introduced (and now fixed) bug causing problems with single-channel data. The issue should be fixed in the most recent versions of FieldTrip (also Lite). Best, Jim -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Marcus Heldmann Sent: woensdag 19 november 2014 13:06 To: FieldTrip discussion list Subject: [FieldTrip] tfa produces zeros Dear all, thanks to kousik saraty my problem is solved. I used the field trip lite version instead of the full version. With the full version, the expected results appear. Thanks for the kind and patient support, Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Fri Nov 21 10:09:27 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Fri, 21 Nov 2014 09:09:27 +0000 Subject: [FieldTrip] Averaging on a random sample Message-ID: Dear Fieldtrippers, I have a sample of 350 trials for one condition, but for statistical analysis reasons I would like to split randomly this sample in two and average these two parts. so, I used the "randsample" matlab function which seems to work very well and then I averaged this selected sample: randomhalf = randsample(cleandata.trial, 175); avgFCMiddleRing = ft_timelockanalysis(cfg, randomhalf); However, I have the following error message : Error using ft_checkdata (line 366) This function requires raw or comp data as input. Error in ft_timelockanalysis (line 105) data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Does anyone have a solution to fix the problem? Thank you very much! Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Nov 21 10:29:10 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 21 Nov 2014 10:29:10 +0100 Subject: [FieldTrip] Averaging on a random sample In-Reply-To: <8d9e856a862b4df1a4d98b40c1e18b48@EXPRD01.hosting.ru.nl> References: <8d9e856a862b4df1a4d98b40c1e18b48@EXPRD01.hosting.ru.nl> Message-ID: Dear Emilie, You are not providing a FT data structure to ft_timelockanalysis (which you should), instead you are providing the raw cell array of trials (which you shouldn't). Hence, FT complains that the data is not in a structure that it can work with. There is a cfg-option cfg.trials, which you might like to use instead. Best, Eelke On 21 November 2014 10:09, Caspar, Emilie wrote: > Dear Fieldtrippers, > > I have a sample of 350 trials for one condition, but for statistical > analysis reasons I would like to split randomly this sample in two and > average these two parts. > > so, I used the "randsample" matlab function which seems to work very well > and then I averaged this selected sample: > > randomhalf = randsample(cleandata.trial, 175); > avgFCMiddleRing = ft_timelockanalysis(cfg, randomhalf); > > > However, I have the following error message : > > Error using ft_checkdata (line 366) > This function requires raw or comp data as input. > > Error in ft_timelockanalysis (line 105) > data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', > 'hassampleinfo', 'yes'); > > Does anyone have a solution to fix the problem? > > Thank you very much! > > Emilie > > From tyler.grummett at flinders.edu.au Mon Nov 24 12:56:49 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 24 Nov 2014 11:56:49 +0000 Subject: [FieldTrip] Thank you for your suggestions In-Reply-To: References: Message-ID: <7EE9068F-7277-44D9-B782-2E307BCB06D8@flinders.edu.au> What specifically did you want to know about the process? Plus I think the go is to include the mailing list so that others can help/benefit from our discussion. Tyler Sent from my iPhone > On 24 Nov 2014, at 6:07 pm, Jing Wang wrote: > > Dear Tyler, > > I am one of Fieldtrip users, just like you are. > > I have been trying to do source analysis of EEG with MRI template recently. I met a problem as you met, which posted in the fieldtrip mailist in July. In the mailist, I did not know whether your problem has been solve or not. Do you mind telling me how do you sovled or giving me your code of source analysis if you have solved it? > Your help are really apprecited. > > Best wishes > > Jing Wang From m.dinov13 at imperial.ac.uk Mon Nov 24 13:03:57 2014 From: m.dinov13 at imperial.ac.uk (Martin Dinov) Date: Mon, 24 Nov 2014 12:03:57 +0000 Subject: [FieldTrip] About huge delay for ft_read_data to return In-Reply-To: <1828503.8MUoyVSXsK@mars.neurophys.uke.uni-hamburg.de> References: <546CC44B.1040800@imperial.ac.uk> <1828503.8MUoyVSXsK@mars.neurophys.uke.uni-hamburg.de> Message-ID: <54731EAD.4040106@imperial.ac.uk> Hi Alex, Apology for late reply. This fixed the issue. Thanks a lot! Kind regards, Martin On 11/20/14, 9:13 AM, Alexander Maye wrote: > Hi Martin, > > if I remember correctly, it helps to read the header once (ft_read_header) and > then pass it to the ft_read_data calls. For continuous reading you need to > update the sample information inside the header struct with the data from > ft_poll_buffer. > > Best, > > ALEX. > > Am Mittwoch, 19. November 2014, 16:24:43 schrieb Martin Dinov: >> Dear all, >> >> I'm trying to do something with realtime EEG data and I'm using the >> ft_read_data function get data from BrainVision Recorder via rda2ft. In >> MATLAB, calling ft_read_data seems to always take >=500ms (even for a >> single sample point from data with srate of 1000Hz) which is >> unacceptably slow for what I want to do. Perhaps specifying channel >> indices to read only some of the data would speed it up, but I haven't >> managed to get this to work. As I am trying to phase lock to the alpha >> band, I need to be able to read in single sample points (after an >> initial larger block that can take longer) much quicker than 500ms >> (<50ms). I highly appreciate any help with this! >> >> Thanks in advance >> >> >> -- >> >> DANKE FÜR 125 JAHRE ENGAGEMENT UND VERTRAUEN. >> www.uke.de/125 >> _____________________________________________________________________ >> >> Besuchen Sie uns auf: www.uke.de >> _____________________________________________________________________ >> >> Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg >> Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik >> _____________________________________________________________________ >> >> SAVE PAPER - THINK BEFORE PRINTING >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.debener at uni-oldenburg.de Tue Nov 25 13:05:28 2014 From: stefan.debener at uni-oldenburg.de (Stefan Debener) Date: Tue, 25 Nov 2014 13:05:28 +0100 Subject: [FieldTrip] Postdoctoral Research Associate in brain-computer interfaces Message-ID: <54747088.4030308@uni-oldenburg.de> The Neuropsychology Lab at the University of Oldenburg (Germany) is seeking to fill the position of a *Postdoctoral Research Associate / Research Associate **(wissenschaftliche Mitarbeiterin / wissenschaftlicher Mitarbeiter, E13 TV-L, 100%).* We are seeking a postdoctoral research associate with a strong background in brain-computer interfaces (BCI). The project involves the development of a fully mobile auditory BCI. A key focus will be in the development and evaluation of unobtrusive EEG acquisition technology that is motion-tolerant and can be used in daily-life situations for the monitoring of auditory attention and cognitive states. The Neuropsychology Lab conducts research into the underpinnings of higher visual, auditory and motor functions. We apply non-invasive neurophysiological recording techniques, with the majority of studies using the electroencephalogram (EEG) as method of choice. Our lab features several state-of-the-art stationary high-density EEG systems, eye-tracking, a near infrared spectroscopy (NIRS) system and access to MRI and MEG. Several fully mobile, smartphone-operated wireless EEG systems are available as well. Candidates must have an academic university degree in Biomedical Engineering, Electrical Engineering, Computer Science, or a closely related field. Analytical skills, programming skills in Matlab, experience with Machine Learning and expertise in single-trial EEG analysis is required. Hands-on experience in BCI paradigm development or EEG sensor development is beneficial, as well as knowledge of BCI2000, BCILAB or OpenVibe software. An interest in auditory psychophysiology and a background in neuroscience is a plus but not strictly required. The position is suitable for part-time work, can be filled immediately and is available for initially two years with the aim of extending. The successful candidate will be affiliated to the Cluster of Excellence Hearing4All and the Department of Psychology within the School of Medicine and Health Sciences. Oldenburg has an international reputation in hearing research and hosts for instance the Fraunhofer Group Hearing, Speech and Audio Technology. Many international and interdisciplinary research groups provide an attractive scientific and social environment. Neuropsychology Lab: http://www.uni-oldenburg.de/en/neuropsychology/ Cluster of Excellence Hearing4all: http://hearing4all.eu/EN/ The University of Oldenburg is dedicated to increasing the percentage of women in science. Therefore, female candidates are particularly encouraged to apply. According to § 21 III NHG (legislation governing Higher Education in Lower Saxony) preference will be given to female candidates in cases of equal qualification. Handicapped applicants will be given preference if equally qualified. Please send your application including a cover letter, CV, list of potential referees, list of publications, and copies of certificates for academic degrees to Prof. Dr. Stefan Debener, Carl von Ossietzky Universität Oldenbur, Department Psychologie, D-26111 Oldenburg, Germany. We prefer an electronic application with a single pdf file to stefan.debener at uni-oldenburg.de . Please apply by 15 December 2014 to ensure consideration. -- Prof. Dr. Stefan Debener Neuropsychology Lab Department of Psychology University of Oldenburg D-26111 Oldenburg Germany Office: A7 0-038 Phone: +49-441-798-4271 Fax: +49-441-798-5522 Email: stefan.debener at uni-oldenburg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From helene.gudi at uni-hamburg.de Tue Nov 25 13:15:46 2014 From: helene.gudi at uni-hamburg.de (Helene Gudi) Date: Tue, 25 Nov 2014 13:15:46 +0100 Subject: [FieldTrip] spectral resolution & interpretation of power estimates Message-ID: <547472F2.6020107@uni-hamburg.de> Dear FieldTrip List, Since a while I am struggeling with a question regarding the spectral resolution and its consequences for interpreting the power vaules. I would appreciate any comments or hints which help me understand the issue. As described in the tutorial on TFR analysis when using the Morlet wavelets the spectral bandwidth at a given frequency is determined by the formula: F/width*2, meaning that when I define cfg.width=7 and look into the estimated power values of e.g. 8Hz, what I get is the power values not for 8 Hz but for a spectral band of 8Hz+/- (8/7*2)/2. Am I correct? If yes, is this also true when estimating the power values using a Hanning window? As described in the tutorial when using the Hanning taper the frequency resolution is defined by: 1/length of the sliding window. Let's say my sliding window = .5s, resulting in a frequency resolution of 2 Hz. Now, if i look into the power estimate for 10 Hz, do I get the spectral band of 2Hz at a given frequency eg. 9-11Hz, for 10Hz etc.? My next question refers to the 'cfg.pad' parameter, in the help it says: "the padding determines the spectral resolution". I unfortunately could not find any further explanations. What exactly does it mean? How do I compute the exact frequency resolution once cfg.pad has been used? Is it 1/cfg.pad? Does the padding allow to estimate power values for frequencies other than given by '1/length of time window'-resolution? As in the code below power estimates are calculated in 1Hz steps. Do the power estimates at 3Hz,4Hz etc. make sense at all, given the frequency resolution of 2.5Hz (as defined by 1/cfg.t_ftimwin)? What spectral band is actually included in the single 1Hz bins? Is it a problem if the frequency resolution ist not an integer? cfg = []; cfg.output = 'pow'; cfg.channel = 'all'; cfg.keeptapers = 'no'; cfg.pad = 7; cfg.method = 'mtmconvol'; cfg.toi = -1.75:0.05:1.75; cfg.taper = 'hanning'; cfg.keeptrials = 'yes'; cfg.foi = 3:35; cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; ft_freqanalysis(cfg, data); I would be very thankful for any help! Lena From ben.vanlier at bsse.ethz.ch Tue Nov 25 13:43:40 2014 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Tue, 25 Nov 2014 12:43:40 +0000 Subject: [FieldTrip] baselinetype decibel and plotting error Message-ID: Hi, I would like to plot my data in decibel. It works fine when running singleplotTFR, however I get an error when i use the plot interactivity to select a time/freq range within the singleplotTFR. The resulting topoplot has no color (it does show the contourlines of the data) and the layout outline is stretched (should be square). running topoplotTFR directly works fine and using the other baselinetypes is also no problem. the error is only when interacting with a spectrogram in decibel. Error using surf (line 75) X, Y, Z, and C cannot be complex Error in ft_plot_topo (line 251) h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in topoplot_common (line 704) ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ft_topoplotTFR (line 186) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_singleplotTFR>select_topoplotTFR (line 579) ft_topoplotTFR(cfg, varargin{:}); Error in ft_select_range>evalCallback (line 325) feval(funhandle, funargs{:}, val, cmenulab); Error in ft_select_range (line 159) evalCallback(callback, userData.range); Error while evaluating figure WindowButtonDownFcn its not the end of the world, but its such a nice feature to have... thank you, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Tue Nov 25 15:33:33 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Tue, 25 Nov 2014 14:33:33 +0000 Subject: [FieldTrip] spectral resolution & interpretation of power estimates In-Reply-To: <547472F2.6020107@uni-hamburg.de> References: <547472F2.6020107@uni-hamburg.de> Message-ID: Hi Helene, The idea in general is to design one's experiment in a way that allows one to observe effects at the frequency of interest. Otherwise, what you might end up with is an experiment that doesn't allow you to estimate power at the frequencies of interest. For wavelets, given your specifications, you would get a spectral bandwidth of 8/7*2 = 2.28 Hz. So 8 +/- 2.28 Hz ( 5.72 - 10.28) i.e. the bandwidth calculated refers to the bandwidth on one end, not both. Therefore, you shouldn't divide by two. Similarly with multitapers, if you have a smoothing for 8 Hz, that's -8Hz and +8Hz. For the Hanning taper, 1/0.5s = 2Hz, means you get estimates of power that are multiples of 2 Hz, so 10, 12, 14 Hz ..etc. With regards to what the spectral bandwidth is, the short answer is that it is plus and minus half the frequency resolution. So, for 10 Hz, it is 9 - 11Hz. The reasons behind this answer are to do with the spectral profile of the taper (e.g., a Hanning window) that you apply to your data. I would suggest that you take a look at one of our lecture video's here by Robert: https://www.youtube.com/watch?feature=player_detailpage&v=QLvsa1r1Voc#t=741 where he provides a much more detailed explanation. cfg.pad parameter in ft_freqanalysis: This parameter is helpful if your trials are of different length. If you set cfg.pad = 7, that means any trial shorter than 7s long will be padded to become 7s worth of data. The type of data that you use to pad is specified in cfg.padtype. The frequency resolution of your data is indeed 1/cfg.pad. There is a suggested limit for how much you should pad given your data, but I'm not sure what the limit is, maybe someone else knows. Now with your code, cfg.toi = -1.75:0.05:1.75; cfg.taper = 'hanning'; cfg.foi = 3:35; cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; You have a 0.4 second window. So 1/0.4 = 2.5Hz frequency resolution, as you figured out. This means you can only estimate in steps of 2.5Hz so doing power estimates at 1 Hz steps does *not* make sense. To get any sensible estimate, you would need something like this cfg.foi = 2.5:2.5:35; Finally, no, the frequency resolution does not have to be an integer. We don't know what frequency(ies) the brain oscillates, but integers allow for us to deal with the data more easily. I hope this helps, and I hope that if I've not been entirely accurate with my explanations that someone will jump in to correct me. Best, Nietzsche ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helene Gudi [helene.gudi at uni-hamburg.de] Sent: 25 November 2014 13:15 To: fieldtrip at science.ru.nl Subject: [FieldTrip] spectral resolution & interpretation of power estimates Dear FieldTrip List, Since a while I am struggeling with a question regarding the spectral resolution and its consequences for interpreting the power vaules. I would appreciate any comments or hints which help me understand the issue. As described in the tutorial on TFR analysis when using the Morlet wavelets the spectral bandwidth at a given frequency is determined by the formula: F/width*2, meaning that when I define cfg.width=7 and look into the estimated power values of e.g. 8Hz, what I get is the power values not for 8 Hz but for a spectral band of 8Hz+/- (8/7*2)/2. Am I correct? If yes, is this also true when estimating the power values using a Hanning window? As described in the tutorial when using the Hanning taper the frequency resolution is defined by: 1/length of the sliding window. Let's say my sliding window = .5s, resulting in a frequency resolution of 2 Hz. Now, if i look into the power estimate for 10 Hz, do I get the spectral band of 2Hz at a given frequency eg. 9-11Hz, for 10Hz etc.? My next question refers to the 'cfg.pad' parameter, in the help it says: "the padding determines the spectral resolution". I unfortunately could not find any further explanations. What exactly does it mean? How do I compute the exact frequency resolution once cfg.pad has been used? Is it 1/cfg.pad? Does the padding allow to estimate power values for frequencies other than given by '1/length of time window'-resolution? As in the code below power estimates are calculated in 1Hz steps. Do the power estimates at 3Hz,4Hz etc. make sense at all, given the frequency resolution of 2.5Hz (as defined by 1/cfg.t_ftimwin)? What spectral band is actually included in the single 1Hz bins? Is it a problem if the frequency resolution ist not an integer? cfg = []; cfg.output = 'pow'; cfg.channel = 'all'; cfg.keeptapers = 'no'; cfg.pad = 7; cfg.method = 'mtmconvol'; cfg.toi = -1.75:0.05:1.75; cfg.taper = 'hanning'; cfg.keeptrials = 'yes'; cfg.foi = 3:35; cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; ft_freqanalysis(cfg, data); I would be very thankful for any help! Lena _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jorn at artinis.com Wed Nov 26 08:43:47 2014 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Wed, 26 Nov 2014 08:43:47 +0100 Subject: [FieldTrip] spectral resolution & interpretation of power estimates In-Reply-To: References: <547472F2.6020107@uni-hamburg.de> Message-ID: <000001d0094c$b734ce00$259e6a00$@artinis.com> Hey, as an addition, maybe keep in mind that using filters you in fact widen your main lobe (i.e. decrease the effective frequency resolution, e.g. for a Hanning taper the main lobe drops to zero at twice the Raleigh frequency), and you do this to decrease magnitude of the side lobes. Most people tend to forget such things when interpreting their data (incl. me). Best, Jörn -- Jörn M. Horschig, Software Engineer Artinis Medical Systems  |  +31 481 350 980 > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Lam, N.H.L. (Nietzsche) > Sent: Tuesday, November 25, 2014 3:34 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] spectral resolution & interpretation of power > estimates > > Hi Helene, > > The idea in general is to design one's experiment in a way that allows one to > observe effects at the frequency of interest. Otherwise, what you might > end up with is an experiment that doesn't allow you to estimate power at > the frequencies of interest. > > For wavelets, given your specifications, you would get a spectral bandwidth > of 8/7*2 = 2.28 Hz. > So 8 +/- 2.28 Hz ( 5.72 - 10.28) i.e. the bandwidth calculated refers to the > bandwidth on one end, not both. Therefore, you shouldn't divide by two. > Similarly with multitapers, if you have a smoothing for 8 Hz, that's -8Hz and > +8Hz. > > For the Hanning taper, 1/0.5s = 2Hz, means you get estimates of power that > are multiples of 2 Hz, so 10, 12, 14 Hz ..etc. With regards to what the spectral > bandwidth is, the short answer is that it is plus and minus half the frequency > resolution. So, for 10 Hz, it is 9 - 11Hz. The reasons behind this answer are to > do with the spectral profile of the taper (e.g., a Hanning window) that you > apply to your data. I would suggest that you take a look at one of our lecture > video's here by Robert: > https://www.youtube.com/watch?feature=player_detailpage&v=QLvsa1r1V > oc#t=741 where he provides a much more detailed explanation. > > cfg.pad parameter in ft_freqanalysis: This parameter is helpful if your trials > are of different length. If you set cfg.pad = 7, that means any trial shorter > than 7s long will be padded to become 7s worth of data. The type of data > that you use to pad is specified in cfg.padtype. The frequency resolution of > your data is indeed 1/cfg.pad. There is a suggested limit for how much you > should pad given your data, but I'm not sure what the limit is, maybe > someone else knows. > > Now with your code, > cfg.toi = -1.75:0.05:1.75; > cfg.taper = 'hanning'; > cfg.foi = 3:35; > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > > You have a 0.4 second window. So 1/0.4 = 2.5Hz frequency resolution, as you > figured out. > This means you can only estimate in steps of 2.5Hz so doing power estimates > at 1 Hz steps does *not* make sense. To get any sensible estimate, you > would need something like this cfg.foi = 2.5:2.5:35; > > Finally, no, the frequency resolution does not have to be an integer. We > don't know what frequency(ies) the brain oscillates, but integers allow for us > to deal with the data more easily. > > I hope this helps, and I hope that if I've not been entirely accurate with my > explanations that someone will jump in to correct me. > > Best, > Nietzsche > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on > behalf of Helene Gudi [helene.gudi at uni-hamburg.de] > Sent: 25 November 2014 13:15 > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] spectral resolution & interpretation of power estimates > > Dear FieldTrip List, > > Since a while I am struggeling with a question regarding the spectral > resolution and its consequences for interpreting the power vaules. I would > appreciate any comments or hints which help me understand the issue. > > As described in the tutorial on TFR analysis when using the Morlet wavelets > the spectral bandwidth at a given frequency is determined by the formula: > F/width*2, meaning that when I define cfg.width=7 and look into the > estimated power values of e.g. 8Hz, what I get is the power values not for 8 > Hz but for a spectral band of 8Hz+/- (8/7*2)/2. > Am I correct? > If yes, is this also true when estimating the power values using a Hanning > window? As described in the tutorial when using the Hanning taper the > frequency resolution is defined by: 1/length of the sliding window. Let's say > my sliding window = .5s, resulting in a frequency resolution of 2 Hz. Now, if i > look into the power estimate for 10 Hz, do I get the spectral band of 2Hz at a > given frequency eg. 9-11Hz, for 10Hz etc.? > > My next question refers to the 'cfg.pad' parameter, in the help it says: > "the padding determines the spectral resolution". I unfortunately could not > find any further explanations. What exactly does it mean? How do I compute > the exact frequency resolution once cfg.pad has been used? Is it 1/cfg.pad? > Does the padding allow to estimate power values for frequencies other than > given by '1/length of time window'-resolution? As in the code below power > estimates are calculated in 1Hz steps. Do the power estimates at 3Hz,4Hz etc. > make sense at all, given the frequency resolution of 2.5Hz (as defined by > 1/cfg.t_ftimwin)? What spectral band is actually included in the single 1Hz > bins? Is it a problem if the frequency resolution ist not an integer? > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'all'; > cfg.keeptapers = 'no'; > cfg.pad = 7; > cfg.method = 'mtmconvol'; > cfg.toi = -1.75:0.05:1.75; > cfg.taper = 'hanning'; > cfg.keeptrials = 'yes'; > cfg.foi = 3:35; > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > ft_freqanalysis(cfg, data); > > I would be very thankful for any help! > Lena > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jorn at artinis.com Wed Nov 26 08:44:33 2014 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Wed, 26 Nov 2014 08:44:33 +0100 Subject: [FieldTrip] baselinetype decibel and plotting error In-Reply-To: References: Message-ID: <000101d0094c$d26d3040$774790c0$@artinis.com> Hi Ben, nice to see here, and that you are actively using FieldTrip ;) My guess is that the error occurs because you have negative values that you want to transform, e.g. because you are taking a contrats between conditions. Converting to decibels involves taking the logarithm, and the logarithm of negative numbers is not good (i.e. you get complex numbers out). A simple solution is to first take the logarithm of e.g. individual conditions and then subtract or, which is equivalent, dividing the two conditions from one another and then taking the logarithm. Best, Jörn -- Jörn M. Horschig, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of van Lier Ben Sent: Tuesday, November 25, 2014 1:44 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] baselinetype decibel and plotting error Hi, I would like to plot my data in decibel. It works fine when running singleplotTFR, however I get an error when i use the plot interactivity to select a time/freq range within the singleplotTFR. The resulting topoplot has no color (it does show the contourlines of the data) and the layout outline is stretched (should be square). running topoplotTFR directly works fine and using the other baselinetypes is also no problem. the error is only when interacting with a spectrogram in decibel. Error using surf (line 75) X, Y, Z, and C cannot be complex Error in ft_plot_topo (line 251) h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in topoplot_common (line 704) ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ft_topoplotTFR (line 186) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_singleplotTFR>select_topoplotTFR (line 579) ft_topoplotTFR(cfg, varargin{:}); Error in ft_select_range>evalCallback (line 325) feval(funhandle, funargs{:}, val, cmenulab); Error in ft_select_range (line 159) evalCallback(callback, userData.range); Error while evaluating figure WindowButtonDownFcn its not the end of the world, but its such a nice feature to have... thank you, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Wed Nov 26 08:47:39 2014 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Wed, 26 Nov 2014 08:47:39 +0100 Subject: [FieldTrip] spectral resolution & interpretation of power estimates In-Reply-To: <000001d0094c$b734ce00$259e6a00$@artinis.com> References: <547472F2.6020107@uni-hamburg.de> <000001d0094c$b734ce00$259e6a00$@artinis.com> Message-ID: <000b01d0094d$415844e0$c408cea0$@artinis.com> please allow me to correct my first sentence: > as an addition, maybe keep in mind that using *tapers* you in fact widen your -- Jörn M. Horschig, Software Engineer Artinis Medical Systems  |  +31 481 350 980 > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Jörn M. Horschig > Sent: Wednesday, November 26, 2014 8:44 AM > To: 'FieldTrip discussion list' > Subject: Re: [FieldTrip] spectral resolution & interpretation of power > estimates > > Hey, > > as an addition, maybe keep in mind that using filters you in fact widen your > main lobe (i.e. decrease the effective frequency resolution, e.g. for a > Hanning taper the main lobe drops to zero at twice the Raleigh frequency), > and you do this to decrease magnitude of the side lobes. Most people tend > to forget such things when interpreting their data (incl. me). > > Best, > Jörn > > -- > > Jörn M. Horschig, Software Engineer > Artinis Medical Systems  |  +31 481 350 980 > > > -----Original Message----- > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > > bounces at science.ru.nl] On Behalf Of Lam, N.H.L. (Nietzsche) > > Sent: Tuesday, November 25, 2014 3:34 PM > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] spectral resolution & interpretation of power > > estimates > > > > Hi Helene, > > > > The idea in general is to design one's experiment in a way that allows > > one > to > > observe effects at the frequency of interest. Otherwise, what you > > might end up with is an experiment that doesn't allow you to estimate > > power at the frequencies of interest. > > > > For wavelets, given your specifications, you would get a spectral > bandwidth > > of 8/7*2 = 2.28 Hz. > > So 8 +/- 2.28 Hz ( 5.72 - 10.28) i.e. the bandwidth calculated > > refers > to the > > bandwidth on one end, not both. Therefore, you shouldn't divide by two. > > Similarly with multitapers, if you have a smoothing for 8 Hz, that's > > -8Hz > and > > +8Hz. > > > > For the Hanning taper, 1/0.5s = 2Hz, means you get estimates of > > power > that > > are multiples of 2 Hz, so 10, 12, 14 Hz ..etc. With regards to what the > spectral > > bandwidth is, the short answer is that it is plus and minus half the > frequency > > resolution. So, for 10 Hz, it is 9 - 11Hz. The reasons behind this > answer are to > > do with the spectral profile of the taper (e.g., a Hanning window) > > that > you > > apply to your data. I would suggest that you take a look at one of > > our > lecture > > video's here by Robert: > > > https://www.youtube.com/watch?feature=player_detailpage&v=QLvsa1r1V > > oc#t=741 where he provides a much more detailed explanation. > > > > cfg.pad parameter in ft_freqanalysis: This parameter is helpful if > > your > trials > > are of different length. If you set cfg.pad = 7, that means any trial > shorter > > than 7s long will be padded to become 7s worth of data. The type of data > > that you use to pad is specified in cfg.padtype. The frequency > resolution of > > your data is indeed 1/cfg.pad. There is a suggested limit for how much > you > > should pad given your data, but I'm not sure what the limit is, maybe > > someone else knows. > > > > Now with your code, > > cfg.toi = -1.75:0.05:1.75; > > cfg.taper = 'hanning'; > > cfg.foi = 3:35; > > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > > > > You have a 0.4 second window. So 1/0.4 = 2.5Hz frequency resolution, > > as > you > > figured out. > > This means you can only estimate in steps of 2.5Hz so doing power > estimates > > at 1 Hz steps does *not* make sense. To get any sensible estimate, > > you would need something like this cfg.foi = 2.5:2.5:35; > > > > Finally, no, the frequency resolution does not have to be an integer. > > We don't know what frequency(ies) the brain oscillates, but integers > > allow > for us > > to deal with the data more easily. > > > > I hope this helps, and I hope that if I've not been entirely accurate > > with > my > > explanations that someone will jump in to correct me. > > > > Best, > > Nietzsche > > > > ________________________________________ > > From: fieldtrip-bounces at science.ru.nl > > [fieldtrip-bounces at science.ru.nl] on behalf of Helene Gudi > > [helene.gudi at uni-hamburg.de] > > Sent: 25 November 2014 13:15 > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] spectral resolution & interpretation of power > estimates > > > > Dear FieldTrip List, > > > > Since a while I am struggeling with a question regarding the spectral > > resolution and its consequences for interpreting the power vaules. I > > would appreciate any comments or hints which help me understand the > issue. > > > > As described in the tutorial on TFR analysis when using the Morlet > wavelets > > the spectral bandwidth at a given frequency is determined by the formula: > > F/width*2, meaning that when I define cfg.width=7 and look into the > > estimated power values of e.g. 8Hz, what I get is the power values not > > for > 8 > > Hz but for a spectral band of 8Hz+/- (8/7*2)/2. > > Am I correct? > > If yes, is this also true when estimating the power values using a > > Hanning window? As described in the tutorial when using the Hanning > > taper the frequency resolution is defined by: 1/length of the sliding > > window. Let's > say > > my sliding window = .5s, resulting in a frequency resolution of 2 Hz. > > Now, > if i > > look into the power estimate for 10 Hz, do I get the spectral band of > > 2Hz > at a > > given frequency eg. 9-11Hz, for 10Hz etc.? > > > > My next question refers to the 'cfg.pad' parameter, in the help it says: > > "the padding determines the spectral resolution". I unfortunately > > could > not > > find any further explanations. What exactly does it mean? How do I > > compute the exact frequency resolution once cfg.pad has been used? Is > > it > 1/cfg.pad? > > Does the padding allow to estimate power values for frequencies other > > than given by '1/length of time window'-resolution? As in the code > > below power estimates are calculated in 1Hz steps. Do the power > > estimates at 3Hz,4Hz > etc. > > make sense at all, given the frequency resolution of 2.5Hz (as defined > > by 1/cfg.t_ftimwin)? What spectral band is actually included in the > > single > 1Hz > > bins? Is it a problem if the frequency resolution ist not an integer? > > > > cfg = []; > > cfg.output = 'pow'; > > cfg.channel = 'all'; > > cfg.keeptapers = 'no'; > > cfg.pad = 7; > > cfg.method = 'mtmconvol'; > > cfg.toi = -1.75:0.05:1.75; > > cfg.taper = 'hanning'; > > cfg.keeptrials = 'yes'; > > cfg.foi = 3:35; > > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > > ft_freqanalysis(cfg, data); > > > > I would be very thankful for any help! > > Lena > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Wed Nov 26 14:26:27 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Wed, 26 Nov 2014 13:26:27 +0000 Subject: [FieldTrip] Averaging on a random sample In-Reply-To: References: <8d9e856a862b4df1a4d98b40c1e18b48@EXPRD01.hosting.ru.nl> Message-ID: Thanks Eelke If this can help someone else, here is the correct code: arrondi=roundn(size(cleandata.trial,2)/2, 0); a = randperm(size(cleandata.trial,2)); r1=a(1:arrondi); r2=a(arrondi+1:end); cfg = []; cfg.trials = r1; avgFCIndexHALF1 = ft_timelockanalysis(cfg, cleandata); cfg = []; cfg.trials = r2; avgFCIndexHALF2 = ft_timelockanalysis(cfg, cleandata); Best, Emilie --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 21 nov. 2014 à 10:29, Eelke Spaak > a écrit : Dear Emilie, You are not providing a FT data structure to ft_timelockanalysis (which you should), instead you are providing the raw cell array of trials (which you shouldn't). Hence, FT complains that the data is not in a structure that it can work with. There is a cfg-option cfg.trials, which you might like to use instead. Best, Eelke On 21 November 2014 10:09, Caspar, Emilie > wrote: Dear Fieldtrippers, I have a sample of 350 trials for one condition, but for statistical analysis reasons I would like to split randomly this sample in two and average these two parts. so, I used the "randsample" matlab function which seems to work very well and then I averaged this selected sample: randomhalf = randsample(cleandata.trial, 175); avgFCMiddleRing = ft_timelockanalysis(cfg, randomhalf); However, I have the following error message : Error using ft_checkdata (line 366) This function requires raw or comp data as input. Error in ft_timelockanalysis (line 105) data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Does anyone have a solution to fix the problem? Thank you very much! Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From giuseppespinelli88 at gmail.com Fri Nov 28 13:06:33 2014 From: giuseppespinelli88 at gmail.com (Giuseppe Spinelli) Date: Fri, 28 Nov 2014 13:06:33 +0100 Subject: [FieldTrip] HELP time_frequency Message-ID: *n *Dear FieldTrippers I am new to FieldTrip so I hope you could forgive my inexperience! I am trying to segment a triggered EEGLAB dataset (.set) which has been already preprocessed (resempled, filtered and cleaned by ICA). What I did was basically to define ethe eventvalue field with respect to each experimental condition (32,64,128) in the continuous eeglab dataset then defining trial and then I run the preprocess function. Finally I run the ft_databrowser for visual inspecting one condition only (data_SE). The process results in these errors: Error using ft_fetch_data (line 62) data does not contain a consistent trial definition, fetching data is not possible Error in ft_databrowser>redraw_cb (line 1485) art = ft_fetch_data(opt.artdata, 'begsample', begsample, 'endsample', endsample); Error in ft_databrowser (line 696) redraw_cb(h); Error in eeglab2fieldtrip (line 30) cfg = ft_databrowser(cfg); here the script % loading .set dataset (from EEGLAB) cfg = []; cfg.dataset = 'C:\Users\GiuS\Documents\MATLAB\CAVE_ERROR_2_FIELDTRIP\EEG\S01.set'; cfg.continuous = 'yes'; % defining trials cfg.trialfun = 'ft_trialfun_general'; cfg.trialdef.eventtype = 'trigger'; % cfg.trialdef.eventvalue = 32; cfg.trialdef.eventvalue = 64; % cfg.trialdef.eventvalue = 128; cfg.trialdef.prestim = 1; cfg.trialdef.poststim = 2; cfg = ft_definetrial(cfg); % data_CO = ft_preprocessing(cfg); % n = 140 data_SE = ft_preprocessing(cfg); % n = 30 % data_LE = ft_preprocessing(cfg); % n = 30 % % plotting cfg.viewmode = 'vertical'; cfg.plotlabels = 'yes'; cfg.blocksize = 10; % cfg = ft_databrowser(cfg, data_CO); cfg = ft_databrowser(cfg, data_SE); % cfg = ft_databrowser(cfg, data_LE); I would be glad to receive some help. Many thanks in advance - *Giuseppe Spinelli*, Ph.D. student *Social and Cognitive Neuroscience Laboratory* *http://agliotilab.org/lab-staff/phd-students/1st-year/giuseppe-spinelli#anchor * Department of Psychology, Sapienza University of Rome *via dei Marsi 78, 00185 - Rome* Phone/Fax: (+39) 06-49917635 IRCCS Fondazione Santa Lucia *via Ardeatina 306, 00142 - Rome* *Tel. (+39) 06 5150 1107 <%28%2B39%29%2006%205150%201107>* @: giuseppe.spinelli at uniroma1.it -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Nov 28 13:57:02 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 28 Nov 2014 13:57:02 +0100 Subject: [FieldTrip] HELP time_frequency In-Reply-To: <211016fc25f346999e5b700acd099c3a@EXPRD02.hosting.ru.nl> References: <211016fc25f346999e5b700acd099c3a@EXPRD02.hosting.ru.nl> Message-ID: Dear Giuseppe, Try initializing your cfg to empty (cfg = [];) at the beginning of your %% plotting block. In general, every FT function call should use its own cfg-structure. (The one exception being the pattern cfg = ft_definetrial(cfg); data = ft_preprocessing(cfg);, which remains for historical reasons).) Best, Eelke On 28 November 2014 at 13:06, Giuseppe Spinelli wrote: > n Dear FieldTrippers > > I am new to FieldTrip so I hope you could forgive my inexperience! > > I am trying to segment a triggered EEGLAB dataset (.set) which has been > already preprocessed (resempled, filtered and cleaned by ICA). > > What I did was basically to define ethe eventvalue field with respect to > each experimental condition (32,64,128) in the continuous eeglab dataset > then defining trial and then I run the preprocess function. Finally I run > the ft_databrowser for visual inspecting one condition only (data_SE). > > The process results in these errors: > > Error using ft_fetch_data (line 62) > data does not contain a consistent trial definition, fetching data is not > possible > > Error in ft_databrowser>redraw_cb (line 1485) > art = ft_fetch_data(opt.artdata, 'begsample', begsample, 'endsample', > endsample); > > Error in ft_databrowser (line 696) > redraw_cb(h); > > Error in eeglab2fieldtrip (line 30) > cfg = ft_databrowser(cfg); > > > here the script > > % loading .set dataset (from EEGLAB) > cfg = []; > cfg.dataset = > 'C:\Users\GiuS\Documents\MATLAB\CAVE_ERROR_2_FIELDTRIP\EEG\S01.set'; > cfg.continuous = 'yes'; > > % defining trials > cfg.trialfun = 'ft_trialfun_general'; > cfg.trialdef.eventtype = 'trigger'; > > % cfg.trialdef.eventvalue = 32; > cfg.trialdef.eventvalue = 64; > % cfg.trialdef.eventvalue = 128; > > cfg.trialdef.prestim = 1; > cfg.trialdef.poststim = 2; > > cfg = ft_definetrial(cfg); > > % data_CO = ft_preprocessing(cfg); % n = 140 > data_SE = ft_preprocessing(cfg); % n = 30 > % data_LE = ft_preprocessing(cfg); % n = 30 > > % % plotting > cfg.viewmode = 'vertical'; > cfg.plotlabels = 'yes'; > cfg.blocksize = 10; > % cfg = ft_databrowser(cfg, data_CO); > cfg = ft_databrowser(cfg, data_SE); > % cfg = ft_databrowser(cfg, data_LE); > > I would be glad to receive some help. > > Many thanks in advance > > - > Giuseppe Spinelli, Ph.D. student > Social and Cognitive Neuroscience Laboratory > http://agliotilab.org/lab-staff/phd-students/1st-year/giuseppe-spinelli#anchor > > Department of Psychology, Sapienza University of Rome > via dei Marsi 78, 00185 - Rome > Phone/Fax: (+39) 06-49917635 > > IRCCS Fondazione Santa Lucia > via Ardeatina 306, 00142 - Rome > Tel. (+39) 06 5150 1107 > > @: giuseppe.spinelli at uniroma1.it From Hahn at psych.uni-frankfurt.de Sat Nov 1 11:27:49 2014 From: Hahn at psych.uni-frankfurt.de (Tim Hahn) Date: Sat, 01 Nov 2014 11:27:49 +0100 Subject: [FieldTrip] channel time series from simulated brain data Message-ID: <5454B5A5.5080408@psych.uni-frankfurt.de> Dear all, I simulated neural dynamics. Now, I'd like to compare it to my EEG data. To generate scalp maps (i.e. time series at each channel) from my simulation, I would need to put my simulated data into a forward model if I understand correctly. How could I do this using fieldtrip? If I'm not mistaken, I need to generate a lead-field matrix to "project" my simulated brain data onto the channel locations. Unfortunately, all examples need individual MRI data to build the model whereas I simply modeled my data in MNI space in the first place and thus don't have MRI data (nor should I need it in this case, I think). Thanks a lot for your help. Cheers, Tim From tzvetan.popov at uni-konstanz.de Sat Nov 1 13:00:53 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Sat, 1 Nov 2014 13:00:53 +0100 Subject: [FieldTrip] channel time series from simulated brain data In-Reply-To: <5454B5A5.5080408@psych.uni-frankfurt.de> References: <5454B5A5.5080408@psych.uni-frankfurt.de> Message-ID: <9953AEC7-A11C-404F-8644-DC0452EDFFCE@uni-konstanz.de> Dear Tim, you might have a look here: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit and also at this post http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008482.html good luck, tzvetan > Dear all, > I simulated neural dynamics. Now, I'd like to compare it to my EEG data. To generate scalp maps (i.e. time series at each channel) from my simulation, I would need to put my simulated data into a forward model if I understand correctly. How could I do this using fieldtrip? If I'm not mistaken, I need to generate a lead-field matrix to "project" my simulated brain data onto the channel locations. Unfortunately, all examples need individual MRI data to build the model whereas I simply modeled my data in MNI space in the first place and thus don't have MRI data (nor should I need it in this case, I think). > Thanks a lot for your help. > Cheers, > Tim > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eh776 at york.ac.uk Mon Nov 3 12:04:17 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Mon, 3 Nov 2014 11:04:17 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Hi Nietzsche, That's much clearer--thanks for your help. It seems as though I should have entered my sources estimates into data.pow.avg rather than data.avg. However, I am still getting an error. My data is structured: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.pow.avg = [902629 x 11 double] % source estimates When I try: grandavgA = ft_sourcegrandaverage(cfg, data{:}); I get the error message: ??? Error using ==> ft_checkdata>fixsource at 1259 the input does not contain an avg or trial field Error in ==> ft_checkdata at 650 data = fixsource(data, 'type', sourcerepresentation); Error in ==> ft_sourcegrandaverage at 107 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); It appears as though the function is searching for a data{i}.avg or data{i}.trial field. What data should these fields contain? The wiki (http://fieldtrip.fcdonders.nl/reference/ft_datatype_source) seems to state that these are "historical" fields, although I have updated to fieldtrip-20141030 (the same error also occurs with older versions) Best, Emma On 31 October 2014 16:02, Lam, N.H.L. (Nietzsche) wrote: > Hi Emma, > > In this part: > ??? Undefined function or method 'fieldnames' for input arguments of >type 'double'. > > > Error in ==> parameterselection at 47 > tmp = fieldnames(data.avg); > > it says that the function 'fieldnames' doesn't know how to deal with data that is of the type > double. This is because fieldnames expects your data to be in the format of a struct. I'm > guessing there was just an error in your implementation because from your message you > understood that "input data to ft_sourcegrandaverage contains a cell array of structures -- ones > for each participant. Furthermore, you need to put your source estimates in data.pow.avg. > > Based on your description, you might try something like this (but it's not guaranteed to work > because I'm not entirely sure about the details of your data) > > data.pos = [902629x3 double] > data.dim = [91 109 91] > data.time = [1 x Z double] % vector of time points > data.pow.avg = [902629 x time points] % source estimates (or potentially voxel x frequency > x time points, depending on your data). > > As a side note, the size of your data will be quite taxing on computational memory so you > might also want to consider using a lower spatial resolution. > > Finally, in the future, when describing your data, it would be best to show the structure of your > data as shown in matlab (as done above), because this makes it easier for everyone else to > see what you've done. Please check this FAQ for more details http://fieldtrip.fcdonders.nl/ > faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/ > how_to_ask_good_questions_to_the_community > > Best, > Nietzsche -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Nov 3 12:35:55 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 3 Nov 2014 12:35:55 +0100 (CET) Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: References: Message-ID: <075001cff75a$5487d8a0$fd9789e0$@vanpelt@fcdonders.ru.nl> Hi Emma, Try using data{i}.avg.pow instead of data{i}.pow.avg (or use cfg.funparameter = 'pow.avg' instead of cfg.funparameter = 'avg.pow') Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Emma Holmes Sent: maandag 3 november 2014 12:04 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Hi Nietzsche, That's much clearer--thanks for your help. It seems as though I should have entered my sources estimates into data.pow.avg rather than data.avg. However, I am still getting an error. My data is structured: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.pow.avg = [902629 x 11 double] % source estimates When I try: grandavgA = ft_sourcegrandaverage(cfg, data{:}); I get the error message: ??? Error using ==> ft_checkdata>fixsource at 1259 the input does not contain an avg or trial field Error in ==> ft_checkdata at 650 data = fixsource(data, 'type', sourcerepresentation); Error in ==> ft_sourcegrandaverage at 107 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); It appears as though the function is searching for a data{i}.avg or data{i}.trial field. What data should these fields contain? The wiki (http://fieldtrip.fcdonders.nl/reference/ft_datatype_source) seems to state that these are "historical" fields, although I have updated to fieldtrip-20141030 (the same error also occurs with older versions) Best, Emma On 31 October 2014 16:02, Lam, N.H.L. (Nietzsche) wrote: > Hi Emma, > > In this part: > ??? Undefined function or method 'fieldnames' for input arguments of >type > 'double'. > > > Error in ==> parameterselection at 47 > tmp = fieldnames(data.avg); > > it says that the function 'fieldnames' doesn't know how to deal with data > that is of the type > double. This is because fieldnames expects your data to be in the format > of a struct. I'm > guessing there was just an error in your implementation because from your > message you > understood that "input data to ft_sourcegrandaverage contains a cell array > of structures -- ones > for each participant. Furthermore, you need to put your source estimates > in data.pow.avg. > > Based on your description, you might try something like this (but it's not > guaranteed to work > because I'm not entirely sure about the details of your data) > > data.pos = [902629x3 double] > data.dim = [91 109 91] > data.time = [1 x Z double] % vector of time points > data.pow.avg = [902629 x time points] % source estimates (or > potentially voxel x frequency > x time points, depending on your data). > > As a side note, the size of your data will be quite taxing on > computational memory so you > might also want to consider using a lower spatial resolution. > > Finally, in the future, when describing your data, it would be best to > show the structure of your > data as shown in matlab (as done above), because this makes it easier for > everyone else to > see what you've done. Please check this FAQ for more details > http://fieldtrip.fcdonders.nl/ > > faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/ > > how_to_ask_good_questions_to_the_community > > > Best, > Nietzsche -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Mon Nov 3 14:01:32 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Mon, 3 Nov 2014 13:01:32 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Hi Stan, Thanks for the suggestion. When I try that, I get the following error ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Error in ==> ft_sourcegrandaverage at 82 varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I am unsure why this occurs. My data is now structured in the following way: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.avg.pow = [902629 x 11 double] % source estimates The following is the method I use: cfg = []; cfg.keepindividual = 'yes'; cfg.parameter = 'pow'; grandavgA = ft_sourcegrandaverage(cfg, data{:}); Best, Emma On 31 October 2014 16:02, Stan van Pelt wrote: > Hi Emma, > > > > Try using data{i}.avg.pow instead of data{i}.pow.avg > > > > (or use cfg.funparameter = 'pow.avg' instead of cfg.funparameter = > 'avg.pow') > > > > Best, > > Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Mon Nov 3 16:24:31 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Mon, 3 Nov 2014 16:24:31 +0100 Subject: [FieldTrip] Radiological convention In-Reply-To: References: Message-ID: Hello, Please how I can flip the template MRI from Nuerological convention to radiological convention. Mercy Azeez A. Adebimpe "Knowledge and good manner, the beauty of a man" -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Nov 3 16:54:15 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 3 Nov 2014 16:54:15 +0100 (CET) Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: References: Message-ID: <07bb01cff77e$6b7a9790$426fc6b0$@vanpelt@fcdonders.ru.nl> Hi Emma, I am unfamiliar with this type of error. It seems however that you still have an inconsistency in your data. You define “data{i}.avg.pow”, but later on use “cfg.parameter = 'pow';”. You should change one of the two (e.g. use cfg.parameter = 'avg.pow';) Hope that helps. Stan From: Emma Holmes [mailto:eh776 at york.ac.uk] Sent: maandag 3 november 2014 14:02 To: fieldtrip at science.ru.nl Cc: s.vanpelt at fcdonders.ru.nl Subject: Spatio-temporal cluster-based permutation analysis on EEG sources Hi Stan, Thanks for the suggestion. When I try that, I get the following error ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Error in ==> ft_sourcegrandaverage at 82 varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I am unsure why this occurs. My data is now structured in the following way: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.avg.pow = [902629 x 11 double] % source estimates The following is the method I use: cfg = []; cfg.keepindividual = 'yes'; cfg.parameter = 'pow'; grandavgA = ft_sourcegrandaverage(cfg, data{:}); Best, Emma On 31 October 2014 16:02, Stan van Pelt wrote: > Hi Emma, > > > > Try using data{i}.avg.pow instead of data{i}.pow.avg > > > > (or use cfg.funparameter = 'pow.avg' instead of cfg.funparameter = > 'avg.pow') > > > > Best, > > Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Nov 3 17:27:57 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 3 Nov 2014 17:27:57 +0100 Subject: [FieldTrip] Radiological convention In-Reply-To: <4cf51038d81e4fdeba513bc77268f0d8@EXPRD01.hosting.ru.nl> References: <4cf51038d81e4fdeba513bc77268f0d8@EXPRD01.hosting.ru.nl> Message-ID: Hi Azeez, Have a look at the private (and hence untested for direct use by end-users) function /private/volumeflip.m . Best, Eelke On 3 November 2014 16:24, Azeez Adebimpe wrote: > > > Hello, > > Please how I can flip the template MRI from Nuerological convention to > radiological convention. > > Mercy > > Azeez A. Adebimpe > > > "Knowledge and good manner, the beauty of a man" From f.roux at bcbl.eu Tue Nov 4 11:59:18 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 4 Nov 2014 11:59:18 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <0d9c01cff523$322a09b0$967e1d10$@maris@psych.ru.nl> Message-ID: <537192336.3738792.1415098758947.JavaMail.root@bcbl.eu> Dear all, I would like to follow up on this, as I am currently struggling myself with the coding of the design matrix of my analysis. I have MEG data from n = 95 participants aged between 12 and 27 years on a WM-task with 3 WM-load conditions. I would like to investigate the effects of age (continuous variable ranging from 12 to 27) and WM-load (categorical variable ranging from 1-3) on delay-activity in different frequency-bands. What would be the correct way to perform such an analysis in fieldtrip? Would this be akin to a mixed-effects design? Best regards, Fred Frédéric Roux ----- Original Message ----- From: "Eric Maris" To: "FieldTrip discussion list" Sent: Friday, October 31, 2014 4:56:16 PM Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Dear Dylan, I replied to your question on the Fieldtrip faq page that you refer to. Although the problem can be solved, it is not implemented yet, because it requires the implementation of three new statfuns: Hotelling’s T-square for dependent samples, Hotelling’s T-square for independent samples, and Wilk’s lambda. A good statistics book (e.g., Johnson & Wichern) will show you how to do this yourself. Otherwise, you have to be patient. Although your statistical problem can be solved, with neurobiological data, it is almost never wise to statistically test interaction effects in designs more complicated than the 2-by-2 factorial design. In these more complicated designs, you always end up with F-tests, which do not inform you about the pattern in the data that is responsible for the interaction effect. Best, Eric From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] Sent: dinsdag 28 oktober 2014 13:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Thank you, Eelke. I'm sorry I am not picking this up more quickly. Your examples of passing either multiple structs or cell arrays to ft_freqstatistics deals with one group of subjects in multiple conditions, or two groups in one condition, respectively. I have two groups, both doing multiple (11) conditions and I would like to know how to handle that in ft_freqstatistics. What I require seems to be similar to what Eric Maris wrote about here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests but instead of a 2-by-2 factorial design, I am using a 2-by-11 factorial design. As such, I am not sure how this translates when making difference data structures. I hope I am not missing something obvious. Thanks again, Dylan On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > wrote: Dear Dylan, You don't want (or need) a single struct with a subj X chan X freq X time powspctrm. Instead, it is often convenient to collect each individual subject's struct in a *cell* array (rather than a struct array). See, for example, here: http://www.mathworks.nl/help/matlab/cell-arrays.html and here: http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ . At the statistics step you should pass in multiple structs, each one corresponding to one unit-of-observation, to ft_freqstatistics. This can be done like so: stat = ft_freqstatistics(cfg, struct11, struct12, struct13,...struct21, struct22, ...); or, using the cell arrays, like so: stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); Make sure that each column in your design matrix describes one unit-of-observation, in the order in which the structs are passed into ft_freqstatistics. Best, Eelke On 21 October 2014 03:41, Dylan DeLosAngeles < dylan.delosangeles at gmail.com > wrote: > Dear Eelke, > > Thank you for help regarding cluster-based permutation analysis of two or more conditions. > > I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum. > > My code below loads 12 subjects from the first group, but I end up with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x 3 frequencies x 2049 time points, rather than one struct with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x time points. > > for k = 1:Nmt, % states > for i = 1%:Ng, % groups > for j = 1:Ns, % subjects > > % load files > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > % convert to eeglab to get channel locations > EEG(j) = eeg2eeglab( p(j)); > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > % preprocessing in fieldtrip > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > % specify length of time to use in config > time = EEG(j).xmax-EEG(j).xmin; > > % setup configuration for freqanalysis > cfg = []; % clear cfg > cfg.output = 'pow'; > cfg.channel = 'EEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 0.5:3; % delta > cfg.toi = 1:0.05:time; % length of each state > cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > cfg.keeptrials = 'yes'; > > % do freqanalysis > freqdata(j) = ft_freqanalysis( cfg, d(j)); > end > end > end > > My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics. > > Lastly, I just want to confirm what you said in your previous email, that I should be using indepsamplesF for more than two conditions (I have 11), and therefore my design should look like this; > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > Any help would be appreciated. > > Kind regards, > Dylan > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < eelke.spaak at donders.ru.nl > wrote: > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > < dylan.delosangeles at gmail.com > wrote: >> Hello, >> >> So far, the tutorial on "Cluster-based permutation tests on time-frequency >> data" has been very helpful. >> >> Out of the four combinations from the two UO-types (subjects and trials) and >> the two experimental designs (between- and within-UO), the tutorial covers >> statistics on data in two conditions in a between-trials, in a within-trials >> and in a within-subjects design. However, I am wondering if there is any >> information about the fourth type of experiment design: between-subjects. >> >> I have data for 2 groups with 12 subjects in each group. Both groups are >> measured during 11 conditions. >> Can I approach this in a similar fashion to within-subjects design (multiple >> subjects in multiple experimental conditions), such that my design is >> multiple groups in multiple experimental conditions. Is it a case of first >> averaging over all trials belonging to each of the experimental conditions >> for each subject (as instructed in tutorial), and then averaging over all >> subjects in each group? >> >> Configuration code for setting up the design currently looks like this; >> grp = 2; >> subj = 11; >> design = zeros(2, subj*grp); >> >> for i = 1:grp >> design(1,i:2:end) = i; >> end >> >> idx = 1; >> for i = 1:subj >> design(2,idx:idx+1) = i; >> idx = idx+2; >> end >> >> Is there anything else I need to take into consideration when doing these >> statistics? >> >> Thank you, >> Dr Dylan DeLosAngeles >> Research Fellow >> Brain Signal Laboratory >> Flinders University >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.maris at psych.ru.nl Tue Nov 4 12:22:12 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 4 Nov 2014 12:22:12 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <537192336.3738792.1415098758947.JavaMail.root@bcbl.eu> References: <0d9c01cff523$322a09b0$967e1d10$@maris@psych.ru.nl> <537192336.3738792.1415098758947.JavaMail.root@bcbl.eu> Message-ID: <020d01cff821$91fab690$b5f023b0$@maris@psych.ru.nl> Hi Fred, What you ask can definitely be done in Fieldtrip. The analyses you need are very similar to those of Vladimir Litvak, for who I implemented the statfuns indepsamplesRegrT and depsamplesRegrT. To give you the recipe, I would have to go back to the code, because it is such a long time ago. Anyhow, you now know where to look, and I trust that you can get a long way yourself. Best, Eric Maris > -----Original Message----- > From: Frédéric Roux [mailto:f.roux at bcbl.eu] > Sent: dinsdag 4 november 2014 11:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > Dear all, > > I would like to follow up on this, as I am currently struggling > myself with the coding of the design matrix of my analysis. > > I have MEG data from n = 95 participants aged between 12 and 27 years > on a WM-task with 3 WM-load conditions. > > I would like to investigate the effects of age (continuous variable > ranging from 12 to 27) and WM-load (categorical variable ranging from > 1-3) on delay-activity in different frequency-bands. > > What would be the correct way to perform such an analysis in > fieldtrip? > > Would this be akin to a mixed-effects design? > > Best regards, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Eric Maris" > To: "FieldTrip discussion list" > Sent: Friday, October 31, 2014 4:56:16 PM > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > > > > > > Dear Dylan, > > > > I replied to your question on the Fieldtrip faq page that you refer > to. Although the problem can be solved, it is not implemented yet, > because it requires the implementation of three new statfuns: > Hotelling’s T-square for dependent samples, Hotelling’s T-square for > independent samples, and Wilk’s lambda. A good statistics book (e.g., > Johnson & Wichern) will show you how to do this yourself. Otherwise, > you have to be patient. > > > > Although your statistical problem can be solved, with neurobiological > data, it is almost never wise to statistically test interaction > effects in designs more complicated than the 2-by-2 factorial design. > In these more complicated designs, you always end up with F-tests, > which do not inform you about the pattern in the data that is > responsible for the interaction effect. > > > > Best, > > > > Eric > > > > > > > > > From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] > Sent: dinsdag 28 oktober 2014 13:22 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > > > > Thank you, Eelke. > I'm sorry I am not picking this up more quickly. > > > > > > Your examples of passing either multiple structs or cell arrays to > ft_freqstatistics deals with one group of subjects in multiple > conditions, or two groups in one condition, respectively. I have two > groups, both doing multiple (11) conditions and I would like to know > how to handle that in ft_freqstatistics. What I require seems to be > similar to what Eric Maris wrote about here: > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effec > t_using_cluster-based_permutation_tests > > > > > > but instead of a 2-by-2 factorial design, I am using a 2-by-11 > factorial design. As such, I am not sure how this translates when > making difference data structures. I hope I am not missing something > obvious. > > > > > > Thanks again, > > > Dylan > > > > > > On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > > wrote: > > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their- > contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one unit- > of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles < > dylan.delosangeles at gmail.com > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of > two or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up > with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 > electrodes x 3 frequencies x 2049 time points, rather than one struct > with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x > time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config time = > > EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis cfg = []; % clear cfg > > cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = > 1:0.05:time; > > % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end > > > > My second problem is loading in the second group of 12 subjects and > what that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous > email, > > that I should be using indepsamplesF for more than two conditions > (I > > have 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < > eelke.spaak at donders.ru.nl > > wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two > groups > > of observations, and not to the same group of observations measured > in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then > use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) > cell > > arrays, corresponding to the conditions, you can input them into > the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above > is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles < > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > >> time-frequency data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > >> trials) and the two experimental designs (between- and within-UO), > >> the tutorial covers statistics on data in two conditions in a > >> between-trials, in a within-trials and in a within-subjects > design. > >> However, I am wondering if there is any information about the > fourth type of experiment design: between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both > groups > >> are measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > >> (multiple subjects in multiple experimental conditions), such that > my > >> design is multiple groups in multiple experimental conditions. Is > it > >> a case of first averaging over all trials belonging to each of the > >> experimental conditions for each subject (as instructed in > tutorial), > >> and then averaging over all subjects in each group? > >> > >> Configuration code for setting up the design currently looks like > >> this; grp = 2; subj = 11; design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when > doing > >> these statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From f.roux at bcbl.eu Tue Nov 4 12:40:29 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 4 Nov 2014 12:40:29 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <020d01cff821$91fab690$b5f023b0$@maris@psych.ru.nl> Message-ID: <746608921.3739439.1415101229761.JavaMail.root@bcbl.eu> Hi Eric, thanks for getting back about this so quickly. This is very helpful. Do you think I could also combine depsamplesT with indepsamplesregrT? I was thinking to do something like this: % First test for the general effect of WM-load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'depsamplesT'; cfg.ivar = 1; cfg.uvar = 2; cfg.design = []; cfg.design(1,:) = [ones(1,length(dat3)) 2*ones(1,length(dat2))]; cfg.design(2,:) = [1:length(dat3) 1:length(dat2)]; [depT1] = ft_freqstatistics(cfg,dat3{:},dat2{:});% WM-load effect #1 cfg.design = []; cfg.design(1,:) = [ones(1,length(dat2)) 2*ones(1,length(dat1))]; cfg.design(2,:) = [1:length(dat2) 1:length(dat1)]; [depT2] = ft_freqstatistics(cfg,dat2{:},dat1{:});% WM-load effect #2 % Second test for the general effect of age in the data while controlling for load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'indepsamplesregrT'; cfg.ivar = 1; cfg.cvar = 2; cfg.design = []; cfg.design(1,:) = [Age Age Age]; cfg.design(2,:) = [ones(1,length(dat1)) 2*ones(1,length(dat2)) 3*ones(1,length(dat3))]; indepregT = ft_freqstatistics(cfg,dat1{:},dat2{:},dat3{:}); % Finally get the mixed-effects for Age and WM-load by combining the mask-data from the previous steps mixed_effects.mask = depT1.mask.*depT2.mask.*indepregT.mask; That way I would identify the channelxtimexfrequency data-points showing both an effect of WM-load and Age. Do you think that this would make sense or should I stick to depsamplesregrT and indepsamplesregrT? Best, Fred Frédéric Roux ----- Original Message ----- From: "Eric Maris" To: "FieldTrip discussion list" Sent: Tuesday, November 4, 2014 12:22:12 PM Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Hi Fred, What you ask can definitely be done in Fieldtrip. The analyses you need are very similar to those of Vladimir Litvak, for who I implemented the statfuns indepsamplesRegrT and depsamplesRegrT. To give you the recipe, I would have to go back to the code, because it is such a long time ago. Anyhow, you now know where to look, and I trust that you can get a long way yourself. Best, Eric Maris > -----Original Message----- > From: Frédéric Roux [mailto:f.roux at bcbl.eu] > Sent: dinsdag 4 november 2014 11:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > Dear all, > > I would like to follow up on this, as I am currently struggling > myself with the coding of the design matrix of my analysis. > > I have MEG data from n = 95 participants aged between 12 and 27 years > on a WM-task with 3 WM-load conditions. > > I would like to investigate the effects of age (continuous variable > ranging from 12 to 27) and WM-load (categorical variable ranging from > 1-3) on delay-activity in different frequency-bands. > > What would be the correct way to perform such an analysis in > fieldtrip? > > Would this be akin to a mixed-effects design? > > Best regards, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Eric Maris" > To: "FieldTrip discussion list" > Sent: Friday, October 31, 2014 4:56:16 PM > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > > > > > > Dear Dylan, > > > > I replied to your question on the Fieldtrip faq page that you refer > to. Although the problem can be solved, it is not implemented yet, > because it requires the implementation of three new statfuns: > Hotelling’s T-square for dependent samples, Hotelling’s T-square for > independent samples, and Wilk’s lambda. A good statistics book (e.g., > Johnson & Wichern) will show you how to do this yourself. Otherwise, > you have to be patient. > > > > Although your statistical problem can be solved, with neurobiological > data, it is almost never wise to statistically test interaction > effects in designs more complicated than the 2-by-2 factorial design. > In these more complicated designs, you always end up with F-tests, > which do not inform you about the pattern in the data that is > responsible for the interaction effect. > > > > Best, > > > > Eric > > > > > > > > > From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] > Sent: dinsdag 28 oktober 2014 13:22 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > > > > Thank you, Eelke. > I'm sorry I am not picking this up more quickly. > > > > > > Your examples of passing either multiple structs or cell arrays to > ft_freqstatistics deals with one group of subjects in multiple > conditions, or two groups in one condition, respectively. I have two > groups, both doing multiple (11) conditions and I would like to know > how to handle that in ft_freqstatistics. What I require seems to be > similar to what Eric Maris wrote about here: > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effec > t_using_cluster-based_permutation_tests > > > > > > but instead of a 2-by-2 factorial design, I am using a 2-by-11 > factorial design. As such, I am not sure how this translates when > making difference data structures. I hope I am not missing something > obvious. > > > > > > Thanks again, > > > Dylan > > > > > > On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > > wrote: > > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their- > contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one unit- > of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles < > dylan.delosangeles at gmail.com > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of > two or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up > with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 > electrodes x 3 frequencies x 2049 time points, rather than one struct > with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x > time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config time = > > EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis cfg = []; % clear cfg > > cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = > 1:0.05:time; > > % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end > > > > My second problem is loading in the second group of 12 subjects and > what that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous > email, > > that I should be using indepsamplesF for more than two conditions > (I > > have 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < > eelke.spaak at donders.ru.nl > > wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two > groups > > of observations, and not to the same group of observations measured > in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then > use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) > cell > > arrays, corresponding to the conditions, you can input them into > the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above > is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles < > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > >> time-frequency data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > >> trials) and the two experimental designs (between- and within-UO), > >> the tutorial covers statistics on data in two conditions in a > >> between-trials, in a within-trials and in a within-subjects > design. > >> However, I am wondering if there is any information about the > fourth type of experiment design: between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both > groups > >> are measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > >> (multiple subjects in multiple experimental conditions), such that > my > >> design is multiple groups in multiple experimental conditions. Is > it > >> a case of first averaging over all trials belonging to each of the > >> experimental conditions for each subject (as instructed in > tutorial), > >> and then averaging over all subjects in each group? > >> > >> Configuration code for setting up the design currently looks like > >> this; grp = 2; subj = 11; design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when > doing > >> these statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From f.roux at bcbl.eu Tue Nov 4 12:40:29 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 4 Nov 2014 12:40:29 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <020d01cff821$91fab690$b5f023b0$@maris@psych.ru.nl> Message-ID: <746608921.3739439.1415101229761.JavaMail.root@bcbl.eu> Hi Eric, thanks for getting back about this so quickly. This is very helpful. Do you think I could also combine depsamplesT with indepsamplesregrT? I was thinking to do something like this: % First test for the general effect of WM-load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'depsamplesT'; cfg.ivar = 1; cfg.uvar = 2; cfg.design = []; cfg.design(1,:) = [ones(1,length(dat3)) 2*ones(1,length(dat2))]; cfg.design(2,:) = [1:length(dat3) 1:length(dat2)]; [depT1] = ft_freqstatistics(cfg,dat3{:},dat2{:});% WM-load effect #1 cfg.design = []; cfg.design(1,:) = [ones(1,length(dat2)) 2*ones(1,length(dat1))]; cfg.design(2,:) = [1:length(dat2) 1:length(dat1)]; [depT2] = ft_freqstatistics(cfg,dat2{:},dat1{:});% WM-load effect #2 % Second test for the general effect of age in the data while controlling for load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'indepsamplesregrT'; cfg.ivar = 1; cfg.cvar = 2; cfg.design = []; cfg.design(1,:) = [Age Age Age]; cfg.design(2,:) = [ones(1,length(dat1)) 2*ones(1,length(dat2)) 3*ones(1,length(dat3))]; indepregT = ft_freqstatistics(cfg,dat1{:},dat2{:},dat3{:}); % Finally get the mixed-effects for Age and WM-load by combining the mask-data from the previous steps mixed_effects.mask = depT1.mask.*depT2.mask.*indepregT.mask; That way I would identify the channelxtimexfrequency data-points showing both an effect of WM-load and Age. Do you think that this would make sense or should I stick to depsamplesregrT and indepsamplesregrT? Best, Fred Frédéric Roux ----- Original Message ----- From: "Eric Maris" To: "FieldTrip discussion list" Sent: Tuesday, November 4, 2014 12:22:12 PM Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Hi Fred, What you ask can definitely be done in Fieldtrip. The analyses you need are very similar to those of Vladimir Litvak, for who I implemented the statfuns indepsamplesRegrT and depsamplesRegrT. To give you the recipe, I would have to go back to the code, because it is such a long time ago. Anyhow, you now know where to look, and I trust that you can get a long way yourself. Best, Eric Maris > -----Original Message----- > From: Frédéric Roux [mailto:f.roux at bcbl.eu] > Sent: dinsdag 4 november 2014 11:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > Dear all, > > I would like to follow up on this, as I am currently struggling > myself with the coding of the design matrix of my analysis. > > I have MEG data from n = 95 participants aged between 12 and 27 years > on a WM-task with 3 WM-load conditions. > > I would like to investigate the effects of age (continuous variable > ranging from 12 to 27) and WM-load (categorical variable ranging from > 1-3) on delay-activity in different frequency-bands. > > What would be the correct way to perform such an analysis in > fieldtrip? > > Would this be akin to a mixed-effects design? > > Best regards, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Eric Maris" > To: "FieldTrip discussion list" > Sent: Friday, October 31, 2014 4:56:16 PM > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > > > > > > Dear Dylan, > > > > I replied to your question on the Fieldtrip faq page that you refer > to. Although the problem can be solved, it is not implemented yet, > because it requires the implementation of three new statfuns: > Hotelling’s T-square for dependent samples, Hotelling’s T-square for > independent samples, and Wilk’s lambda. A good statistics book (e.g., > Johnson & Wichern) will show you how to do this yourself. Otherwise, > you have to be patient. > > > > Although your statistical problem can be solved, with neurobiological > data, it is almost never wise to statistically test interaction > effects in designs more complicated than the 2-by-2 factorial design. > In these more complicated designs, you always end up with F-tests, > which do not inform you about the pattern in the data that is > responsible for the interaction effect. > > > > Best, > > > > Eric > > > > > > > > > From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] > Sent: dinsdag 28 oktober 2014 13:22 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > > > > Thank you, Eelke. > I'm sorry I am not picking this up more quickly. > > > > > > Your examples of passing either multiple structs or cell arrays to > ft_freqstatistics deals with one group of subjects in multiple > conditions, or two groups in one condition, respectively. I have two > groups, both doing multiple (11) conditions and I would like to know > how to handle that in ft_freqstatistics. What I require seems to be > similar to what Eric Maris wrote about here: > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effec > t_using_cluster-based_permutation_tests > > > > > > but instead of a 2-by-2 factorial design, I am using a 2-by-11 > factorial design. As such, I am not sure how this translates when > making difference data structures. I hope I am not missing something > obvious. > > > > > > Thanks again, > > > Dylan > > > > > > On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > > wrote: > > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their- > contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one unit- > of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles < > dylan.delosangeles at gmail.com > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of > two or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up > with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 > electrodes x 3 frequencies x 2049 time points, rather than one struct > with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x > time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config time = > > EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis cfg = []; % clear cfg > > cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = > 1:0.05:time; > > % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end > > > > My second problem is loading in the second group of 12 subjects and > what that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous > email, > > that I should be using indepsamplesF for more than two conditions > (I > > have 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < > eelke.spaak at donders.ru.nl > > wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two > groups > > of observations, and not to the same group of observations measured > in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then > use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) > cell > > arrays, corresponding to the conditions, you can input them into > the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above > is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles < > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > >> time-frequency data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > >> trials) and the two experimental designs (between- and within-UO), > >> the tutorial covers statistics on data in two conditions in a > >> between-trials, in a within-trials and in a within-subjects > design. > >> However, I am wondering if there is any information about the > fourth type of experiment design: between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both > groups > >> are measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > >> (multiple subjects in multiple experimental conditions), such that > my > >> design is multiple groups in multiple experimental conditions. Is > it > >> a case of first averaging over all trials belonging to each of the > >> experimental conditions for each subject (as instructed in > tutorial), > >> and then averaging over all subjects in each group? > >> > >> Configuration code for setting up the design currently looks like > >> this; grp = 2; subj = 11; design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when > doing > >> these statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ktyler at swin.edu.au Wed Nov 5 14:50:48 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Wed, 5 Nov 2014 13:50:48 +0000 Subject: [FieldTrip] (no subject) Message-ID: Dear Field trippers, And especially dear Neuromag users, I have been going back over the analysis of my study, ironing out issues, and am finding that I am still having problems with source analysis coming up with some unexpected and probably inaccurate locations for clusters of significant effects. I have decided to go back and look at a simple right handed button push, in one subject, to check if I was able to locate a realistic region in M1. >From the attached jpeg, you will see that the analysis is not accurately locating left hemisphere motor regions. I know I can't expect absolute accuracy, but I would be hoping for more than this. I have included my code (below) and if any one has any suggestions about how to remedy this and produce more accurate results, please let me know!!! I am wondering if I have realigned my mri to the neuromag system correctly, and have attached another jpeg of my volume conduction model, plotted alongside the neuromag sensors. Neuromag users, does this look accurate to you? As a general fix, I was wondering if any neuromag users would be happy to supply their FT code for use of mri, including realignment of mri to the neuromag system, segmentation and the creation of the volume conduction model? As always, any help is much appreciated! Here is the code as I have been currently using it: %% Load MRI mri = ft_read_mri('Subject1.nii'); %% Realigning cfg=[]; cfg.coordsys = 'neuromag'; mri = ft_volumerealign(cfg, mri); %% Segmentation. cfg = []; cfg.coordsys='neuromag'; cfg.units='mm'; seg = ft_volumesegment(cfg, mri); %% Prepare volumne conduction model cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); %% Non warped grid for use in single subject comparison btw conditions cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.vol = vol; sourcemodel = ft_prepare_sourcemodel(cfg); %% Calculates leadfields cfg = []; cfg.grid=sourcemodel; cfg.vol = vol; cfg.channel={'MEGGRAD'};% For Planar gradiometers only cfg.grad=grad;%This needs to be edited to represent the MEG data set which has just been loaded grid = ft_prepare_leadfield(cfg, Condition1); %% Append individuals data from two conditions. %This is so as to create a common filter, from the two conditions. cfg=[]; cfg.appenddim = 'rpt'; combined = ft_appendtimelock(cfg, Condition1, Condition2); %% Calculate covariance and timelock. Input data should NOT have been timelocked before this. cfg = []; cfg.keeptrials = 'yes'; cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; cfg.vartrllength = 2; cfg.channel='MEGGRAD'; tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); tlckavgCombined = ft_timelockanalysis(cfg, combined); %% Create spatial filter using the lcmv beamformer cfg = []; cfg.grid = grid; % leadfield, which has the grid information cfg.grad=grad; cfg.vol = vol; % volume conduction model (headmodel) cfg.keepfilter = 'yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD cfg.channel='MEGGRAD'; sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% %% cfg.grid.filter = sourceCombined.avg.filter; cfg.rawtrial='yes'; sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); %% The cluster stats at source space: %% cfg=[]; cfg.dim=sourceCond1.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.05; cfg.tail = 0; cfg.clusteralpha = 0.005; cfg.minnbchan = 8; cfg.correcttail = 'alpha'; cfg.clusterstatistic = 'maxsum'; Nsub = 84; cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; cfg.ivar = 1; % the 1st row in cfg.design contains the independent variable cfg.uvar = 2; % the 2nd row in cfg.design contains the subject number stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); %% interpolate the t maps to the structural MRI of the subject % cfg = []; cfg.parameter = 'mask'; statplot = ft_sourceinterpolate(cfg,stat, mri); %% plot the t values on the MRI % cfg = []; cfg.method = 'slice'; cfg.funparameter = 'mask'; cfg.maskparameter = 'funparameter'; figure ft_sourceplot(cfg, statplot); %% -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RH_ButtonPush.jpg Type: image/jpeg Size: 37138 bytes Desc: RH_ButtonPush.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Sensors_Volume.jpg Type: image/jpeg Size: 26947 bytes Desc: Sensors_Volume.jpg URL: From stephen.whitmarsh at gmail.com Wed Nov 5 15:59:09 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 5 Nov 2014 15:59:09 +0100 Subject: [FieldTrip] (no subject) In-Reply-To: References: Message-ID: Hi Kaelasha, It's hard to evaluate why the localization in not exactly how you would expect it, but here are some idea you could try from the top of my head. Note I never used LCMV beamformer myself, although I've done DICS. Also, to me there seems to be not something obviously *wrong *in the code or pictures, so I'm just suggesting some thoughts here. - Beamformer performance is VERY dependent on the data. Check your sensor level data, clean it more if necessary. - Play around with including more or less data centered around the component you are localizing for both the common filter as the data you localize. Since I don't know the details of the data (nor do i have experience with LCMV) your choices here are hard to evaluate. - Plot the scalp as well to get a better idea whether your co-registration is accurate. If you have additional headpoints e.g. by using a Polhemus, that would help. - Play around with some regularization - in ft_sourceanalysis use e.g.: cfg.alpha = '10%'; - Evaluate your lcmv beamformer with a dipole fit. - Check other subjects/recordings - other recordings might be better (or worse...) Finally, if you haven't already, take a look at the scripts we used in our recent workshop using a Neuromag system (although as I said I see nothing wrong with your script): http://fieldtrip.fcdonders.nl/workshop/stockholm2014q3 The beamformer lecture there given by Robert on Beamforming is also online: http://natmeg.se/wp/activities/natmeg-lectures/ Good luck! Stephen On 5 November 2014 14:50, Kaelasha Tyler wrote: > Dear Field trippers, > And especially dear Neuromag users, > > I have been going back over the analysis of my study, ironing out > issues, and am finding that I am still having problems with source analysis > coming up with some unexpected and probably inaccurate locations for > clusters of significant effects. > > I have decided to go back and look at a simple right handed button push, > in one subject, to check if I was able to locate a realistic region in M1. > > From the attached jpeg, you will see that the analysis is not accurately > locating left hemisphere motor regions. I know I can't expect absolute > accuracy, but I would be hoping for more than this. > > I have included my code (below) and if any one has any suggestions about > how to remedy this and produce more accurate results, please let me know!!! > > I am wondering if I have realigned my mri to the neuromag system > correctly, and have attached another jpeg of my volume conduction model, > plotted alongside the neuromag sensors. > > Neuromag users, does this look accurate to you? > > As a general fix, I was wondering if any neuromag users would be happy > to supply their FT code for use of mri, including realignment of mri to the > neuromag system, segmentation and the creation of the volume conduction > model? > > As always, any help is much appreciated! > > Here is the code as I have been currently using it: > > %% Load MRI > > mri = ft_read_mri('Subject1.nii'); > > %% Realigning > cfg=[]; > cfg.coordsys = 'neuromag'; > mri = ft_volumerealign(cfg, mri); > > %% Segmentation. > > cfg = []; > cfg.coordsys='neuromag'; > cfg.units='mm'; > seg = ft_volumesegment(cfg, mri); > > %% Prepare volumne conduction model > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > %% Non warped grid for use in single subject comparison btw conditions > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.vol = vol; > sourcemodel = ft_prepare_sourcemodel(cfg); > > %% Calculates leadfields > > cfg = []; > cfg.grid=sourcemodel; > cfg.vol = vol; > cfg.channel={'MEGGRAD'};% For Planar gradiometers only > cfg.grad=grad;%This needs to be edited to represent the MEG data set which > has just been loaded > grid = ft_prepare_leadfield(cfg, Condition1); > > %% Append individuals data from two conditions. > %This is so as to create a common filter, from the two conditions. > cfg=[]; > cfg.appenddim = 'rpt'; > combined = ft_appendtimelock(cfg, Condition1, Condition2); > > %% Calculate covariance and timelock. Input data should NOT have been > timelocked before this. > > cfg = []; > cfg.keeptrials = 'yes'; > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > cfg.vartrllength = 2; > cfg.channel='MEGGRAD'; > tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); > tlckavgCombined = ft_timelockanalysis(cfg, combined); > > %% Create spatial filter using the lcmv beamformer > cfg = []; > cfg.grid = grid; % leadfield, which has the grid information > cfg.grad=grad; > cfg.vol = vol; % volume conduction model (headmodel) > cfg.keepfilter = 'yes'; > cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD > cfg.channel='MEGGRAD'; > sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% > %% > cfg.grid.filter = sourceCombined.avg.filter; > cfg.rawtrial='yes'; > sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); > > %% The cluster stats at source space: > > %% > cfg=[]; > cfg.dim=sourceCond1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.05; > cfg.tail = 0; > cfg.clusteralpha = 0.005; > cfg.minnbchan = 8; > cfg.correcttail = 'alpha'; > cfg.clusterstatistic = 'maxsum'; > Nsub = 84; > cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > cfg.ivar = 1; % the 1st row in cfg.design contains the > independent variable > cfg.uvar = 2; % the 2nd row in cfg.design contains the > subject number > > stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); > > %% interpolate the t maps to the structural MRI of the subject % > cfg = []; > cfg.parameter = 'mask'; > statplot = ft_sourceinterpolate(cfg,stat, mri); > %% plot the t values on the MRI % > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'mask'; > cfg.maskparameter = 'funparameter'; > figure > ft_sourceplot(cfg, statplot); > %% > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Wed Nov 5 16:15:31 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Wed, 5 Nov 2014 16:15:31 +0100 Subject: [FieldTrip] (no subject) In-Reply-To: References: Message-ID: Dear Kaelasha, I recently came across the exact same problem in my Neuromag source analysis: mislocalization of motor beta over M1 (it was too posterior in my case). I used LCMV, so my analyses are quite similar to yours. Do you use the Elekta Maxfilter routine of *tSSS *(a preprocessing step to remove non-brain noise)? There, I had the option *-trans* enabled, which transforms the sensor data of every subject to a common space, so that subjects become better comparable *in sensor space*. But this should not be used if you do source analysis, because the forward model uses the coregistered MRI, taking into account how that subject was positioned in the scanner. When I redid tSSS without the -trans option, and recomputed the forward model, motor beta suppression was right where it should be. As for the coregistration, we used a polhemus point method of digitized 3D points, which allows for continuous tracking of head position in the Elekta scanner. With those points, there are built-in ways to coregister the MRI using the Elekta software (somebody else helped me with that, so I don't know the details how to do this). With the coregistered MRIs, I just followed the fieldtrip tutorial up to ft_prepare_leadfield, and everything went fine. Best, Joram On Wed, Nov 5, 2014 at 2:50 PM, Kaelasha Tyler wrote: > Dear Field trippers, > And especially dear Neuromag users, > > I have been going back over the analysis of my study, ironing out > issues, and am finding that I am still having problems with source analysis > coming up with some unexpected and probably inaccurate locations for > clusters of significant effects. > > I have decided to go back and look at a simple right handed button push, > in one subject, to check if I was able to locate a realistic region in M1. > > From the attached jpeg, you will see that the analysis is not accurately > locating left hemisphere motor regions. I know I can't expect absolute > accuracy, but I would be hoping for more than this. > > I have included my code (below) and if any one has any suggestions about > how to remedy this and produce more accurate results, please let me know!!! > > I am wondering if I have realigned my mri to the neuromag system > correctly, and have attached another jpeg of my volume conduction model, > plotted alongside the neuromag sensors. > > Neuromag users, does this look accurate to you? > > As a general fix, I was wondering if any neuromag users would be happy > to supply their FT code for use of mri, including realignment of mri to the > neuromag system, segmentation and the creation of the volume conduction > model? > > As always, any help is much appreciated! > > Here is the code as I have been currently using it: > > %% Load MRI > > mri = ft_read_mri('Subject1.nii'); > > %% Realigning > cfg=[]; > cfg.coordsys = 'neuromag'; > mri = ft_volumerealign(cfg, mri); > > %% Segmentation. > > cfg = []; > cfg.coordsys='neuromag'; > cfg.units='mm'; > seg = ft_volumesegment(cfg, mri); > > %% Prepare volumne conduction model > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > %% Non warped grid for use in single subject comparison btw conditions > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.vol = vol; > sourcemodel = ft_prepare_sourcemodel(cfg); > > %% Calculates leadfields > > cfg = []; > cfg.grid=sourcemodel; > cfg.vol = vol; > cfg.channel={'MEGGRAD'};% For Planar gradiometers only > cfg.grad=grad;%This needs to be edited to represent the MEG data set which > has just been loaded > grid = ft_prepare_leadfield(cfg, Condition1); > > %% Append individuals data from two conditions. > %This is so as to create a common filter, from the two conditions. > cfg=[]; > cfg.appenddim = 'rpt'; > combined = ft_appendtimelock(cfg, Condition1, Condition2); > > %% Calculate covariance and timelock. Input data should NOT have been > timelocked before this. > > cfg = []; > cfg.keeptrials = 'yes'; > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > cfg.vartrllength = 2; > cfg.channel='MEGGRAD'; > tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); > tlckavgCombined = ft_timelockanalysis(cfg, combined); > > %% Create spatial filter using the lcmv beamformer > cfg = []; > cfg.grid = grid; % leadfield, which has the grid information > cfg.grad=grad; > cfg.vol = vol; % volume conduction model (headmodel) > cfg.keepfilter = 'yes'; > cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD > cfg.channel='MEGGRAD'; > sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% > %% > cfg.grid.filter = sourceCombined.avg.filter; > cfg.rawtrial='yes'; > sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); > > %% The cluster stats at source space: > > %% > cfg=[]; > cfg.dim=sourceCond1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.05; > cfg.tail = 0; > cfg.clusteralpha = 0.005; > cfg.minnbchan = 8; > cfg.correcttail = 'alpha'; > cfg.clusterstatistic = 'maxsum'; > Nsub = 84; > cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > cfg.ivar = 1; % the 1st row in cfg.design contains the > independent variable > cfg.uvar = 2; % the 2nd row in cfg.design contains the > subject number > > stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); > > %% interpolate the t maps to the structural MRI of the subject % > cfg = []; > cfg.parameter = 'mask'; > statplot = ft_sourceinterpolate(cfg,stat, mri); > %% plot the t values on the MRI % > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'mask'; > cfg.maskparameter = 'funparameter'; > figure > ft_sourceplot(cfg, statplot); > %% > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Nov 5 19:30:29 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 5 Nov 2014 19:30:29 +0100 Subject: [FieldTrip] Timestamp format using ft_spike functions In-Reply-To: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> References: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> Message-ID: Hi Dominic, Timestamps are encoded in the original representation of the corresponding acquisition system. For Plexon that means that they are at 40kHz, for Neuralynx they are approximately 1MHz. This allows the different types of data acquired with the system (spikes, LFP, events) to be synchronized. best regards, Robert On 31 Oct 2014, at 16:47, Dominic Depke wrote: > Dear all, > > I have a question regarding the data structure of spikedata. > Especially I would like to ask how timestamps are encoded in the spike.timestamp structure (which timecode format e.g. clockticks, micro/mili/seconds) for further analysis in fieldtrip. > > > Thanks and best wishes, > Dominic > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > Dominic Depke, M.Sc. > PhD student > Institut für Physiologie I > Robert-Koch-Straße 27a > DE-48149 Münster > Tel. : +49 251-83-58112 > Email: depke at uni-muenster.de > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Wed Nov 5 21:55:25 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Wed, 5 Nov 2014 20:55:25 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Hi Stan, Thanks for the suggestion. However, the same error also occurs when i use cfg.parameter = 'avg.pow'. I wonder if anyone else has encountered problems when inputting data to ft_sourcegrandaverag and might be able to help me? Or if anyone has encountered the following error before or knows why it might be occurring? ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Best, Emma Date: Mon, 3 Nov 2014 16:54:15 +0100 (CET) From: "Stan van Pelt" To: "'FieldTrip discussion list'" Subject: Re: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: <07bb01cff77e$6b7a9790$ 426fc6b0$@vanpelt at fcdonders.ru.nl> Content-Type: text/plain; charset="utf-8" Hi Emma, I am unfamiliar with this type of error. It seems however that you still have an inconsistency in your data. You define ?data{i}.avg.pow?, but later on use ?cfg.parameter = 'pow';?. You should change one of the two (e.g. use cfg.parameter = 'avg.pow';) Hope that helps. Stan From: Emma Holmes [mailto:eh776 at york.ac.uk] Sent: maandag 3 november 2014 14:02 To: fieldtrip at science.ru.nl Cc: s.vanpelt at fcdonders.ru.nl Subject: Spatio-temporal cluster-based permutation analysis on EEG sources Hi Stan, Thanks for the suggestion. When I try that, I get the following error ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Error in ==> ft_sourcegrandaverage at 82 varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I am unsure why this occurs. My data is now structured in the following way: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.avg.pow = [902629 x 11 double] % source estimates The following is the method I use: cfg = []; cfg.keepindividual = 'yes'; cfg.parameter = 'pow'; grandavgA = ft_sourcegrandaverage(cfg, data{:}); Best, Emma -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Thu Nov 6 06:20:31 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Thu, 6 Nov 2014 05:20:31 +0000 Subject: [FieldTrip] (no subject) In-Reply-To: References: , Message-ID: Hi all, Some great suggestions and resources here. I'll try a few of these suggestions out and get back to the post with results. Cheers, Kaelasha ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Joram van Driel [joramvandriel at gmail.com] Sent: Thursday, 6 November 2014 2:15 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] (no subject) Dear Kaelasha, I recently came across the exact same problem in my Neuromag source analysis: mislocalization of motor beta over M1 (it was too posterior in my case). I used LCMV, so my analyses are quite similar to yours. Do you use the Elekta Maxfilter routine of tSSS (a preprocessing step to remove non-brain noise)? There, I had the option -trans enabled, which transforms the sensor data of every subject to a common space, so that subjects become better comparable in sensor space. But this should not be used if you do source analysis, because the forward model uses the coregistered MRI, taking into account how that subject was positioned in the scanner. When I redid tSSS without the -trans option, and recomputed the forward model, motor beta suppression was right where it should be. As for the coregistration, we used a polhemus point method of digitized 3D points, which allows for continuous tracking of head position in the Elekta scanner. With those points, there are built-in ways to coregister the MRI using the Elekta software (somebody else helped me with that, so I don't know the details how to do this). With the coregistered MRIs, I just followed the fieldtrip tutorial up to ft_prepare_leadfield, and everything went fine. Best, Joram Thursday, 6 November 2014 2:14 AM Hi Kaelasha, It's hard to evaluate why the localization in not exactly how you would expect it, but here are some idea you could try from the top of my head. Note I never used LCMV beamformer myself, although I've done DICS. Also, to me there seems to be not something obviously wrong in the code or pictures, so I'm just suggesting some thoughts here. - Beamformer performance is VERY dependent on the data. Check your sensor level data, clean it more if necessary. - Play around with including more or less data centered around the component you are localizing for both the common filter as the data you localize. Since I don't know the details of the data (nor do i have experience with LCMV) your choices here are hard to evaluate. - Plot the scalp as well to get a better idea whether your co-registration is accurate. If you have additional headpoints e.g. by using a Polhemus, that would help. - Play around with some regularization - in ft_sourceanalysis use e.g.: cfg.alpha = '10%'; - Evaluate your lcmv beamformer with a dipole fit. - Check other subjects/recordings - other recordings might be better (or worse...) Finally, if you haven't already, take a look at the scripts we used in our recent workshop using a Neuromag system (although as I said I see nothing wrong with your script): http://fieldtrip.fcdonders.nl/workshop/stockholm2014q3 The beamformer lecture there given by Robert on Beamforming is also online: http://natmeg.se/wp/activities/natmeg-lectures/ Good luck! Stephen On Wed, Nov 5, 2014 at 2:50 PM, Kaelasha Tyler > wrote: Dear Field trippers, And especially dear Neuromag users, I have been going back over the analysis of my study, ironing out issues, and am finding that I am still having problems with source analysis coming up with some unexpected and probably inaccurate locations for clusters of significant effects. I have decided to go back and look at a simple right handed button push, in one subject, to check if I was able to locate a realistic region in M1. >From the attached jpeg, you will see that the analysis is not accurately locating left hemisphere motor regions. I know I can't expect absolute accuracy, but I would be hoping for more than this. I have included my code (below) and if any one has any suggestions about how to remedy this and produce more accurate results, please let me know!!! I am wondering if I have realigned my mri to the neuromag system correctly, and have attached another jpeg of my volume conduction model, plotted alongside the neuromag sensors. Neuromag users, does this look accurate to you? As a general fix, I was wondering if any neuromag users would be happy to supply their FT code for use of mri, including realignment of mri to the neuromag system, segmentation and the creation of the volume conduction model? As always, any help is much appreciated! Here is the code as I have been currently using it: %% Load MRI mri = ft_read_mri('Subject1.nii'); %% Realigning cfg=[]; cfg.coordsys = 'neuromag'; mri = ft_volumerealign(cfg, mri); %% Segmentation. cfg = []; cfg.coordsys='neuromag'; cfg.units='mm'; seg = ft_volumesegment(cfg, mri); %% Prepare volumne conduction model cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); %% Non warped grid for use in single subject comparison btw conditions cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.vol = vol; sourcemodel = ft_prepare_sourcemodel(cfg); %% Calculates leadfields cfg = []; cfg.grid=sourcemodel; cfg.vol = vol; cfg.channel={'MEGGRAD'};% For Planar gradiometers only cfg.grad=grad;%This needs to be edited to represent the MEG data set which has just been loaded grid = ft_prepare_leadfield(cfg, Condition1); %% Append individuals data from two conditions. %This is so as to create a common filter, from the two conditions. cfg=[]; cfg.appenddim = 'rpt'; combined = ft_appendtimelock(cfg, Condition1, Condition2); %% Calculate covariance and timelock. Input data should NOT have been timelocked before this. cfg = []; cfg.keeptrials = 'yes'; cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; cfg.vartrllength = 2; cfg.channel='MEGGRAD'; tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); tlckavgCombined = ft_timelockanalysis(cfg, combined); %% Create spatial filter using the lcmv beamformer cfg = []; cfg.grid = grid; % leadfield, which has the grid information cfg.grad=grad; cfg.vol = vol; % volume conduction model (headmodel) cfg.keepfilter = 'yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD cfg.channel='MEGGRAD'; sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% %% cfg.grid.filter = sourceCombined.avg.filter; cfg.rawtrial='yes'; sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); %% The cluster stats at source space: %% cfg=[]; cfg.dim=sourceCond1.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.05; cfg.tail = 0; cfg.clusteralpha = 0.005; cfg.minnbchan = 8; cfg.correcttail = 'alpha'; cfg.clusterstatistic = 'maxsum'; Nsub = 84; cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; cfg.ivar = 1; % the 1st row in cfg.design contains the independent variable cfg.uvar = 2; % the 2nd row in cfg.design contains the subject number stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); %% interpolate the t maps to the structural MRI of the subject % cfg = []; cfg.parameter = 'mask'; statplot = ft_sourceinterpolate(cfg,stat, mri); %% plot the t values on the MRI % cfg = []; cfg.method = 'slice'; cfg.funparameter = 'mask'; cfg.maskparameter = 'funparameter'; figure ft_sourceplot(cfg, statplot); %% _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominic.depke at ruhr-uni-bochum.de Thu Nov 6 13:57:47 2014 From: dominic.depke at ruhr-uni-bochum.de (Dominic Depke) Date: Thu, 6 Nov 2014 13:57:47 +0100 Subject: [FieldTrip] Timestamp format using ft_spike functions In-Reply-To: References: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> Message-ID: <005401cff9c1$43aba340$cb02e9c0$@ruhr-uni-bochum.de> Hi Robert, Thanks for your answer. Actually I’m working with a dataformat which is currently not supported (Sonfiles, .smr), but it is possible to access and export the data in various timeformats (including clockticks, microseconds etc.) using functions from the SON-library provided by SigTOOL. Now I would like to know whether I can simply create my own raw data structure for further analysis using functions from the spike-toolbox or do ft_spike functions still deal with different timecode-formats once the raw data has been read into memory (so how should the (raw) spike data be represented if no fileformat is specified)? Here’s just an example of my import procedure: fid = fopen(‘filename.smr'); %open file and return filehandle info_tmp = SONChanList(fid); %get channelinformation spike = []; kind = reshape({info_tmp.kind},size({info_tmp.kind},2),1); %find units and LFP if any(cell2mat(kind(:)) == 6) == 0 error('no spike channels detected') end %find indices and names of spikechannels %kind = 1 -> waveform, kind = 6 -> wavemark (spikes) [wvmk] = find((cell2mat({info_tmp.kind})) == 6); %get index of wavemarkchannels spikechan = [info_tmp(wvmk)]; spike.label = reshape({spikechan.title},size({spikechan.title},2),1); sident = [spikechan.number]; %import channeldata for i = 1:length(sident) n = sident(i); tmp = [SONGetChannel(fid,n,'ticks')]; %export as clockticks spike.timestamp{1,i} = reshape([tmp.timings],1,size([tmp.timings],1)); %index (clockticks) of first spike-sample spike.waveform{1,i}(1,:,:) = double(tmp.adc)*1/6553.6; %10 V range; 16 bit int units to double (1x 32 datapoints per sike x timestamps) %create channelheader: %samplinginterval in Hz spike.hdr.Fs{1,i} = 1/(SONGetSampleInterval(fid,sident)*1e-6); spike.hdr.label{1,i} = {spikechan.title(i)}; end So in this case spikes are just represented by their clocktick-indices as well as the rest of the data. Since I know the sampling rate and the index of the first spike-datapoint (which would be similar to the timestamppersample field in the tutorials) it should be easy to synchronize them with the continuous LFP data. I assume that all the required fields are present in my spike structure but I am unsure about how fieldtrip functions deal with my timestamp representation. Thanks and best regards, Dominic Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Robert Oostenveld Gesendet: Mittwoch, 5. November 2014 19:30 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Timestamp format using ft_spike functions Hi Dominic, Timestamps are encoded in the original representation of the corresponding acquisition system. For Plexon that means that they are at 40kHz, for Neuralynx they are approximately 1MHz. This allows the different types of data acquired with the system (spikes, LFP, events) to be synchronized. best regards, Robert On 31 Oct 2014, at 16:47, Dominic Depke wrote: Dear all, I have a question regarding the data structure of spikedata. Especially I would like to ask how timestamps are encoded in the spike.timestamp structure (which timecode format e.g. clockticks, micro/mili/seconds) for further analysis in fieldtrip. Thanks and best wishes, Dominic _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Dominic Depke, M.Sc. PhD student Institut für Physiologie I Robert-Koch-Straße 27a DE-48149 Münster Tel. : +49 251-83-58112 Email: depke at uni-muenster.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From longjinyi at gmail.com Fri Nov 7 00:23:47 2014 From: longjinyi at gmail.com (Jinyi Long) Date: Thu, 6 Nov 2014 18:23:47 -0500 Subject: [FieldTrip] power-frequency figure Message-ID: Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! Best, Jinyi -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 7 07:33:13 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 7 Nov 2014 07:33:13 +0100 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: Message-ID: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Dear Jinyi, You can use ft_singleplotER to plot the power spectrum of a single channel. If you are interested in the same but for multiple channels than use ft_multiplotER. Finally if you are interested in the topography of a particular frequency you'd specify it in cfg.xlim=[begin end] and call ft_topoplotER. Good luck Tzvetan > Am 07.11.2014 um 00:23 schrieb Jinyi Long : > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! > > Best, > Jinyi > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From wangpele at gmail.com Fri Nov 7 08:12:30 2014 From: wangpele at gmail.com (Wang Jing) Date: Fri, 7 Nov 2014 15:12:30 +0800 Subject: [FieldTrip] Newbie question on WPLI Message-ID: Hi, I am a newbie in FieldTrip. I want to calculate wpli (weighted phase lag index) of two time series, e.g. EEG collected from C3 and C4. The data are ASCII format. Could you indicate me how to proceed? Thanks a lot! Regards, Wang Jing -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 7 09:27:39 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 7 Nov 2014 09:27:39 +0100 Subject: [FieldTrip] Newbie question on WPLI In-Reply-To: References: Message-ID: Dear Wang Jing, one way to get you started would be: 1.Read the ascii delimited data into matlab: http://www.mathworks.de/help/matlab/ref/dlmread.html 2.Create a data structure FieldTrip can deal with. Something along this lines: tmpdat.label={'C3' ;'C4'};% subfield with your labels fsample=1000; % for a sampling rate of 1000 this would be one second tmpdat.time = {nan(1,1000)};% create your time vector tmpdat.time{1}=(1:1:1000);% fill the time vector tmpdat.trial = {nan(2,length(tmpdat.time{1}))}; 3. Fill the NaN fields with your data from step 1. Good luck tzvetan > Hi, > > I am a newbie in FieldTrip. I want to calculate wpli (weighted phase lag index) of two time series, e.g. EEG collected from C3 and C4. The data are ASCII format. Could you indicate me how to proceed? Thanks a lot! > > Regards, > Wang Jing > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From longjinyi at gmail.com Fri Nov 7 14:24:18 2014 From: longjinyi at gmail.com (Jinyi Long) Date: Fri, 7 Nov 2014 08:24:18 -0500 Subject: [FieldTrip] power-frequency figure In-Reply-To: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Message-ID: Dear Tzvetan, Thanks for your help. First, to plot the spectral power for one channel with the 'ft_singleplotER', how can I calculate the power spectrum with 'ft_freqanalsis'? Can I use the following code to calculate and plot power spectrum? Thanks a lot! Best, Jinyi %% frequency analysis cfg = []; cfg.output = 'pow';%'fourier';% % cfg.channel = 'MEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0.5:0.05:4; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, data); %% visualize cfg = []; cfg.baseline = [-0.9 -0.1]; cfg.baselinetype = 'absolute'; cfg.maskstyle = 'saturation'; cfg.zlim = [-3e-7 3e-7]; % cfg.channel = '26'; figure ft_singleplotER(cfg, TFRhann) 2014-11-07 1:33 GMT-05:00 Tzvetan Popov : > Dear Jinyi, > You can use ft_singleplotER to plot the power spectrum of a single > channel. If you are interested in the same but for multiple channels than > use ft_multiplotER. Finally if you are interested in the topography of a > particular frequency you'd specify it in cfg.xlim=[begin end] and call > ft_topoplotER. > Good luck > Tzvetan > > > > > Am 07.11.2014 um 00:23 schrieb Jinyi Long : > > > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. > When I perform the frequency analysis with the function of > 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D > time-frequency figure at single channel? Thanks! > > > > Best, > > Jinyi > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Fri Nov 7 14:55:01 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 7 Nov 2014 13:55:01 +0000 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de>, Message-ID: Hi Jinyi, The name of the function gives you a clue on what function to use for plotting. ft_singleplotER vs. ft_singleplotTFR. ER for event-related potentials/fields, and TFR = time frequency data. Please take a look at this tutorial, all the questions you have asked can be found here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysishttp://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis Nietzsche ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Jinyi Long [longjinyi at gmail.com] Sent: 07 November 2014 14:24 To: FieldTrip discussion list Subject: Re: [FieldTrip] power-frequency figure Dear Tzvetan, Thanks for your help. First, to plot the spectral power for one channel with the 'ft_singleplotER', how can I calculate the power spectrum with 'ft_freqanalsis'? Can I use the following code to calculate and plot power spectrum? Thanks a lot! Best, Jinyi %% frequency analysis cfg = []; cfg.output = 'pow';%'fourier';% % cfg.channel = 'MEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0.5:0.05:4; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, data); %% visualize cfg = []; cfg.baseline = [-0.9 -0.1]; cfg.baselinetype = 'absolute'; cfg.maskstyle = 'saturation'; cfg.zlim = [-3e-7 3e-7]; % cfg.channel = '26'; figure ft_singleplotER(cfg, TFRhann) 2014-11-07 1:33 GMT-05:00 Tzvetan Popov >: Dear Jinyi, You can use ft_singleplotER to plot the power spectrum of a single channel. If you are interested in the same but for multiple channels than use ft_multiplotER. Finally if you are interested in the topography of a particular frequency you'd specify it in cfg.xlim=[begin end] and call ft_topoplotER. Good luck Tzvetan > Am 07.11.2014 um 00:23 schrieb Jinyi Long >: > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! > > Best, > Jinyi > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 7 14:56:41 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 7 Nov 2014 14:56:41 +0100 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Message-ID: Dear Jinyi, what you’re referring to is time-frequency analysis. From your e-mail I assumed that you’ve already performed frequency analysis, yet apparently not. You can compute the power spectrum bei using something like this: cfg = []; cfg.output = 'pow'; cfg.method = 'mtmfft'; cfg.taper = 'dpss'; cfg.foilim = [1 20]; cfg.tapsmofrq = 2; fft_data= ft_freqanalysis(cfg,data); Subsequently you can plot fft_data with the functions I mentioned in my previous e-mail. Note that we have also a video lectures section where you can get some detailed insight into frequency domain analysis. Please have a look here: http://fieldtrip.fcdonders.nl/video and also here https://www.youtube.com/watch?v=QLvsa1r1Voc best tzvetan > Dear Tzvetan, Thanks for your help. First, to plot the spectral power for one channel with the 'ft_singleplotER', how can I calculate the power spectrum with 'ft_freqanalsis'? Can I use the following code to calculate and plot power spectrum? Thanks a lot! > > Best, > Jinyi > > > %% frequency analysis > cfg = []; > cfg.output = 'pow';%'fourier';% > % cfg.channel = 'MEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 2:1:40; % analysis 2 to 30 Hz in steps of 2 Hz > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec > cfg.toi = -0.5:0.05:4; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > TFRhann = ft_freqanalysis(cfg, data); > %% visualize > cfg = []; > cfg.baseline = [-0.9 -0.1]; > cfg.baselinetype = 'absolute'; > cfg.maskstyle = 'saturation'; > cfg.zlim = [-3e-7 3e-7]; % > cfg.channel = '26'; > figure > ft_singleplotER(cfg, TFRhann) > > > > > 2014-11-07 1:33 GMT-05:00 Tzvetan Popov : > Dear Jinyi, > You can use ft_singleplotER to plot the power spectrum of a single channel. If you are interested in the same but for multiple channels than use ft_multiplotER. Finally if you are interested in the topography of a particular frequency you'd specify it in cfg.xlim=[begin end] and call ft_topoplotER. > Good luck > Tzvetan > > > > > Am 07.11.2014 um 00:23 schrieb Jinyi Long : > > > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! > > > > Best, > > Jinyi > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From longjinyi at gmail.com Fri Nov 7 16:13:15 2014 From: longjinyi at gmail.com (Jinyi Long) Date: Fri, 7 Nov 2014 10:13:15 -0500 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Message-ID: Thanks Tzvetan. 2014-11-07 8:56 GMT-05:00 Tzvetan Popov : > Dear Jinyi, > what you’re referring to is time-frequency analysis. From your e-mail I > assumed that you’ve already performed frequency analysis, yet apparently > not. You can compute the power spectrum bei using something like this: > > cfg = []; > cfg.output = 'pow'; > cfg.method = 'mtmfft'; > cfg.taper = 'dpss'; > cfg.foilim = [1 20]; > cfg.tapsmofrq = 2; > fft_data= ft_freqanalysis(cfg,data); > > Subsequently you can plot fft_data with the functions I mentioned in my > previous e-mail. > Note that we have also a video lectures section where you can get some > detailed insight into frequency domain analysis. Please have a look here: > http://fieldtrip.fcdonders.nl/video > and also here > https://www.youtube.com/watch?v=QLvsa1r1Voc > > > best > tzvetan > > Dear Tzvetan, Thanks for your help. First, to plot the spectral power for > one channel with the 'ft_singleplotER', how can I calculate the power > spectrum with 'ft_freqanalsis'? Can I use the following code to calculate > and plot power spectrum? Thanks a lot! > > Best, > Jinyi > > > %% frequency analysis > cfg = []; > cfg.output = 'pow';%'fourier';% > % cfg.channel = 'MEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 2:1:40; % analysis 2 to 30 Hz > in steps of 2 Hz > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time > window = 0.5 sec > cfg.toi = -0.5:0.05:4; % time window "slides" > from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > TFRhann = ft_freqanalysis(cfg, data); > %% visualize > cfg = []; > cfg.baseline = [-0.9 -0.1]; > cfg.baselinetype = 'absolute'; > cfg.maskstyle = 'saturation'; > cfg.zlim = [-3e-7 3e-7]; % > cfg.channel = '26'; > figure > ft_singleplotER(cfg, TFRhann) > > > > > 2014-11-07 1:33 GMT-05:00 Tzvetan Popov : > >> Dear Jinyi, >> You can use ft_singleplotER to plot the power spectrum of a single >> channel. If you are interested in the same but for multiple channels than >> use ft_multiplotER. Finally if you are interested in the topography of a >> particular frequency you'd specify it in cfg.xlim=[begin end] and call >> ft_topoplotER. >> Good luck >> Tzvetan >> >> >> >> > Am 07.11.2014 um 00:23 schrieb Jinyi Long : >> > >> > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. >> When I perform the frequency analysis with the function of >> 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D >> time-frequency figure at single channel? Thanks! >> > >> > Best, >> > Jinyi >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.heldmann at neuro.uni-luebeck.de Fri Nov 7 17:51:02 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Fri, 7 Nov 2014 17:51:02 +0100 Subject: [FieldTrip] strange time frequency results after converting data with eeglab2fieldtrip Message-ID: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> I preprocessed my data (6 channels, 1Kz, minimum 97 trial/condition) with eeglab. Since I’d like to perform the time frequency analysis with field trip, I converted the data to field trip using the eegalb2fieldtrip function. However, after the conversion I’ve got very strange results, meaning that for most of the frequencies I get zeros or NaNs. I am wondering, if I have to change something in the file structure. Does anybody has an idea what’s wrong? Thanx for any help or hints, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 From rmontefusco at med.uchile.cl Fri Nov 7 21:13:54 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Fri, 7 Nov 2014 15:13:54 -0500 Subject: [FieldTrip] strange time frequency results after converting data with eeglab2fieldtrip In-Reply-To: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> References: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> Message-ID: It's hard to say at what level is the problem, for me works perfect. Can you check your data using ft_databrowser([],data) before the spectral decomposition? Can you copy how your data structure looks like? Best On Fri, Nov 7, 2014 at 11:51 AM, Marcus Heldmann < marcus.heldmann at neuro.uni-luebeck.de> wrote: > I preprocessed my data (6 channels, 1Kz, minimum 97 trial/condition) with > eeglab. Since I’d like to perform the time frequency analysis with field > trip, I converted the data to field trip using the eegalb2fieldtrip > function. However, after the conversion I’ve got very strange results, > meaning that for most of the frequencies I get zeros or NaNs. I am > wondering, if I have to change something in the file structure. Does > anybody has an idea what’s wrong? > > Thanx for any help or hints, Marcus > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.S.Beauchamp at uth.tmc.edu Sat Nov 8 01:20:22 2014 From: Michael.S.Beauchamp at uth.tmc.edu (Beauchamp, Michael S) Date: Sat, 8 Nov 2014 00:20:22 +0000 Subject: [FieldTrip] Postdoctoral position in Houston--Multisensory Integration and Visual Perception Message-ID: <2EDEDA4E3AFFFB44B07F320540CA2B6E2EDCE1@UTHMAIL1.uthouston.edu> The Beauchamp Lab at the University of Texas Medical School at Houston (http://openwetware.org/wiki/Beauchamp) seeks a postdoctoral fellow for a federally-funded research program. The main focus of the lab is to understand the neural substrates of multisensory integration and visual perception. The laboratory uses multiple techniques, including fMRI and electrocorticography: experience with one of these techniques (or related) is a requirement. Data analysis is carried out with specialized software, including AFNI, EEGlab and Fieldtrip, requiring that applicants be comfortable with writing and modifying C-shell scripts. An interest in computational and quantitative modeling of behavioral and neuroimaging data is an asset. Houston has a rich neuroimaging and neuroscience community, with Rice University, Baylor College of Medicine, and the University of Texas Health Science Center at Houston as partners in the Gulf Coast Consortia for quantitative biomedical sciences. Facilities include multiple research‑dedicated 3 T scanners, a Blackrock Microsystems 128‑channel recording system, infrared eye trackers, and MR-compatible transcranial magnetic stimulation (TMS). The position is available immediately and the review of applications will continue until the position is filled. Please send your CV to beauchamplab at gmail.com for an immediate reply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Sat Nov 8 02:14:57 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Fri, 7 Nov 2014 17:14:57 -0800 Subject: [FieldTrip] FFT Message-ID: Hello I'm new to programming and to fieldtrip, but I'd like to run a basic FFT using fieldtrip. I've done all other preprocessing in EEGlab. I've looked through the wiki and watched some videos about fieldtrips FFT functions (which were great) I just need help with implementation. Could someone give me some example code for running an FFT? These are my more specific questions: 1. I found that eeglab2filedtrip is a function I can use to convert my file from the eeglab format to fieldtrip format. Can someone give me an example as to what that code would look like? 2. I was a 40% hanning window for my FFT. How do I specify the 40%? 3. What will the output look like? What I ideally want is the power for each electrode site within a certain frequency (whichever I specify as being of interest). Thanks for the help! Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.wutzke at gmail.com Sun Nov 9 21:54:32 2014 From: alex.wutzke at gmail.com (Alexander Wutzke) Date: Sun, 9 Nov 2014 21:54:32 +0100 Subject: [FieldTrip] Coherence calculation in phalow_amphigh advanced Message-ID: Dear Ladies and Gentlemen, i have some problem by using the example code "phalow_amphigh" in advanced (link: http://fieldtrip.fcdonders.nl/example/crossfreq/phalow_amphigh ). I do my best in the last days to understand my issue, which i will described below: First, the code will generate a powerspectrum with the 'mtmconvol' method. For Signal2 at every 2Hz until 60Hz. After that it will do a 'mtmfft' calculation, so that we get on both axies the frequency range. What will happened to the powerspectrum of signal2 at 2Hz etc. in this case? Powerspectrum of powerspectrum? This is another confusing point. Finally, when i calculate the coherence between the created channels (singal1 between signal2 at 2Hz etc.) i get some strange output. I use the example signals in the code at your homepage. The plotting with imagesc generate a picture which seems to be wrong. But maybe it can also be, that i cant understand the result and therefore my interpretation is false. In general, the signal1 and signal2 are independend at different frequencys and the result should be a blue (low or no coherence) picture. But i get some blue jets and the rest of the picture is amlost red (high coherence). This is very confusing to me! Please tell me what i do wrong or is there a fieldtrip bug? Thanks a lot and you will make me very happy with your answer! I used the Fieldtrip version from 9.11.14. Yours sincerely Alexander The code part for this issue: cfg = []; cfg.method = 'mtmconvol'; cfg.channel = 's2 (high)'; cfg.output = 'pow'; cfg.taper = 'hanning'; cfg.foi = [2:2:60]; cfg.toi = data.time{1}(3001:7000); %power is calculated at every sample cfg.t_ftimwin = 4./cfg.foi; %timewindow used to calculated power is 4 cycles long and therefore differs over frequencies cfg.keeptrials = 'yes'; freq4 = ft_freqanalysis(cfg,data); % Make data same length as freq1 data_cut = data; for iTr = 1:length(data.trial) data_cut.trial{iTr} = data.trial{iTr}(:,3001:7000); data_cut.time{iTr} = data.time{iTr}(3001:7000); end data_app = ft_appenddata([],data_cut, freq4); %contains original channel and channels with power %FieldTrip automatically converts the freq4 data to raw data. % mtmfft output cross-spectral-density between s2 (high)(raw) and freq4 cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 1; cfg.foilim = [2 60]; cfg.keeptrials = 'no'; cfg.pad = 4; cfg.channelcmb = {'s1 (AM)' 's2 (high)@2Hz'; 's1 (AM)' 's2 (high)@4Hz'; 's1 (AM)' 's2 (high)@6Hz'; 's1 (AM)' 's2 (high)@8Hz'; 's1 (AM)' 's2 (high)@10Hz'; 's1 (AM)' 's2 (high)@12Hz'; 's1 (AM)' 's2 (high)@14Hz'; 's1 (AM)' 's2 (high)@16Hz'; 's1 (AM)' 's2 (high)@18Hz'; 's1 (AM)' 's2 (high)@20Hz'; 's1 (AM)' 's2 (high)@22Hz'; 's1 (AM)' 's2 (high)@24Hz'; 's1 (AM)' 's2 (high)@26Hz'; 's1 (AM)' 's2 (high)@28Hz'; 's1 (AM)' 's2 (high)@30Hz'; 's1 (AM)' 's2 (high)@32Hz'; 's1 (AM)' 's2 (high)@34Hz'; 's1 (AM)' 's2 (high)@36Hz'; 's1 (AM)' 's2 (high)@38Hz'; 's1 (AM)' 's2 (high)@40Hz'; 's1 (AM)' 's2 (high)@42Hz'; 's1 (AM)' 's2 (high)@44Hz'; 's1 (AM)' 's2 (high)@46Hz'; 's1 (AM)' 's2 (high)@48Hz'; 's1 (AM)' 's2 (high)@50Hz'; 's1 (AM)' 's2 (high)@52Hz'; 's1 (AM)' 's2 (high)@54Hz'; 's1 (AM)' 's2 (high)@56Hz'; 's1 (AM)' 's2 (high)@58Hz'; 's1 (AM)' 's2 (high)@60Hz';}; freq5 = ft_freqanalysis(cfg,data_app); %calculate coherence cfg = []; cfg.method = 'coh'; coh = ft_connectivityanalysis(cfg,freq5); coh.freq5 = [2:2:60]; figure; imagesc(coh.freq, coh.freq5, coh.cohspctrm); colorbar xlabel('Frequency(1/Hz)'); ylabel('Frequency(1/Hz)');title('Coherencespectra S1 - S2'); axis xy print -dpng phalow_amphigh_fig11.png -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Nov 10 01:06:01 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 10 Nov 2014 00:06:01 +0000 Subject: [FieldTrip] connectivity on DICS beamformer Message-ID: <2C4DB885-EFD0-4EA1-98CD-7E13247E7E95@flinders.edu.au> Hello fieldtrip, I was just wondering about the steps are doing a DICS beamformer on ft_freqanalysis output in terms of connectivity. (pointing me towards a tutorial is fine!). Ive already used the LCMV beamformer for a different purpose, where I made virtual channels and calculated connectivity between those virtual channels, but I am stumped what to do now with the ft_sourceanalysis output and the ft_freqanalysis output and how to do some connectivity analysis. Was the connectivity analysis ie granger causality, only designed to work with the ft_freqanalysis output? Thanking you in advance, please correct my inaccurate thinking! Tyler Sent from my iPad From balperin07 at gmail.com Mon Nov 10 04:30:51 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Sun, 9 Nov 2014 19:30:51 -0800 Subject: [FieldTrip] 40% hanning window Message-ID: Hello I converted my preprocessed data from eeglab to fieldtrip and successfully ran an FFT, but I would like to apply a 40% hanning window. I'm assuming by choosing hanning as my taper, it's applied to the entire trial. Here is what I have: %convert dataset from an EEGlab structure to a fieldtrip structure data = eeglab2fieldtrip(EEG,'preprocessing','none') cfg = []; cfg.method = 'mtmfft'; %run an fft cfg.taper = 'hanning'; %chose a hanning window cfg.foilim = [4 7] %frequencies of interest. In this case, theta cfg.output = 'pow' freq = ft_freqanalysis(cfg,data) Also, my data is made up of 2 second epochs. I'm assuming each cell in the output (freq.powspctrm) is the average of the power of a specific frequency (e.g. 4Hz) within each epoch. Is this accurate? Thanks for the help, Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From martine.vanschouwenburg at ucsf.edu Tue Nov 11 02:45:42 2014 From: martine.vanschouwenburg at ucsf.edu (Martine van Schouwenburg) Date: Mon, 10 Nov 2014 17:45:42 -0800 Subject: [FieldTrip] reading in ascii files Message-ID: <05b401cffd51$3400a6f0$9c01f4d0$@vanschouwenburg@ucsf.edu> Hi all, I have been using a new (wireless and dry!) EEG cap called Enobio (http://www.neuroelectrics.com/ ). It saves the data in a non-traditional format called .easy files, but they are basically just ascii files that can be read with dlmread into matlab. Is anyone aware of a way I can read these files into Fieldtrip? I tried changing the extension to .txt, because on the Fieldtrip website it mentions this as one of the supported data formats (for NIRS though..), but I get the following error. Error using ft_read_header (line 1833) unsupported header format (ascii_txt) I guess it makes sense cause there is no header in the file. J It is just a table with number of electrodes x number of data points. If anyone has succeeded in the past to read in ascii files into Fieldtrip, or has any idea on how to achieve this, I would very much appreciate your advice! Thanks! Best, Martine van Schouwenburg -------------- next part -------------- An HTML attachment was scrubbed... URL: From kumar at cbs.mpg.de Tue Nov 11 12:23:42 2014 From: kumar at cbs.mpg.de (Saurabh Kumar) Date: Tue, 11 Nov 2014 12:23:42 +0100 (CET) Subject: [FieldTrip] group_statistics_question In-Reply-To: <1346914686.4185.1415704812808.JavaMail.root@zimbra> Message-ID: <356719912.4230.1415705022318.JavaMail.root@zimbra> Hello fellow researchers, I have a general problem and am only seeking the solution in the correct direction. I am working with the EEG data and I have been able to locate the source in the brain using the MNE method that is implemented in the fieldtrip. My next step would be to do group statistics and for this I wanna know if there are some functions already implemented in fieldtrip. I have been doing source_statictics and as I understand it is used to find the significant difference between source conditions. Seeking a way, ---------------------------------------------------- Saurabh Kumar Cognitive Neurology Max Planck Institute for Human Cognitive and Brain Sciences Stephanstr. 1a 04103 Leipzig From m.stoica at uke.de Wed Nov 12 12:58:15 2014 From: m.stoica at uke.de (Stoica, Mircea) Date: Wed, 12 Nov 2014 11:58:15 +0000 Subject: [FieldTrip] How to plot hyper networks? Message-ID: Dear all, do you know any way to plot connections between two brains, i.e. two topoplots with lines connecting them? Thanks in advance. Best, Mircea Dept. of Neurophysiology and Pathophysiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg Germany -- DANKE FÜR 125 JAHRE ENGAGEMENT UND VERTRAUEN. www.uke.de/125 _____________________________________________________________________ Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- An HTML attachment was scrubbed... URL: From laura.marzetti at gmail.com Wed Nov 12 15:54:14 2014 From: laura.marzetti at gmail.com (Laura Marzetti) Date: Wed, 12 Nov 2014 15:54:14 +0100 Subject: [FieldTrip] intertrial coherence estimation Message-ID: Dear all, I want to compute the intertrial phase coherence and its variation across trials with a one taper hanning approach as in *cfg = [];* *cfg.output = 'fourier';* *cfg.channel = 'all';* *cfg.method = 'mtmconvol';* *cfg.taper = 'hanning';* *cfg.foi = 5:2:80;* *cfg.t_ftimwin = 5./cfg.foi; * *cfg.tapsmofrq = 0.4*cfg.foi; * *cfg.toi = time_vect;* *cfg.pad = 'maxperlen'; * *cfg.keeptrials = 'yes';* *% cfg.keeptapers = 'no';* *freqscprm = ft_freqanalysis(cfg, data);* *tmpdat = freqscprm.fourierspctrm;* *tmpdat = tmpdat./abs(tmpdat);* *itc = abs(mean(tmpdat)); * Nevertheless, the option *cfg.keeptrials = 'yes'; *does not seem to be applied and the output is already the average across trials, e.g. of size nfreq x ntimepoints and not of size ntrials x nfreq x ntimepoints as I would have expected due to the settings for *cfg.keeptrials.* Can anyone suggest me how to manage the configuration in order to have estimates in each trial as an output? Thanks, Laura -- Laura Marzetti, PhD Istituto di Tecnologie Avanzate Biomediche Università di Chieti "G. D'Annunzio" Via dei Vestini - Campus Universitario 66013 Chieti - ITALY phone: 0039-0871-3556944 fax: 0039-0871-3556930 -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.thomas at nin.knaw.nl Wed Nov 12 16:39:43 2014 From: r.thomas at nin.knaw.nl (Rajat Thomas) Date: Wed, 12 Nov 2014 15:39:43 +0000 Subject: [FieldTrip] EEG cap layout to SPM Message-ID: <4c7352a592774821a165217b5c0da029@EXNHI01.herseninstituut.knaw.nl> Dear FieldTrippers, ? I am trying to use both FieldTrip and SPM do to my SPM analysis. I have made my cap in the format of FT and would like to port it to SPM. Any ideas? I am using MATLAB scripts to do my analysis and I am not sure how to update the D.sensors and D.fiducials fields (where D is an SPM M/EEG structure) Thanks. Rajat Rajat Mani Thomas Social Brain Lab Netherlands Institute for Neuroscience Amsterdam -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Wed Nov 12 17:30:30 2014 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Wed, 12 Nov 2014 16:30:30 +0000 Subject: [FieldTrip] EEG cap layout to SPM In-Reply-To: <4c7352a592774821a165217b5c0da029@EXNHI01.herseninstituut.knaw.nl> References: <4c7352a592774821a165217b5c0da029@EXNHI01.herseninstituut.knaw.nl> Message-ID: Dear Rajat, One thing you can try is to save your elec struct in a mat file and then load it via Prepare in SPM (for both sensors and fiducials). Note that for things like standard 10-20 labels SPM assigns default channel locations so if your locations are not custom or individually measured it might be easier for you to go with that (also via Prepare). Best, Vladimir On Wed, Nov 12, 2014 at 3:39 PM, Rajat Thomas wrote: > Dear FieldTrippers, > > ​ > > I am trying to use both FieldTrip and SPM do to my SPM analysis. I have > made my cap in the > > format of FT and would like to port it to SPM. > > Any ideas? > > I am using MATLAB scripts to do my analysis and I am not sure how to > update the D.sensors > > and D.fiducials fields (where D is an SPM M/EEG structure) > > > Thanks. > > > Rajat > > > > > Rajat Mani Thomas > Social Brain Lab > Netherlands Institute for Neuroscience > Amsterdam > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnmark.taylor at yale.edu Wed Nov 12 17:45:31 2014 From: johnmark.taylor at yale.edu (JohnMark Taylor) Date: Wed, 12 Nov 2014 11:45:31 -0500 Subject: [FieldTrip] How to Crop .cnt files? (Forgot to stop recording) Message-ID: Hello, I have a quick question about how to manipulate .cnt files. While running one subject, we forgot to stop the EEG recording after the experiment was done (so there is about 20 minutes of empty data). This has made the .cnt file size unwieldy and too large for some of our analysis programs. We were wondering, then: is there some fieldtrip tool that can be used to crop .cnt files? We would like to get rid of all parts of the recording that happened after the experiment was finished. Thank you very much for your help, JohnMark -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerome.manson at utoronto.ca Thu Nov 13 10:07:21 2014 From: gerome.manson at utoronto.ca (Gerome Manson) Date: Thu, 13 Nov 2014 10:07:21 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip Message-ID: Hello All, I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) Thanks alot, Gerome Here is the brain vision sequence I am trying to replicate - Read in Data - Reference to mastiod - 100Hz Band rejection filter - bandwidth 8, slope 2 - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) - Notch Filter at 50Hz - Segmentation - Baseline Correction -200 ms to - 5 ms - Averaging segments Here is my Field trip code: %rereference all trials cfg.reref = 'yes'; cfg.continuous = 'yes'; % reference what channels cfg.channel = 'all'; %choose the reference channel cfg.refchannel = {'EXG1' 'EXG2'}; % cfg.dataset = 'CVP1S1.bdf'; cfg.continuous = 'yes'; % %bandfilter cfg.bsfilter = 'yes'; cfg.bsfiltord = 2; % cfg.bsfiltdir = 'onepass-zerophase'; cfg.bsfreq = [92 108]; % %DFT cfg.dftfilter = 'yes'; % IIR Filters cfg.lpfilter = 'yes'; cfg.lpfilttype = 'but'; % cfg.lpfiltdir = 'onepass-zerophase'; cfg.lpfreq = 45; cfg.hpfilter = 'yes'; cfg.hpfilttype = 'but'; % cfg.hpfiltdir = 'onepass-zerophase'; cfg.hpfreq = 0.53; data = ft_preprocessing(cfg); % Define Trial cfg = []; cfg.trialdef.eventtype = 'STATUS'; cfg.dataset = eeg_file; cfg.trialdef.eventvalue = 65522; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 0.3; cfg = ft_definetrial(cfg); data_vep = ft_redefinetrial(cfg, data); % Baseline Correction cfg = []; cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 -0.05]; data_vep = ft_preprocessing(cfg, data_vep); %Averaging cfg=[]; avg_data = ft_timelockanalysis(cfg, data_vep); cfg.ylim = [-10 10]; cfg.channel = 'O1'; ft_singleplotER(cfg,avg_data); -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Thu Nov 13 11:13:43 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 13 Nov 2014 11:13:43 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: <040E6541-0D1E-4675-92D8-88B1578C7FE8@uni-konstanz.de> Dear Gerome, one thing you could change is keep the reference the same in both cases. So far you are referencing the data against the mastoids in BVA and a common reference in FieldTrip. This is a potential source of variance in the waveforms you’ll get. best tzvetan > Hello All, > > I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) > > > Thanks alot, > Gerome > > Here is the brain vision sequence I am trying to replicate > - Read in Data > - Reference to mastiod > - 100Hz Band rejection filter - bandwidth 8, slope 2 > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) > - Notch Filter at 50Hz > - Segmentation > - Baseline Correction -200 ms to - 5 ms > - Averaging segments > > > > Here is my Field trip code: > > %rereference all trials > cfg.reref = 'yes'; > cfg.continuous = 'yes'; > > % reference what channels > cfg.channel = 'all'; > %choose the reference channel > cfg.refchannel = {'EXG1' 'EXG2'}; > > % cfg.dataset = 'CVP1S1.bdf'; > cfg.continuous = 'yes'; > % > > %bandfilter > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; > % cfg.bsfiltdir = 'onepass-zerophase'; > cfg.bsfreq = [92 108]; > > > % > %DFT > cfg.dftfilter = 'yes'; > > % IIR Filters > cfg.lpfilter = 'yes'; > cfg.lpfilttype = 'but'; > % cfg.lpfiltdir = 'onepass-zerophase'; > cfg.lpfreq = 45; > > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > % cfg.hpfiltdir = 'onepass-zerophase'; > cfg.hpfreq = 0.53; > > data = ft_preprocessing(cfg); > > > % Define Trial > cfg = []; > cfg.trialdef.eventtype = 'STATUS'; > cfg.dataset = eeg_file; > cfg.trialdef.eventvalue = 65522; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 0.3; > cfg = ft_definetrial(cfg); > > data_vep = ft_redefinetrial(cfg, data); > > % Baseline Correction > cfg = []; > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 -0.05]; > data_vep = ft_preprocessing(cfg, data_vep); > > %Averaging > cfg=[]; > avg_data = ft_timelockanalysis(cfg, data_vep); > > > cfg.ylim = [-10 10]; > cfg.channel = 'O1'; > > ft_singleplotER(cfg,avg_data); > > -- > _____________________ > Gerome Manson PhD Student > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > Perceptual Motor Behavior lab- University of Toronto > gerome.manson at utoronto.ca > gerome.manson at univ-amu.fr > 416-978-6109 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Thu Nov 13 13:16:25 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 13 Nov 2014 12:16:25 +0000 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: <040E6541-0D1E-4675-92D8-88B1578C7FE8@uni-konstanz.de> References: <040E6541-0D1E-4675-92D8-88B1578C7FE8@uni-konstanz.de> Message-ID: <3D00B7615FB58D46A0B49B9AD67A33EB0C2076@exprd01.hosting.ru.nl> Hi Gerome and Tzvetan, Actually, you are referencing to the linked mastoids if EXG1 and EXG2 represent the mastoid channels as you specified them in cfg.refchannel. cfg.channel only specifies on what channels to apply the re-referencing on. At a first glance I can see that in Fieldtrip you are applying a band-stop filter between 92 and 108 Hz, while in BVA you are applying a band-stop filter at 100Hz with a bandwidth of 8. I am not that familiar with BVA but does that mean plus AND minus 8Hz or 8Hz around 100Hz, so 96 - 104Hz? Also, in BVA you are applying a notch filter at 50Hz, in Fieldtrip you are applying a DFT filter at 50, 100 and 150Hz. A notch filter is a band-stop filter with a narrow band (usually 1-2Hz). DFT filters try to fit and subtract sinusoids at the specified frequency. To make it more similar to BVA I would suggest a band-stop filter between 49 and 51Hz. Furthermore, in Fieldtrip you are applying Butterworth filters, is this the same filter-type applied in BVA? Additionally, in BVA your baseline is from -200 to -5ms, while in Fieldtrip you specify: cfg.baselinewindow = [-0.2 -0.05]; which is from -200 to -50ms. I hope this can help you make the analysis more similar. Could you perhaps make a picture of a result that you find is different (e.g. ERPs calculated in Fieldtrip and BVA)?. That could help identifying the exact problem if this did not help you. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Tzvetan Popov Sent: donderdag 13 november 2014 11:14 To: FieldTrip discussion list Subject: Re: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip Dear Gerome, one thing you could change is keep the reference the same in both cases. So far you are referencing the data against the mastoids in BVA and a common reference in FieldTrip. This is a potential source of variance in the waveforms you'll get. best tzvetan Hello All, I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) Thanks alot, Gerome Here is the brain vision sequence I am trying to replicate - Read in Data - Reference to mastiod - 100Hz Band rejection filter - bandwidth 8, slope 2 - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) - Notch Filter at 50Hz - Segmentation - Baseline Correction -200 ms to - 5 ms - Averaging segments Here is my Field trip code: %rereference all trials cfg.reref = 'yes'; cfg.continuous = 'yes'; % reference what channels cfg.channel = 'all'; %choose the reference channel cfg.refchannel = {'EXG1' 'EXG2'}; % cfg.dataset = 'CVP1S1.bdf'; cfg.continuous = 'yes'; % %bandfilter cfg.bsfilter = 'yes'; cfg.bsfiltord = 2; % cfg.bsfiltdir = 'onepass-zerophase'; cfg.bsfreq = [92 108]; % %DFT cfg.dftfilter = 'yes'; % IIR Filters cfg.lpfilter = 'yes'; cfg.lpfilttype = 'but'; % cfg.lpfiltdir = 'onepass-zerophase'; cfg.lpfreq = 45; cfg.hpfilter = 'yes'; cfg.hpfilttype = 'but'; % cfg.hpfiltdir = 'onepass-zerophase'; cfg.hpfreq = 0.53; data = ft_preprocessing(cfg); % Define Trial cfg = []; cfg.trialdef.eventtype = 'STATUS'; cfg.dataset = eeg_file; cfg.trialdef.eventvalue = 65522; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 0.3; cfg = ft_definetrial(cfg); data_vep = ft_redefinetrial(cfg, data); % Baseline Correction cfg = []; cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 -0.05]; data_vep = ft_preprocessing(cfg, data_vep); %Averaging cfg=[]; avg_data = ft_timelockanalysis(cfg, data_vep); cfg.ylim = [-10 10]; cfg.channel = 'O1'; ft_singleplotER(cfg,avg_data); -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From widmann at uni-leipzig.de Thu Nov 13 16:44:28 2014 From: widmann at uni-leipzig.de (Andreas Widmann) Date: Thu, 13 Nov 2014 16:44:28 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: Hi, besides the already mentioned differences, you cannot easily replicate the Brainvision Analyzer Butterworth filters with Fieldtrip. The Analyzer internally adjusts filter order *and* cutoff frequency to compensate for two-pass filtering. The (onepass) filter order actually applied by Analyzer is half the requested order. You can correspondingly reduce filter order in Fieldtrip to replicate this behavior. The (onepass) filter cutoff frequency actually applied by Analyzer is undocumented. It is adjusted so that the requested cutoff has -3dB attenuation after *twopass* filtering. You can measure the -6dB cutoff (applicable in Fieldtrip) by feeding an impulse into Analyzer and checking the frequency response. This problem is discussed here in more detail: http://www.ncbi.nlm.nih.gov/pubmed/25128257 Hope this helps, Andreas > Am 13.11.2014 um 10:07 schrieb Gerome Manson : > > Hello All, > > I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) > > > Thanks alot, > Gerome > > Here is the brain vision sequence I am trying to replicate > - Read in Data > - Reference to mastiod > - 100Hz Band rejection filter - bandwidth 8, slope 2 > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) > - Notch Filter at 50Hz > - Segmentation > - Baseline Correction -200 ms to - 5 ms > - Averaging segments > > > > Here is my Field trip code: > > %rereference all trials > cfg.reref = 'yes'; > cfg.continuous = 'yes'; > > % reference what channels > cfg.channel = 'all'; > %choose the reference channel > cfg.refchannel = {'EXG1' 'EXG2'}; > > % cfg.dataset = 'CVP1S1.bdf'; > cfg.continuous = 'yes'; > % > > %bandfilter > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; > % cfg.bsfiltdir = 'onepass-zerophase'; > cfg.bsfreq = [92 108]; > > > % > %DFT > cfg.dftfilter = 'yes'; > > % IIR Filters > cfg.lpfilter = 'yes'; > cfg.lpfilttype = 'but'; > % cfg.lpfiltdir = 'onepass-zerophase'; > cfg.lpfreq = 45; > > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > % cfg.hpfiltdir = 'onepass-zerophase'; > cfg.hpfreq = 0.53; > > data = ft_preprocessing(cfg); > > > % Define Trial > cfg = []; > cfg.trialdef.eventtype = 'STATUS'; > cfg.dataset = eeg_file; > cfg.trialdef.eventvalue = 65522; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 0.3; > cfg = ft_definetrial(cfg); > > data_vep = ft_redefinetrial(cfg, data); > > % Baseline Correction > cfg = []; > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 -0.05]; > data_vep = ft_preprocessing(cfg, data_vep); > > %Averaging > cfg=[]; > avg_data = ft_timelockanalysis(cfg, data_vep); > > > cfg.ylim = [-10 10]; > cfg.channel = 'O1'; > > ft_singleplotER(cfg,avg_data); > > -- > _____________________ > Gerome Manson PhD Student > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > Perceptual Motor Behavior lab- University of Toronto > gerome.manson at utoronto.ca > gerome.manson at univ-amu.fr > 416-978-6109 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gerome.manson at utoronto.ca Thu Nov 13 19:09:41 2014 From: gerome.manson at utoronto.ca (Gerome Manson) Date: Thu, 13 Nov 2014 19:09:41 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: Thank you for your help everyone, the solution was fairly simple (although the datasets still don't quite match up) I adjusted the baseline window and also the filters as stated in the answers by Andreas, and Jim, and changed the reference -as stated by tzvetan these changes did the trick. I do have one more question though that I couldn't quite find enough information on: Is it possible to create and eletrode pool (for instance a new channel that is the average of some channels (eg: PO3, O1 and PO7) and have it added as a new channel (in a similar way that we can create new channels for eog). Thanks again, Gerome 2014-11-13 16:44 GMT+01:00 Andreas Widmann : > Hi, > > besides the already mentioned differences, you cannot easily replicate the > Brainvision Analyzer Butterworth filters with Fieldtrip. The Analyzer > internally adjusts filter order *and* cutoff frequency to compensate for > two-pass filtering. The (onepass) filter order actually applied by Analyzer > is half the requested order. You can correspondingly reduce filter order in > Fieldtrip to replicate this behavior. The (onepass) filter cutoff frequency > actually applied by Analyzer is undocumented. It is adjusted so that the > requested cutoff has -3dB attenuation after *twopass* filtering. You can > measure the -6dB cutoff (applicable in Fieldtrip) by feeding an impulse > into Analyzer and checking the frequency response. This problem is > discussed here in more detail: > http://www.ncbi.nlm.nih.gov/pubmed/25128257 > > Hope this helps, > Andreas > > > Am 13.11.2014 um 10:07 schrieb Gerome Manson >: > > > > Hello All, > > > > I would like some help to replicate an analysis done in brain vision > analyzer in field trip. Here is the details of the analysis in brain > vision. I have done most of the code but I get almost completely different > results which is puzziling. Maybe some of the filteres are not defined > properly- so if anyone has some time I would appreciate the help :-) > > > > > > Thanks alot, > > Gerome > > > > Here is the brain vision sequence I am trying to replicate > > - Read in Data > > - Reference to mastiod > > - 100Hz Band rejection filter - bandwidth 8, slope 2 > > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, > 24db/ oct) > > - Notch Filter at 50Hz > > - Segmentation > > - Baseline Correction -200 ms to - 5 ms > > - Averaging segments > > > > > > > > Here is my Field trip code: > > > > %rereference all trials > > cfg.reref = 'yes'; > > cfg.continuous = 'yes'; > > > > % reference what channels > > cfg.channel = 'all'; > > %choose the reference channel > > cfg.refchannel = {'EXG1' 'EXG2'}; > > > > % cfg.dataset = 'CVP1S1.bdf'; > > cfg.continuous = 'yes'; > > % > > > > %bandfilter > > cfg.bsfilter = 'yes'; > > cfg.bsfiltord = 2; > > % cfg.bsfiltdir = 'onepass-zerophase'; > > cfg.bsfreq = [92 108]; > > > > > > % > > %DFT > > cfg.dftfilter = 'yes'; > > > > % IIR Filters > > cfg.lpfilter = 'yes'; > > cfg.lpfilttype = 'but'; > > % cfg.lpfiltdir = 'onepass-zerophase'; > > cfg.lpfreq = 45; > > > > cfg.hpfilter = 'yes'; > > cfg.hpfilttype = 'but'; > > % cfg.hpfiltdir = 'onepass-zerophase'; > > cfg.hpfreq = 0.53; > > > > data = ft_preprocessing(cfg); > > > > > > % Define Trial > > cfg = []; > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.dataset = eeg_file; > > cfg.trialdef.eventvalue = 65522; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 0.3; > > cfg = ft_definetrial(cfg); > > > > data_vep = ft_redefinetrial(cfg, data); > > > > % Baseline Correction > > cfg = []; > > cfg.demean = 'yes'; > > cfg.baselinewindow = [-0.2 -0.05]; > > data_vep = ft_preprocessing(cfg, data_vep); > > > > %Averaging > > cfg=[]; > > avg_data = ft_timelockanalysis(cfg, data_vep); > > > > > > cfg.ylim = [-10 10]; > > cfg.channel = 'O1'; > > > > ft_singleplotER(cfg,avg_data); > > > > -- > > _____________________ > > Gerome Manson PhD Student > > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > > Perceptual Motor Behavior lab- University of Toronto > > gerome.manson at utoronto.ca > > gerome.manson at univ-amu.fr > > 416-978-6109 > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Thu Nov 13 20:19:40 2014 From: nathanweisz at mac.com (Nathan Weisz) Date: Thu, 13 Nov 2014 20:19:40 +0100 Subject: [FieldTrip] Postdoc opportunity @Centre for Cognitive Neuroscience Salzburg Message-ID: <4E925DA8-F688-494F-B0AC-2BF31F8535C8@mac.com> I am sending this job add on behalf of Manuel Schabus. Please see attached doc-file for details and contact him directly in case of questions. -------------- next part -------------- A non-text attachment was scrubbed... Name: Stellenausschreibung_PostDoc_E REV2.doc Type: application/msword Size: 52224 bytes Desc: not available URL: From j.herring at fcdonders.ru.nl Thu Nov 13 21:50:20 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 13 Nov 2014 20:50:20 +0000 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: <121EA1A7-B55C-4E7B-AE2D-CFC3E03FA66F@donders.ru.nl> Hi Gerome, Have a look at ft_apply_montage (http://fieldtrip.fcdonders.nl/reference/ft_apply_montage), I think it will do what you want. Best, Jim On 13 Nov 2014, at 19:09, Gerome Manson > wrote: Thank you for your help everyone, the solution was fairly simple (although the datasets still don't quite match up) I adjusted the baseline window and also the filters as stated in the answers by Andreas, and Jim, and changed the reference -as stated by tzvetan these changes did the trick. I do have one more question though that I couldn't quite find enough information on: Is it possible to create and eletrode pool (for instance a new channel that is the average of some channels (eg: PO3, O1 and PO7) and have it added as a new channel (in a similar way that we can create new channels for eog). Thanks again, Gerome 2014-11-13 16:44 GMT+01:00 Andreas Widmann >: Hi, besides the already mentioned differences, you cannot easily replicate the Brainvision Analyzer Butterworth filters with Fieldtrip. The Analyzer internally adjusts filter order *and* cutoff frequency to compensate for two-pass filtering. The (onepass) filter order actually applied by Analyzer is half the requested order. You can correspondingly reduce filter order in Fieldtrip to replicate this behavior. The (onepass) filter cutoff frequency actually applied by Analyzer is undocumented. It is adjusted so that the requested cutoff has -3dB attenuation after *twopass* filtering. You can measure the -6dB cutoff (applicable in Fieldtrip) by feeding an impulse into Analyzer and checking the frequency response. This problem is discussed here in more detail: http://www.ncbi.nlm.nih.gov/pubmed/25128257 Hope this helps, Andreas > Am 13.11.2014 um 10:07 schrieb Gerome Manson >: > > Hello All, > > I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) > > > Thanks alot, > Gerome > > Here is the brain vision sequence I am trying to replicate > - Read in Data > - Reference to mastiod > - 100Hz Band rejection filter - bandwidth 8, slope 2 > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) > - Notch Filter at 50Hz > - Segmentation > - Baseline Correction -200 ms to - 5 ms > - Averaging segments > > > > Here is my Field trip code: > > %rereference all trials > cfg.reref = 'yes'; > cfg.continuous = 'yes'; > > % reference what channels > cfg.channel = 'all'; > %choose the reference channel > cfg.refchannel = {'EXG1' 'EXG2'}; > > % cfg.dataset = 'CVP1S1.bdf'; > cfg.continuous = 'yes'; > % > > %bandfilter > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; > % cfg.bsfiltdir = 'onepass-zerophase'; > cfg.bsfreq = [92 108]; > > > % > %DFT > cfg.dftfilter = 'yes'; > > % IIR Filters > cfg.lpfilter = 'yes'; > cfg.lpfilttype = 'but'; > % cfg.lpfiltdir = 'onepass-zerophase'; > cfg.lpfreq = 45; > > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > % cfg.hpfiltdir = 'onepass-zerophase'; > cfg.hpfreq = 0.53; > > data = ft_preprocessing(cfg); > > > % Define Trial > cfg = []; > cfg.trialdef.eventtype = 'STATUS'; > cfg.dataset = eeg_file; > cfg.trialdef.eventvalue = 65522; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 0.3; > cfg = ft_definetrial(cfg); > > data_vep = ft_redefinetrial(cfg, data); > > % Baseline Correction > cfg = []; > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 -0.05]; > data_vep = ft_preprocessing(cfg, data_vep); > > %Averaging > cfg=[]; > avg_data = ft_timelockanalysis(cfg, data_vep); > > > cfg.ylim = [-10 10]; > cfg.channel = 'O1'; > > ft_singleplotER(cfg,avg_data); > > -- > _____________________ > Gerome Manson PhD Student > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > Perceptual Motor Behavior lab- University of Toronto > gerome.manson at utoronto.ca > gerome.manson at univ-amu.fr > 416-978-6109 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Fri Nov 14 00:57:46 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Thu, 13 Nov 2014 15:57:46 -0800 Subject: [FieldTrip] average power Message-ID: Hello I'm using mtmfft and want the average theta power. I was under the impression that (cfg.foilim = [4 7];) would give me the average of the power between 4 and 8 Hz, however my output is in .5 Hz steps. Am I missing something? Also, if I can get the average output rather than stepwise, is there a way that I can get several bands in one pass. For example [4 7] for theta and [12 30] for beta? Thanks, Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Nov 14 01:16:17 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 14 Nov 2014 01:16:17 +0100 Subject: [FieldTrip] average power In-Reply-To: References: Message-ID: hey Brittany, I am far from being a fieldtrip profi, but as far as I can get you can either use ft_freqgrandaverage and average over frequencies (cfg.parameter='freg'), or you precise cfg.avgoverfreq = 'yes' in the ft_freqstatistics. Of course you could also change the steps of ft_freqanalysis to bigger steps... (for example cfg.foi = 7:1:31 for analysis from 7 to 31 in steps of 1 hertz cheers k 2014-11-14 0:57 GMT+01:00 Brittany Alperin : > Hello > > I'm using mtmfft and want the average theta power. I was under the > impression that (cfg.foilim = [4 7];) would give me the average of the > power between 4 and 8 Hz, however my output is in .5 Hz steps. Am I missing > something? > > Also, if I can get the average output rather than stepwise, is there a way > that I can get several bands in one pass. For example [4 7] for theta and > [12 30] for beta? > > Thanks, > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Nov 14 05:45:53 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 14 Nov 2014 04:45:53 +0000 Subject: [FieldTrip] beamformer and granger casuality Message-ID: <99973235-3756-4005-A68D-2902FC8271A7@flinders.edu.au> Hello fieldtrip, I was just wondering whether it was possible to perform a beamformer analysis on some EEG data and then perform a connectivity analysis on the source using the granger casuality method. Currently I am following the connectivity/extended tutorials and just doing granger casuality connectivity analysis on EEG data (ft_mvaranalysis-ft_freqanalysis-ft_connectivityanalysis) and its working fine, just curious to see if it works on beamformed data. >From what Ive tested so far, ft_connectivityanalysis seems to want a 'mom' field, which doesnt appear to be present when you conduct a DICS beamformer (I am aware 'mom' refers to moment, which is in the time domain). Regards, Tyler From tzvetan.popov at uni-konstanz.de Fri Nov 14 08:03:12 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 14 Nov 2014 08:03:12 +0100 Subject: [FieldTrip] average power In-Reply-To: References: Message-ID: Hi Brittany, in addition to Katrin’s suggestions you can also rug ft_freqanalysis with cfg.foi = [4:1:30];, and then call ft_selectdata twice. Once with cfg.frequency = [4 7]; cfg.avgoverfreq = ‘yes’; and accordingly for your other freq band of interest. best tzvetan > hey Brittany, I am far from being a fieldtrip profi, but as far as I can get you can either use > ft_freqgrandaverage and average over frequencies (cfg.parameter='freg'), or you precise cfg.avgoverfreq = 'yes' in the ft_freqstatistics. Of course you could also change the steps of ft_freqanalysis to bigger steps... (for example cfg.foi = 7:1:31 for analysis from 7 to 31 in steps of 1 hertz > > > > cheers k > > > 2014-11-14 0:57 GMT+01:00 Brittany Alperin : > Hello > > I'm using mtmfft and want the average theta power. I was under the impression that (cfg.foilim = [4 7];) would give me the average of the power between 4 and 8 Hz, however my output is in .5 Hz steps. Am I missing something? > > Also, if I can get the average output rather than stepwise, is there a way that I can get several bands in one pass. For example [4 7] for theta and [12 30] for beta? > > Thanks, > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 14 08:38:54 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 14 Nov 2014 08:38:54 +0100 Subject: [FieldTrip] beamformer and granger casuality In-Reply-To: <99973235-3756-4005-A68D-2902FC8271A7@flinders.edu.au> References: <99973235-3756-4005-A68D-2902FC8271A7@flinders.edu.au> Message-ID: Dear Tyler, ‘mom’ refers indeed to a moment, yet not a moment in time (-domain) but a dipole moment. The modeling of brain activity at location X as dipolar activity at that location is used in many inverse solutions including spatial filtering. You can specify cfg.keepmom = ‘yes’; and subsequently call ft_sourcedescriptives with cfg.projectmom = ‘yes’; in order to obtain the dominant orientation. good luck tzvetan > Hello fieldtrip, > > I was just wondering whether it was possible to perform a beamformer analysis on some EEG data and then perform a connectivity analysis on the source using the granger casuality method. Currently I am following the connectivity/extended tutorials and just doing granger casuality connectivity analysis on EEG data (ft_mvaranalysis-ft_freqanalysis-ft_connectivityanalysis) and its working fine, just curious to see if it works on beamformed data. > > From what Ive tested so far, ft_connectivityanalysis seems to want a 'mom' field, which doesnt appear to be present when you conduct a DICS beamformer (I am aware 'mom' refers to moment, which is in the time domain). > > Regards, > > Tyler > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From marcus.heldmann at neuro.uni-luebeck.de Fri Nov 14 12:50:20 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Fri, 14 Nov 2014 12:50:20 +0100 Subject: [FieldTrip] strange time frequency results after converting data with eeglab2fieldtrip In-Reply-To: References: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> Message-ID: <69BA0730-3891-4603-8992-8FCC164DB6E4@neuro.uni-luebeck.de> Sorry for this late reply. Yes, I can display the data and they do look like expected. The cell-structure contains label (6 entries), sample (1kHz, this is correct), elec (structure containing the electrode positions ), cell structure trial (388 trials, each containing sample x channel data), time and cfg, just containing version information like name and id. Hope this helps. Strange enough, I performed a time frequency already in EEGLAB, but I’d like to use the statistical testing. I have no idea what#s going wrong. Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 Am 07.11.2014 um 21:13 schrieb Rodrigo Montefusco : > It's hard to say at what level is the problem, for me works perfect. Can you check your data using ft_databrowser([],data) before the spectral decomposition? > Can you copy how your data structure looks like? > > Best > > On Fri, Nov 7, 2014 at 11:51 AM, Marcus Heldmann wrote: > I preprocessed my data (6 channels, 1Kz, minimum 97 trial/condition) with eeglab. Since I’d like to perform the time frequency analysis with field trip, I converted the data to field trip using the eegalb2fieldtrip function. However, after the conversion I’ve got very strange results, meaning that for most of the frequencies I get zeros or NaNs. I am wondering, if I have to change something in the file structure. Does anybody has an idea what’s wrong? > > Thanx for any help or hints, Marcus > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > From polomacnenad at gmail.com Fri Nov 14 13:18:17 2014 From: polomacnenad at gmail.com (Nenad Polomac) Date: Fri, 14 Nov 2014 13:18:17 +0100 Subject: [FieldTrip] ICA subspace reduction with PCA eigenvalues Message-ID: Dear all, I have one question regarding ICA calculation subspace. I have high pass filtered MEG data (> 30 Hz) on which I calculated ICA. I know there are different methods to limit data dimensionality by ICA calculation, usually performed by PCA prior to ICA. E.g. taking 99% of variance explained or selecting first N components... However I did it by taking specific eigenvalue (2.5^27) and assuming that all components which have eigenvalue smaller than this represented noise. Argument for this would be that eigenvalue of one component represent scale of the variance explained by this component (for example, muscle artifacts component would have high eigenvalues while noise component oscillate in narrower range, hence variance and eigenvalue would be smaller). I have found this value to result in a stable number of components of around 45 per participant which is large enough to contain most of the signal and small enough to obtain stable and meaningful ICA components. Does anybody know any studies that used this constant eigenvalue approach to limit ICA subspace? Thank you very much in advance? all the best! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From DrakesmithM at cardiff.ac.uk Fri Nov 14 14:29:29 2014 From: DrakesmithM at cardiff.ac.uk (Mark Drakesmith) Date: Fri, 14 Nov 2014 13:29:29 +0000 Subject: [FieldTrip] using megplanar on cross-spectra In-Reply-To: <5465E4BE.5020802@cardiff.ac.uk> References: <5465E4BE.5020802@cardiff.ac.uk> Message-ID: <546603B9.3070508@cardiff.ac.uk> Dear FieldTripers I want to ask a quick question about applying megplanar to cross-spectra and coherence data. I want to compute sensor-sensor connectivity after the planar transform. I can do this quite easily after doing the initial planar transformation (run ft_megplanar and ft_freqanalysis). However, when I combine the channels after ft_freqanalysis using ft_combineplanar, the crssprtm field is no longer there, only the powsptrm. I havn't tried it with the coherence spectrum yet but I'm guessing the same thing will happen there. I dont want to work on the full uncombined planar data as this is quite expensive in terms of computer resources and harder to visualise. Does anyone have advise on how best to get planar-combined cross-spectra and coherences? Many thanks Mark Mark Drakesmith CUBRIC / NMHRI, Cardiff University From arno at cerco.ups-tlse.fr Fri Nov 14 16:41:03 2014 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Fri, 14 Nov 2014 07:41:03 -0800 Subject: [FieldTrip] ICA subspace reduction with PCA eigenvalues In-Reply-To: References: Message-ID: <87A56D60-8339-4357-9B75-DBAACF9539D4@cerco.ups-tlse.fr> Hi Nehad, This is Arno from UCSD (developer of EEGLAB, the software which popularized ICA). All commercial software preprocess the data using PCA to reduce the dimensionality. This can not only bias ICA but also introduce artifacts in the data. ICA should only be done full rank if possible. You might want to contact Stepehn Shall Jones (shall-jones at infoscience.otago.ac.nz) which student Carl Leichter has written a thesis on that subject "Eigenspecters: Information Misallocation in Lossy Principal Component Reductions of Magnetoencephalographic and Electoencephalographic Data". He shows which artifacts are introduced by doing PCA before ICA. Cheers, Arno On Nov 14, 2014, at 4:18 AM, Nenad Polomac wrote: > Dear all, > > I have one question regarding ICA calculation subspace. I have high pass filtered MEG data (> 30 Hz) on which I calculated ICA. > I know there are different methods to limit data dimensionality by ICA calculation, usually performed by PCA prior to ICA. E.g. taking 99% of variance explained or selecting first N components... > However I did it by taking specific eigenvalue (2.5^27) and assuming that all components which have eigenvalue smaller than this represented noise. Argument for this would be that eigenvalue of one component represent scale of the variance explained by this component (for example, muscle artifacts component would have high eigenvalues while noise component oscillate in narrower range, hence variance and eigenvalue would be smaller). I have found this value to result in a stable number of components of around 45 per participant which is large enough to contain most of the signal and small enough to obtain stable and meaningful ICA components. > Does anybody know any studies that used this constant eigenvalue approach to limit ICA subspace? > Thank you very much in advance? > > all the best! > > Nenad > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Sun Nov 16 01:29:37 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Sun, 16 Nov 2014 01:29:37 +0100 Subject: [FieldTrip] ROI midpoint Message-ID: Dear experts, please how can I identify the midpoint of each of the region of AAL atlas. thank you Azeez A. Adebimpe "Knowledge and good manner, the beauty of a man" -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Sun Nov 16 06:32:58 2014 From: roeysc at gmail.com (Roey) Date: Sun, 16 Nov 2014 07:32:58 +0200 Subject: [FieldTrip] ROI midpoint In-Reply-To: References: Message-ID: <752FD823-1B22-4F77-9902-EC28BF688B8E@gmail.com> Dear Azeez, It depends on whether you want an actual point (whose activity you want to use, for example) or just an (x,y,z) coordinate. In the latter case you could go over all the point of a given ROI in the atlas, and compute the mean of their x value, the mean if their y value and the mean of their x value (notice that you know which coordinate system you're using, e.g. SPM). If you want an actual point that resides on the atlas grid, you can then find the point closest to the point you computed above (for example, you could use the marlab function "norm" on the difference between the two points, which would be represented as vectors). I'm not sitting in front of fieldtrip at the moment, so hopefully this made sense to you. Best, Roey ‫ב-16 בנוב׳ 2014, בשעה 02:29, ‏‏Azeez Adebimpe ‏ כתב/ה:‬ > Dear experts, > > please how can I identify the midpoint of each of the region of AAL atlas. > > thank you > > Azeez A. Adebimpe > > > "Knowledge and good manner, the beauty of a man" > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Mon Nov 17 11:12:39 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Mon, 17 Nov 2014 10:12:39 +0000 Subject: [FieldTrip] Postdoctoral research positions, University of Nottingham Message-ID: On behalf of Matt: ---------- Forwarded message ---------- From: Matthew Brookes Date: 2014-11-11 16:54 GMT+00:00 Subject: [megcommunity] Postdoctoral research positions, University of Nottingham To: MEGCOMMUNITY at jiscmail.ac.uk The Sir Peter Mansfield Magnetic Resonance Centre, University of Nottingham is seeking to recruit two Research Associate/Fellows in the field of magnetoencephalography (MEG). Successful candidates will work on developing and applying novel ways to measure and understand the intrinsic modes of functional coupling between functionally specific brain regions. Specifically, areas of development will include: i) New ways to model neural oscillations in local circuits; ii) Novel methods to characterize long range linear and non-linear coupling and iii) Measurement of dynamic changes in functional connectivity during basic sensory and cognitive tasks. In addition, since electrophysiological activity and connectivity is mediated by neurochemistry, successful candidates will also be involved in performing parallel ultra-high field (7T) magnetic resonance spectroscopy (1H and 13C) experiments in order to relate the concentration of cortical neurotransmitters (glutamate/GABA) to electrophysiological metrics in MEG. Finally these metrics will be applied in schizophrenia in order to gain new insight into how impaired network activity and connectivity underlies core symptoms. The University of Nottingham has been at the forefront of imaging since the introduction of MRI in the 1970’s. Indeed a rich history of novel developments resulted in the award of a Nobel Prize to Sir Peter Mansfield in 2003. The Sir Peter Mansfield Magnetic Resonance Centre (SPMMRC), now headed by Prof. Peter Morris, remains at the forefront of neuroimaging development with significant contributions in the fields of MRI, MEG, multi-modal imaging, and simultaneous EEG/fMRI. The Centre is equipped with a 275 channel MEG, 7T, 3T and 1.5T MR systems as well as MR compatible 64 channel EEG. In addition, a £9m investment by the Medical Research Council (announced in October 2014) will see upgrades to 7T and MEG as well as the introduction of wide bore 3T and upright MRI systems, to begin in 2015. Candidates should have a PhD (or equivalent) or be nearing completion in neuroimaging and strong interest/experience in developing methods plus an undergraduate degree in Physics, Engineering, Mathematics or appropriately related discipline. There are two fixed term posts available, one for two years and one for three years duration from 1 January 2015. Informal enquiries may be addressed to Dr Matt Brookes, tel: 0115 9515188 or email matthew.brookes at nottingham.ac.uk. Please note that applications sent directly to this email address will not be accepted. This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.chait at ucl.ac.uk Mon Nov 17 15:18:30 2014 From: m.chait at ucl.ac.uk (Chait, Maria) Date: Mon, 17 Nov 2014 14:18:30 +0000 Subject: [FieldTrip] 4 year Post-Doc position in UCL Message-ID: <19cc8ff590b3487b85373b27556c4417@DB4PR01MB0414.eurprd01.prod.exchangelabs.com> A 4 year post-doctoral research associate position is available to work on a European Council-funded project that will use psychophysics, eye tracking and EEG to investigate auditory attention. We aim to understand the brain mechanisms involved in selective attention, and create a brain-machine interface able to identify listeners attentional focus in real time. This research program is part of an international project ("Cognitively controlled Hearing Aid") which includes partners in ENS, France (Shihab Shamma, Alain de Cheveigne, Daniel Pressnitzer), DTU, Denmark (Torsten Dau), UZH, Switzerland (Shih-Chii Liu) and Oticon (Thomas Lunner) . You will be supervised by Dr Maria Chait and based at the UCL Ear Institute (http://www.ucl.ac.uk/ear/research/chaitlab). Salary (inclusive of London allowance) £33,353 - £37,152 per annum Applicants should hold a PhD degree (or equivalent) in an engineering or Neuroscience-related subject and have substantial experience in digital signal processing and computer programming. Previous experience with auditory research and/or functional brain imaging is desirable. For an informal discussion please contact Dr. Maria Chait (m.chait at ucl.ac.uk). Application should be made via the UCL website: http://www.ucl.ac.uk/hr/jobs/ (Ref:1443980). Application deadline: 07 Dec 2014. Start date: Early 2015. The UCL Ear Institute provides state-of-the-art research facilities across a wide range of disciplines and is one of the foremost centres for hearing, speech and language-related research within Europe. Maria Chait PhD m.chait at ucl.ac.uk Reader in Auditory Cognitive Neuroscience Lab site: http://www.ucl.ac.uk/ear/research/chaitlab/ UCL Ear Institute 332 Gray's Inn Road London WC1X 8EE -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Nov 18 11:53:08 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Nov 2014 11:53:08 +0100 Subject: [FieldTrip] reading in ascii files In-Reply-To: References: Message-ID: Hi Martine, You mentioned that you are already able to get it into Matlab, so my guess is that the best way to read it into FieldTrip is to get it into a generic Matlab array first, and then hack a bit to make it FT-compatible. If the data is not segmented yet, you can convert it into one big 'trial', and subsequently use ft_redefinetrial to get it segmented. A typical raw data structure would be: data = []; data.label = {'chan1'...'chanN'}; data.time = {0:1/fsample:tEnd}; data.trial = {dat}; % where dat is channel X timepoint For more details, see the help and code of ft_datatype_raw. Hope that helps! Best, Eelke On 11 November 2014 02:45, Martine van Schouwenburg wrote: > Hi all, > > > > I have been using a new (wireless and dry!) EEG cap called Enobio > (http://www.neuroelectrics.com/ ). It saves the data in a non-traditional > format called .easy files, but they are basically just ascii files that can > be read with dlmread into matlab. Is anyone aware of a way I can read these > files into Fieldtrip? I tried changing the extension to .txt, because on the > Fieldtrip website it mentions this as one of the supported data formats (for > NIRS though..), but I get the following error. > > > > Error using ft_read_header (line 1833) > > unsupported header format (ascii_txt) > > > > I guess it makes sense cause there is no header in the file. J It is just a > table with number of electrodes x number of data points. If anyone has > succeeded in the past to read in ascii files into Fieldtrip, or has any idea > on how to achieve this, I would very much appreciate your advice! > > > > Thanks! > > > > Best, > > Martine van Schouwenburg > > From eelke.spaak at donders.ru.nl Tue Nov 18 11:57:12 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Nov 2014 11:57:12 +0100 Subject: [FieldTrip] intertrial coherence estimation In-Reply-To: <19b158f3bc354e6f8f14294a05077d78@EXPRD03.hosting.ru.nl> References: <19b158f3bc354e6f8f14294a05077d78@EXPRD03.hosting.ru.nl> Message-ID: Dear Laura, Indeed, it should work the way you specified. If you did not find any other possible mistake in your script, could you file a bug on bugzilla and attach a small snippet of data and your cfg that reproduce the issue? Then we can look into it. Best, Eelke On 12 November 2014 15:54, Laura Marzetti wrote: > > Dear all, > > I want to compute the intertrial phase coherence and its variation across > trials with a one taper hanning approach as in > > > > cfg = []; > > > > cfg.output = 'fourier'; > > cfg.channel = 'all'; > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 5:2:80; > > cfg.t_ftimwin = 5./cfg.foi; > > cfg.tapsmofrq = 0.4*cfg.foi; > > cfg.toi = time_vect; > > cfg.pad = 'maxperlen'; > > cfg.keeptrials = 'yes'; > > % cfg.keeptapers = 'no'; > > freqscprm = ft_freqanalysis(cfg, data); > > tmpdat = freqscprm.fourierspctrm; > > > > tmpdat = tmpdat./abs(tmpdat); > > itc = abs(mean(tmpdat)); > > > > > > Nevertheless, the option cfg.keeptrials = 'yes'; does not seem to be applied > and the output is already the average across trials, e.g. of size nfreq x > ntimepoints and not of size ntrials x nfreq x ntimepoints as I would have > expected due to the settings for cfg.keeptrials. > > > > Can anyone suggest me how to manage the configuration in order to have > estimates in each trial as an output? > > > > Thanks, > > Laura > > > -- > Laura Marzetti, PhD > Istituto di Tecnologie Avanzate Biomediche > Università di Chieti "G. D'Annunzio" > Via dei Vestini - Campus Universitario > 66013 Chieti - ITALY > > phone: 0039-0871-3556944 > fax: 0039-0871-3556930 From jan.schoffelen at fcdonders.ru.nl Tue Nov 18 13:46:40 2014 From: jan.schoffelen at fcdonders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 18 Nov 2014 12:46:40 +0000 Subject: [FieldTrip] intertrial coherence estimation In-Reply-To: References: <19b158f3bc354e6f8f14294a05077d78@EXPRD03.hosting.ru.nl> Message-ID: Please don’t file a bug on bugzilla because it’s a misconception that intertrial coherence can be estimated at the level of the single trials and not a bug. By definition it is defined across trials (as multiple previous threads on this list have discussed). If you want to get a variance estimate, you should use a jackknife approach or something similar. The only reason why I can think of you ending up without more than 1 trial in the output of ft_freqanalysis is that you only had 1 trial in the input. If you want to get multiple ’trials’ from a single long trial, please use ft_redefinetrial and subsequently cfg.method = ‘mtmfft’ in ft_freqanalysis. Jan-Mathijs On Nov 18, 2014, at 11:57 AM, Eelke Spaak wrote: > Dear Laura, > > Indeed, it should work the way you specified. If you did not find any > other possible mistake in your script, could you file a bug on > bugzilla and attach a small snippet of data and your cfg that > reproduce the issue? Then we can look into it. > > Best, > Eelke > > On 12 November 2014 15:54, Laura Marzetti wrote: >> >> Dear all, >> >> I want to compute the intertrial phase coherence and its variation across >> trials with a one taper hanning approach as in >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'fourier'; >> >> cfg.channel = 'all'; >> >> cfg.method = 'mtmconvol'; >> >> cfg.taper = 'hanning'; >> >> cfg.foi = 5:2:80; >> >> cfg.t_ftimwin = 5./cfg.foi; >> >> cfg.tapsmofrq = 0.4*cfg.foi; >> >> cfg.toi = time_vect; >> >> cfg.pad = 'maxperlen'; >> >> cfg.keeptrials = 'yes'; >> >> % cfg.keeptapers = 'no'; >> >> freqscprm = ft_freqanalysis(cfg, data); >> >> tmpdat = freqscprm.fourierspctrm; >> >> >> >> tmpdat = tmpdat./abs(tmpdat); >> >> itc = abs(mean(tmpdat)); >> >> >> >> >> >> Nevertheless, the option cfg.keeptrials = 'yes'; does not seem to be applied >> and the output is already the average across trials, e.g. of size nfreq x >> ntimepoints and not of size ntrials x nfreq x ntimepoints as I would have >> expected due to the settings for cfg.keeptrials. >> >> >> >> Can anyone suggest me how to manage the configuration in order to have >> estimates in each trial as an output? >> >> >> >> Thanks, >> >> Laura >> >> >> -- >> Laura Marzetti, PhD >> Istituto di Tecnologie Avanzate Biomediche >> Università di Chieti "G. D'Annunzio" >> Via dei Vestini - Campus Universitario >> 66013 Chieti - ITALY >> >> phone: 0039-0871-3556944 >> fax: 0039-0871-3556930 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Tue Nov 18 13:59:43 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Nov 2014 13:59:43 +0100 Subject: [FieldTrip] FieldTrip data format In-Reply-To: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl> References: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl> Message-ID: Dear Xiong Xiao, First, in general, I would recommend you send questions like this to the general FieldTrip mailing list (cc), instead of to any of the developers personally. Responses on the general list will usually be faster, and will benefit other FieldTrip users as well. See here: http://fieldtrip.fcdonders.nl/discussion_list for instructions how to register. Then, I have never worked with the spike data formats, so I cannot tell you how to import them into FieldTrip. You could have a look at the various ft_datatype_xxx functions, which outline the structure of the data format. Best, Eelke On 10 November 2014 15:06, Xiong Xiao wrote: > Hi Eelke, > Sorry to trouble you, but I really want to use FieldTrip for my data > analysis. I am a graduate student from the Institute of Neuroscience, > Shanghai. I am a new FieldTrp user with good programming skills. But I > totally do not know how to convert my raw data (spikes, LFP and events) into > appropriate format for using FieldTrip. So I converted my data (spikes, LFP > and events) into .nex format. However, error occured when I read the events > from .nex files; but it was OK to read spikes. > > BTW, the data was converted to .nex files by using the toolbox provided by > NeuroExplorer. > > spike = ft_read_spike('xx1_SpikeEvents.nex'); > cfg = []; > cfg.spikechannel = {'N1xx1', 'N1xx3'}; % select only the two single units > spike = ft_spike_select(cfg, spike); > > event = ft_read_event('xx1_SpikeEvents.nex'); % there is error here > > > Error message: > Attempted to access adindx(1); index out of bounds because numel(adindx)=0. > > Error in read_nex_event (line 38) > smpfrq = hdr.varheader(adindx(1)).wfrequency; > > Error in ft_read_event (line 1528) > event = read_nex_event(filename); > > > Still I think this is not so convenient to convert my data into .nex files > and then to process it. Is there some other ways to convert the data into > appropriate formats? > > The structure of my data is like this: > > (1) Spikes: cell structure, { n*1 vector (timestamps) } > > (2) Waveform: cell structure, { n*4*32 matrix (waveforms for tetrodes)} > > (2) Events: m*2 matrix (the first column is the onset time of events, and > the second column is the duration of each event) > > (3) LFP: lfp (1*n vector, voltage of the LFP signal), lfp_time (1*n vector, > time of the LFP signal) > > > > Thank you for your time. > > Best regards, > Xiong Xiao > > ________________________________ > ************************************************* > PhD student > Lab of Neural Circuits and Animal Behavior > Institute of Neuroscience, Chinese Academy of Sciences > Room A0738, The New Life Science Building > 320, Yue Yang Road > Shanghai 200031, China > Email: xxiong at ion.ac.cn > Phone: 86-21-54921769 > Web: http://www.ion.ac.cn/laboratories/int.asp?id=46 > ************************************************* From sarita.tamang at mssm.edu Tue Nov 18 15:27:30 2014 From: sarita.tamang at mssm.edu (Tamang, Sarita) Date: Tue, 18 Nov 2014 14:27:30 +0000 Subject: [FieldTrip] FieldTrip data format In-Reply-To: References: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl>, Message-ID: <284E8105C3E44A4EA4C52972E5D13E8836C4BC@EXCHMBXCSM2.ExchMail.mssm.edu> Hi All, I had the same problem as I couldn't convert my LFP data into the field-trip format. I kept getting problems with defining trials. Any input on this would be very helpful. Thank you, Sarita ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Tuesday, November 18, 2014 7:59 AM To: Xiong Xiao Cc: Email discussion list for the FieldTrip project Subject: Re: [FieldTrip] FieldTrip data format Dear Xiong Xiao, First, in general, I would recommend you send questions like this to the general FieldTrip mailing list (cc), instead of to any of the developers personally. Responses on the general list will usually be faster, and will benefit other FieldTrip users as well. See here: https://urldefense.proofpoint.com/v2/url?u=http-3A__fieldtrip.fcdonders.nl_discussion-5Flist&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=xff7mp7yN1139dfVCzoRkmhWTwB1tTM97tyVCAxNb8U&e= for instructions how to register. Then, I have never worked with the spike data formats, so I cannot tell you how to import them into FieldTrip. You could have a look at the various ft_datatype_xxx functions, which outline the structure of the data format. Best, Eelke On 10 November 2014 15:06, Xiong Xiao wrote: > Hi Eelke, > Sorry to trouble you, but I really want to use FieldTrip for my data > analysis. I am a graduate student from the Institute of Neuroscience, > Shanghai. I am a new FieldTrp user with good programming skills. But I > totally do not know how to convert my raw data (spikes, LFP and events) into > appropriate format for using FieldTrip. So I converted my data (spikes, LFP > and events) into .nex format. However, error occured when I read the events > from .nex files; but it was OK to read spikes. > > BTW, the data was converted to .nex files by using the toolbox provided by > NeuroExplorer. > > spike = ft_read_spike('xx1_SpikeEvents.nex'); > cfg = []; > cfg.spikechannel = {'N1xx1', 'N1xx3'}; % select only the two single units > spike = ft_spike_select(cfg, spike); > > event = ft_read_event('xx1_SpikeEvents.nex'); % there is error here > > > Error message: > Attempted to access adindx(1); index out of bounds because numel(adindx)=0. > > Error in read_nex_event (line 38) > smpfrq = hdr.varheader(adindx(1)).wfrequency; > > Error in ft_read_event (line 1528) > event = read_nex_event(filename); > > > Still I think this is not so convenient to convert my data into .nex files > and then to process it. Is there some other ways to convert the data into > appropriate formats? > > The structure of my data is like this: > > (1) Spikes: cell structure, { n*1 vector (timestamps) } > > (2) Waveform: cell structure, { n*4*32 matrix (waveforms for tetrodes)} > > (2) Events: m*2 matrix (the first column is the onset time of events, and > the second column is the duration of each event) > > (3) LFP: lfp (1*n vector, voltage of the LFP signal), lfp_time (1*n vector, > time of the LFP signal) > > > > Thank you for your time. > > Best regards, > Xiong Xiao > > ________________________________ > ************************************************* > PhD student > Lab of Neural Circuits and Animal Behavior > Institute of Neuroscience, Chinese Academy of Sciences > Room A0738, The New Life Science Building > 320, Yue Yang Road > Shanghai 200031, China > Email: xxiong at ion.ac.cn > Phone: 86-21-54921769 > Web: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ion.ac.cn_laboratories_int.asp-3Fid-3D46&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=SPtddSTcRAxVHLC13eNxpQiAypQksJ9BrQpLZq6h3zU&e= > ************************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=Rq0Z-baW1Wo6TdBuJ8U4pVOYUQI9LUEiIkEcL7k1Ud4&e= From sarita.tamang at mssm.edu Tue Nov 18 15:27:30 2014 From: sarita.tamang at mssm.edu (Tamang, Sarita) Date: Tue, 18 Nov 2014 14:27:30 +0000 Subject: [FieldTrip] FieldTrip data format In-Reply-To: References: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl>, Message-ID: <284E8105C3E44A4EA4C52972E5D13E8836C4BC@EXCHMBXCSM2.ExchMail.mssm.edu> Hi All, I had the same problem as I couldn't convert my LFP data into the field-trip format. I kept getting problems with defining trials. Any input on this would be very helpful. Thank you, Sarita ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Tuesday, November 18, 2014 7:59 AM To: Xiong Xiao Cc: Email discussion list for the FieldTrip project Subject: Re: [FieldTrip] FieldTrip data format Dear Xiong Xiao, First, in general, I would recommend you send questions like this to the general FieldTrip mailing list (cc), instead of to any of the developers personally. Responses on the general list will usually be faster, and will benefit other FieldTrip users as well. See here: https://urldefense.proofpoint.com/v2/url?u=http-3A__fieldtrip.fcdonders.nl_discussion-5Flist&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=xff7mp7yN1139dfVCzoRkmhWTwB1tTM97tyVCAxNb8U&e= for instructions how to register. Then, I have never worked with the spike data formats, so I cannot tell you how to import them into FieldTrip. You could have a look at the various ft_datatype_xxx functions, which outline the structure of the data format. Best, Eelke On 10 November 2014 15:06, Xiong Xiao wrote: > Hi Eelke, > Sorry to trouble you, but I really want to use FieldTrip for my data > analysis. I am a graduate student from the Institute of Neuroscience, > Shanghai. I am a new FieldTrp user with good programming skills. But I > totally do not know how to convert my raw data (spikes, LFP and events) into > appropriate format for using FieldTrip. So I converted my data (spikes, LFP > and events) into .nex format. However, error occured when I read the events > from .nex files; but it was OK to read spikes. > > BTW, the data was converted to .nex files by using the toolbox provided by > NeuroExplorer. > > spike = ft_read_spike('xx1_SpikeEvents.nex'); > cfg = []; > cfg.spikechannel = {'N1xx1', 'N1xx3'}; % select only the two single units > spike = ft_spike_select(cfg, spike); > > event = ft_read_event('xx1_SpikeEvents.nex'); % there is error here > > > Error message: > Attempted to access adindx(1); index out of bounds because numel(adindx)=0. > > Error in read_nex_event (line 38) > smpfrq = hdr.varheader(adindx(1)).wfrequency; > > Error in ft_read_event (line 1528) > event = read_nex_event(filename); > > > Still I think this is not so convenient to convert my data into .nex files > and then to process it. Is there some other ways to convert the data into > appropriate formats? > > The structure of my data is like this: > > (1) Spikes: cell structure, { n*1 vector (timestamps) } > > (2) Waveform: cell structure, { n*4*32 matrix (waveforms for tetrodes)} > > (2) Events: m*2 matrix (the first column is the onset time of events, and > the second column is the duration of each event) > > (3) LFP: lfp (1*n vector, voltage of the LFP signal), lfp_time (1*n vector, > time of the LFP signal) > > > > Thank you for your time. > > Best regards, > Xiong Xiao > > ________________________________ > ************************************************* > PhD student > Lab of Neural Circuits and Animal Behavior > Institute of Neuroscience, Chinese Academy of Sciences > Room A0738, The New Life Science Building > 320, Yue Yang Road > Shanghai 200031, China > Email: xxiong at ion.ac.cn > Phone: 86-21-54921769 > Web: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ion.ac.cn_laboratories_int.asp-3Fid-3D46&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=SPtddSTcRAxVHLC13eNxpQiAypQksJ9BrQpLZq6h3zU&e= > ************************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=Rq0Z-baW1Wo6TdBuJ8U4pVOYUQI9LUEiIkEcL7k1Ud4&e= From marcus.heldmann at neuro.uni-luebeck.de Wed Nov 19 09:58:08 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Wed, 19 Nov 2014 09:58:08 +0100 Subject: [FieldTrip] tfa produces zeros Message-ID: Dear all, I have a dataset with surface and local field potential recordings and I’d like to perform a tfa. The data are recorded with a BrainVision Recorder, 1KHz sampling frequency, bp 0.05-200Hz. After epoching (-1 to 2 s), filtering (bsfilter 49:51, lpfilter 70) and baseline correction I tried to perform a tfa using a wavelet analysis described in the tutorial (http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis, Time-frequency analysis IV). However, the powspctrm-field just contains NaNs (which is ok) and zeros (not ok). The data seem to be correct, I am able to plot single trials. The strange thing is, that my EEGLAB analysis provides some meaningful results. You can fined the preprocessed data for one condition under the following link https://drive.google.com/file/d/0B4-NxS-suG8dOXZnVHcxUDFyYXM/view?usp=sharing Any idea, why this happen’s? Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 From sarathykousik at gmail.com Wed Nov 19 10:12:29 2014 From: sarathykousik at gmail.com (kousik sarathy) Date: Wed, 19 Nov 2014 10:12:29 +0100 Subject: [FieldTrip] tfa produces zeros In-Reply-To: References: Message-ID: Dear Marcus, I tried running the "data_clean" through the same snippet of code (IV). It works fine for me. Could post the exact code you used? -- Regards, Kousik Sarathy, S On Wed, Nov 19, 2014 at 9:58 AM, Marcus Heldmann < marcus.heldmann at neuro.uni-luebeck.de> wrote: > Dear all, > I have a dataset with surface and local field potential recordings and I’d > like to perform a tfa. The data are recorded with a BrainVision Recorder, > 1KHz sampling frequency, bp 0.05-200Hz. After epoching (-1 to 2 s), > filtering (bsfilter 49:51, lpfilter 70) and baseline correction I tried to > perform a tfa using a wavelet analysis described in the tutorial ( > http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis, > Time-frequency analysis IV). However, the powspctrm-field just contains > NaNs (which is ok) and zeros (not ok). The data seem to be correct, I am > able to plot single trials. The strange thing is, that my EEGLAB analysis > provides some meaningful results. You can fined the preprocessed data for > one condition under the following link > > > https://drive.google.com/file/d/0B4-NxS-suG8dOXZnVHcxUDFyYXM/view?usp=sharing > > Any idea, why this happen’s? > > Greetings, Marcus > > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.heldmann at neuro.uni-luebeck.de Wed Nov 19 10:40:08 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Wed, 19 Nov 2014 10:40:08 +0100 Subject: [FieldTrip] tfa produces zeros In-Reply-To: References: Message-ID: <62B835A2-EFFD-47D0-90EA-FF26A6F63F8D@neuro.uni-luebeck.de> I used this code cfg = []; cfg.channel = '1_Fz'; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 1:2:30; cfg.toi = -0.5:0.05:1.5; TFRwave = ft_freqanalysis(cfg, data_clean); Thanks, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 Am 19.11.2014 um 10:12 schrieb kousik sarathy : > Dear Marcus, > > I tried running the "data_clean" through the same snippet of code (IV). It works fine for me. > > Could post the exact code you used? > > -- > Regards, > Kousik Sarathy, S > > > On Wed, Nov 19, 2014 at 9:58 AM, Marcus Heldmann wrote: > Dear all, > I have a dataset with surface and local field potential recordings and I’d like to perform a tfa. The data are recorded with a BrainVision Recorder, 1KHz sampling frequency, bp 0.05-200Hz. After epoching (-1 to 2 s), filtering (bsfilter 49:51, lpfilter 70) and baseline correction I tried to perform a tfa using a wavelet analysis described in the tutorial (http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis, Time-frequency analysis IV). However, the powspctrm-field just contains NaNs (which is ok) and zeros (not ok). The data seem to be correct, I am able to plot single trials. The strange thing is, that my EEGLAB analysis provides some meaningful results. You can fined the preprocessed data for one condition under the following link > > https://drive.google.com/file/d/0B4-NxS-suG8dOXZnVHcxUDFyYXM/view?usp=sharing > > Any idea, why this happen’s? > > Greetings, Marcus > > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > From marcus.heldmann at neuro.uni-luebeck.de Wed Nov 19 13:06:18 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Wed, 19 Nov 2014 13:06:18 +0100 Subject: [FieldTrip] tfa produces zeros Message-ID: Dear all, thanks to kousik saraty my problem is solved. I used the field trip lite version instead of the full version. With the full version, the expected results appear. Thanks for the kind and patient support, Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 From ma447 at leicester.ac.uk Wed Nov 19 13:48:11 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 12:48:11 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam -------------- next part -------------- An HTML attachment was scrubbed... URL: From ma447 at leicester.ac.uk Wed Nov 19 14:00:30 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 13:00:30 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk>, <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BB9BB6@exp-dag1-n2.uol.le.ac.uk> ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Wednesday, November 19, 2014 12:48 PM To: fieldtrip at science.ru.nl Subject: FW: problem with my data Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Wed Nov 19 15:52:33 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Wed, 19 Nov 2014 14:52:33 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> Message-ID: Dear Maryam, It should be: cfg=ft_databrowser(cfg,avgdata2) not cfg=ft_databrowser(avgdata2,cfg) Best, Johanna 2014-11-19 12:48 GMT+00:00 Ahmadi Shapourabadi, Maryam (Dr.) < ma447 at leicester.ac.uk>: > Dear Sir/Madam, > > I am new to feildtrip and I wanted to start analyzing my data using the > field trip. I have 64 channels of EEG recordings and I tried to convert my > data to fieldtrip cell type to be able to browse the data > using ft_databrowser, but there is a problem and I am not sure if it > because of my data format or some other problems. I have reported the error > and the structure of my data in the following. > Please do me a favor and check my data and help me with this issue. > > Regards, > Maryam > ------------------------------ > *From:* Ahmadi Shapourabadi, Maryam (Dr.) > *Sent:* Tuesday, November 18, 2014 6:20 PM > *To:* fieldtrip at science.ru.nl > *Subject:* problem with my data > > Dear Sir/Madam, > > I have tried to browse my data in fieldtrip but have got the following > error: > > cfg=ft_databrowser(avgdata2,cfg) > ??? Warning: Struct field assignment overwrites a value with class > "single". > See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As > Structures Displays Warning for details. > > In utilities\private\ft_preamble_provenance at 54 > In ft_preamble at 54 > In ft_databrowser at 138 > ??? Error using ==> ft_checkdata at 462 > This function requires raw+comp or raw data as input. > > Error in ==> ft_databrowser at 261 > data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, > 'feedback', 'yes', 'hassampleinfo', 'yes'); > > This is my data: > ftdata2 = > > trial: {1x251 cell} > time: {1x251 cell} > fsample: 512 > label: {1x64 cell} > > trial is single. I changed to double by the command 'double', but I got > similar error: > > cfg=ft_databrowser(avgdata2,cfg) > ??? Warning: Struct field assignment overwrites a value with class > "single". > See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As > Structures Displays Warning for details. > > In utilities\private\ft_preamble_provenance at 54 > In ft_preamble at 54 > In ft_databrowser at 138 > ??? Error using ==> ft_checkdata at 462 > This function requires raw+comp or raw data as input. > > Error in ==> ft_databrowser at 261 > data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, > 'feedback', 'yes', 'hassampleinfo', 'yes'); > > > detail of my data: > > ftdata2.trial > > ans = > > Columns 1 through 3 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 4 through 6 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 7 through 9 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 10 through 12 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 13 through 15 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 16 through 18 > ... > > ftdata2.trial > > ans = > > Columns 1 through 3 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 4 through 6 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 7 through 9 > .... > > ftdata2.fsample > > ans = > > 512 > > > Could you please help me with this problem? > > Regards, > Maryam > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From emmanuelle.kristensen at gipsa-lab.grenoble-inp.fr Wed Nov 19 16:04:23 2014 From: emmanuelle.kristensen at gipsa-lab.grenoble-inp.fr (Emmanuelle Kristensen) Date: Wed, 19 Nov 2014 16:04:23 +0100 Subject: [FieldTrip] offset between eeglab and fieldtrip Message-ID: <2395D5EC-A4C2-43E9-B78C-1206E73C8B8E@gipsa-lab.grenoble-inp.fr> Hi, I am a new user of fieldtrip. I made ICA with Eeglab, then I saved the signal in BrainAmp format (.dat,.vrmk .vhdr). I opened it in fieldtrip with ft_preprocessing. And when I compare the signal opened in Eeglab with the signal opened in fieldtrip, I have an offset for amplitude, for each channel, between the two signals. Does anyone know why? Regards, Emmanuelle -------------- next part -------------- An HTML attachment was scrubbed... URL: From ma447 at leicester.ac.uk Wed Nov 19 16:23:42 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 15:23:42 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk>, Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BB9C1A@exp-dag1-n2.uol.le.ac.uk> Dear Johanna, Thanks for your reply. I tried it but got the same error: cfg=ft_databrowser(cfg,avgdata2) ??? Error using ==> ft_checkdata at 442 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 257 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Bests, Maryam ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Johanna Zumer [johanna.zumer at gmail.com] Sent: Wednesday, November 19, 2014 2:52 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] FW: problem with my data Dear Maryam, It should be: cfg=ft_databrowser(cfg,avgdata2) not cfg=ft_databrowser(avgdata2,cfg) Best, Johanna 2014-11-19 12:48 GMT+00:00 Ahmadi Shapourabadi, Maryam (Dr.) >: Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From poil.simonshlomo at gmail.com Wed Nov 19 16:51:47 2014 From: poil.simonshlomo at gmail.com (Simon-Shlomo Poil) Date: Wed, 19 Nov 2014 15:51:47 +0000 Subject: [FieldTrip] offset between eeglab and fieldtrip References: <2395D5EC-A4C2-43E9-B78C-1206E73C8B8E@gipsa-lab.grenoble-inp.fr> Message-ID: Dear Emmanuelle, Did you maybe apply a filter somewhere in the process. Otherwise it sounds as a bug. Simon On Wed, Nov 19, 2014, 16:05 Emmanuelle Kristensen < emmanuelle.kristensen at gipsa-lab.grenoble-inp.fr> wrote: > Hi, > I am a new user of fieldtrip. I made ICA with Eeglab, then I saved the > signal in BrainAmp format (.dat,.vrmk .vhdr). > I opened it in fieldtrip with ft_preprocessing. And when I compare the > signal opened in Eeglab with the signal opened in fieldtrip, I have an > offset for amplitude, for each channel, between the two signals. > Does anyone know why? > > Regards, > Emmanuelle > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ma447 at leicester.ac.uk Wed Nov 19 17:00:26 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 16:00:26 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9C1A@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk>, , <05F556AD0303584F8A24EE56D63FEE2714BB9C1A@exp-dag1-n2.uol.le.ac.uk> Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BBAC42@exp-dag1-n2.uol.le.ac.uk> Johanna, I had a problem in my data that I fixed and tried what you mentioned one more time and it worked. Thanks, Maryam ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Ahmadi Shapourabadi, Maryam (Dr.) [ma447 at leicester.ac.uk] Sent: Wednesday, November 19, 2014 3:23 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] FW: problem with my data Dear Johanna, Thanks for your reply. I tried it but got the same error: cfg=ft_databrowser(cfg,avgdata2) ??? Error using ==> ft_checkdata at 442 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 257 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Bests, Maryam ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Johanna Zumer [johanna.zumer at gmail.com] Sent: Wednesday, November 19, 2014 2:52 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] FW: problem with my data Dear Maryam, It should be: cfg=ft_databrowser(cfg,avgdata2) not cfg=ft_databrowser(avgdata2,cfg) Best, Johanna 2014-11-19 12:48 GMT+00:00 Ahmadi Shapourabadi, Maryam (Dr.) >: Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.dinov13 at imperial.ac.uk Wed Nov 19 17:24:43 2014 From: m.dinov13 at imperial.ac.uk (Martin Dinov) Date: Wed, 19 Nov 2014 16:24:43 +0000 Subject: [FieldTrip] About huge delay for ft_read_data to return Message-ID: <546CC44B.1040800@imperial.ac.uk> Dear all, I'm trying to do something with realtime EEG data and I'm using the ft_read_data function get data from BrainVision Recorder via rda2ft. In MATLAB, calling ft_read_data seems to always take >=500ms (even for a single sample point from data with srate of 1000Hz) which is unacceptably slow for what I want to do. Perhaps specifying channel indices to read only some of the data would speed it up, but I haven't managed to get this to work. As I am trying to phase lock to the alpha band, I need to be able to read in single sample points (after an initial larger block that can take longer) much quicker than 500ms (<50ms). I highly appreciate any help with this! Thanks in advance -- Martin Dinov, MSc PhD postgraduate Imperial College London Computational, Cognitive and Clinical Neuroimaging Laboratory 3rd Floor, Burlington Danes Building, Hammersmith Hospital Du Cane Road London W12 0NN From a.maye at uke.de Thu Nov 20 10:13:59 2014 From: a.maye at uke.de (Alexander Maye) Date: Thu, 20 Nov 2014 10:13:59 +0100 Subject: [FieldTrip] About huge delay for ft_read_data to return In-Reply-To: <546CC44B.1040800@imperial.ac.uk> References: <546CC44B.1040800@imperial.ac.uk> Message-ID: <1828503.8MUoyVSXsK@mars.neurophys.uke.uni-hamburg.de> Hi Martin, if I remember correctly, it helps to read the header once (ft_read_header) and then pass it to the ft_read_data calls. For continuous reading you need to update the sample information inside the header struct with the data from ft_poll_buffer. Best, ALEX. Am Mittwoch, 19. November 2014, 16:24:43 schrieb Martin Dinov: > Dear all, > > I'm trying to do something with realtime EEG data and I'm using the > ft_read_data function get data from BrainVision Recorder via rda2ft. In > MATLAB, calling ft_read_data seems to always take >=500ms (even for a > single sample point from data with srate of 1000Hz) which is > unacceptably slow for what I want to do. Perhaps specifying channel > indices to read only some of the data would speed it up, but I haven't > managed to get this to work. As I am trying to phase lock to the alpha > band, I need to be able to read in single sample points (after an > initial larger block that can take longer) much quicker than 500ms > (<50ms). I highly appreciate any help with this! > > Thanks in advance -------------- next part -------------- -- DANKE FÜR 125 JAHRE ENGAGEMENT UND VERTRAUEN. www.uke.de/125 _____________________________________________________________________ Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING From j.herring at fcdonders.ru.nl Thu Nov 20 16:38:23 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 20 Nov 2014 15:38:23 +0000 Subject: [FieldTrip] tfa produces zeros In-Reply-To: References: Message-ID: <3D00B7615FB58D46A0B49B9AD67A33EB0D5D7C@exprd01.hosting.ru.nl> Dear Marcus (and all), The problem occurred due to a recently introduced (and now fixed) bug causing problems with single-channel data. The issue should be fixed in the most recent versions of FieldTrip (also Lite). Best, Jim -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Marcus Heldmann Sent: woensdag 19 november 2014 13:06 To: FieldTrip discussion list Subject: [FieldTrip] tfa produces zeros Dear all, thanks to kousik saraty my problem is solved. I used the field trip lite version instead of the full version. With the full version, the expected results appear. Thanks for the kind and patient support, Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Fri Nov 21 10:09:27 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Fri, 21 Nov 2014 09:09:27 +0000 Subject: [FieldTrip] Averaging on a random sample Message-ID: Dear Fieldtrippers, I have a sample of 350 trials for one condition, but for statistical analysis reasons I would like to split randomly this sample in two and average these two parts. so, I used the "randsample" matlab function which seems to work very well and then I averaged this selected sample: randomhalf = randsample(cleandata.trial, 175); avgFCMiddleRing = ft_timelockanalysis(cfg, randomhalf); However, I have the following error message : Error using ft_checkdata (line 366) This function requires raw or comp data as input. Error in ft_timelockanalysis (line 105) data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Does anyone have a solution to fix the problem? Thank you very much! Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Nov 21 10:29:10 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 21 Nov 2014 10:29:10 +0100 Subject: [FieldTrip] Averaging on a random sample In-Reply-To: <8d9e856a862b4df1a4d98b40c1e18b48@EXPRD01.hosting.ru.nl> References: <8d9e856a862b4df1a4d98b40c1e18b48@EXPRD01.hosting.ru.nl> Message-ID: Dear Emilie, You are not providing a FT data structure to ft_timelockanalysis (which you should), instead you are providing the raw cell array of trials (which you shouldn't). Hence, FT complains that the data is not in a structure that it can work with. There is a cfg-option cfg.trials, which you might like to use instead. Best, Eelke On 21 November 2014 10:09, Caspar, Emilie wrote: > Dear Fieldtrippers, > > I have a sample of 350 trials for one condition, but for statistical > analysis reasons I would like to split randomly this sample in two and > average these two parts. > > so, I used the "randsample" matlab function which seems to work very well > and then I averaged this selected sample: > > randomhalf = randsample(cleandata.trial, 175); > avgFCMiddleRing = ft_timelockanalysis(cfg, randomhalf); > > > However, I have the following error message : > > Error using ft_checkdata (line 366) > This function requires raw or comp data as input. > > Error in ft_timelockanalysis (line 105) > data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', > 'hassampleinfo', 'yes'); > > Does anyone have a solution to fix the problem? > > Thank you very much! > > Emilie > > From tyler.grummett at flinders.edu.au Mon Nov 24 12:56:49 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 24 Nov 2014 11:56:49 +0000 Subject: [FieldTrip] Thank you for your suggestions In-Reply-To: References: Message-ID: <7EE9068F-7277-44D9-B782-2E307BCB06D8@flinders.edu.au> What specifically did you want to know about the process? Plus I think the go is to include the mailing list so that others can help/benefit from our discussion. Tyler Sent from my iPhone > On 24 Nov 2014, at 6:07 pm, Jing Wang wrote: > > Dear Tyler, > > I am one of Fieldtrip users, just like you are. > > I have been trying to do source analysis of EEG with MRI template recently. I met a problem as you met, which posted in the fieldtrip mailist in July. In the mailist, I did not know whether your problem has been solve or not. Do you mind telling me how do you sovled or giving me your code of source analysis if you have solved it? > Your help are really apprecited. > > Best wishes > > Jing Wang From m.dinov13 at imperial.ac.uk Mon Nov 24 13:03:57 2014 From: m.dinov13 at imperial.ac.uk (Martin Dinov) Date: Mon, 24 Nov 2014 12:03:57 +0000 Subject: [FieldTrip] About huge delay for ft_read_data to return In-Reply-To: <1828503.8MUoyVSXsK@mars.neurophys.uke.uni-hamburg.de> References: <546CC44B.1040800@imperial.ac.uk> <1828503.8MUoyVSXsK@mars.neurophys.uke.uni-hamburg.de> Message-ID: <54731EAD.4040106@imperial.ac.uk> Hi Alex, Apology for late reply. This fixed the issue. Thanks a lot! Kind regards, Martin On 11/20/14, 9:13 AM, Alexander Maye wrote: > Hi Martin, > > if I remember correctly, it helps to read the header once (ft_read_header) and > then pass it to the ft_read_data calls. For continuous reading you need to > update the sample information inside the header struct with the data from > ft_poll_buffer. > > Best, > > ALEX. > > Am Mittwoch, 19. November 2014, 16:24:43 schrieb Martin Dinov: >> Dear all, >> >> I'm trying to do something with realtime EEG data and I'm using the >> ft_read_data function get data from BrainVision Recorder via rda2ft. In >> MATLAB, calling ft_read_data seems to always take >=500ms (even for a >> single sample point from data with srate of 1000Hz) which is >> unacceptably slow for what I want to do. Perhaps specifying channel >> indices to read only some of the data would speed it up, but I haven't >> managed to get this to work. As I am trying to phase lock to the alpha >> band, I need to be able to read in single sample points (after an >> initial larger block that can take longer) much quicker than 500ms >> (<50ms). I highly appreciate any help with this! >> >> Thanks in advance >> >> >> -- >> >> DANKE FÜR 125 JAHRE ENGAGEMENT UND VERTRAUEN. >> www.uke.de/125 >> _____________________________________________________________________ >> >> Besuchen Sie uns auf: www.uke.de >> _____________________________________________________________________ >> >> Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg >> Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik >> _____________________________________________________________________ >> >> SAVE PAPER - THINK BEFORE PRINTING >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.debener at uni-oldenburg.de Tue Nov 25 13:05:28 2014 From: stefan.debener at uni-oldenburg.de (Stefan Debener) Date: Tue, 25 Nov 2014 13:05:28 +0100 Subject: [FieldTrip] Postdoctoral Research Associate in brain-computer interfaces Message-ID: <54747088.4030308@uni-oldenburg.de> The Neuropsychology Lab at the University of Oldenburg (Germany) is seeking to fill the position of a *Postdoctoral Research Associate / Research Associate **(wissenschaftliche Mitarbeiterin / wissenschaftlicher Mitarbeiter, E13 TV-L, 100%).* We are seeking a postdoctoral research associate with a strong background in brain-computer interfaces (BCI). The project involves the development of a fully mobile auditory BCI. A key focus will be in the development and evaluation of unobtrusive EEG acquisition technology that is motion-tolerant and can be used in daily-life situations for the monitoring of auditory attention and cognitive states. The Neuropsychology Lab conducts research into the underpinnings of higher visual, auditory and motor functions. We apply non-invasive neurophysiological recording techniques, with the majority of studies using the electroencephalogram (EEG) as method of choice. Our lab features several state-of-the-art stationary high-density EEG systems, eye-tracking, a near infrared spectroscopy (NIRS) system and access to MRI and MEG. Several fully mobile, smartphone-operated wireless EEG systems are available as well. Candidates must have an academic university degree in Biomedical Engineering, Electrical Engineering, Computer Science, or a closely related field. Analytical skills, programming skills in Matlab, experience with Machine Learning and expertise in single-trial EEG analysis is required. Hands-on experience in BCI paradigm development or EEG sensor development is beneficial, as well as knowledge of BCI2000, BCILAB or OpenVibe software. An interest in auditory psychophysiology and a background in neuroscience is a plus but not strictly required. The position is suitable for part-time work, can be filled immediately and is available for initially two years with the aim of extending. The successful candidate will be affiliated to the Cluster of Excellence Hearing4All and the Department of Psychology within the School of Medicine and Health Sciences. Oldenburg has an international reputation in hearing research and hosts for instance the Fraunhofer Group Hearing, Speech and Audio Technology. Many international and interdisciplinary research groups provide an attractive scientific and social environment. Neuropsychology Lab: http://www.uni-oldenburg.de/en/neuropsychology/ Cluster of Excellence Hearing4all: http://hearing4all.eu/EN/ The University of Oldenburg is dedicated to increasing the percentage of women in science. Therefore, female candidates are particularly encouraged to apply. According to § 21 III NHG (legislation governing Higher Education in Lower Saxony) preference will be given to female candidates in cases of equal qualification. Handicapped applicants will be given preference if equally qualified. Please send your application including a cover letter, CV, list of potential referees, list of publications, and copies of certificates for academic degrees to Prof. Dr. Stefan Debener, Carl von Ossietzky Universität Oldenbur, Department Psychologie, D-26111 Oldenburg, Germany. We prefer an electronic application with a single pdf file to stefan.debener at uni-oldenburg.de . Please apply by 15 December 2014 to ensure consideration. -- Prof. Dr. Stefan Debener Neuropsychology Lab Department of Psychology University of Oldenburg D-26111 Oldenburg Germany Office: A7 0-038 Phone: +49-441-798-4271 Fax: +49-441-798-5522 Email: stefan.debener at uni-oldenburg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From helene.gudi at uni-hamburg.de Tue Nov 25 13:15:46 2014 From: helene.gudi at uni-hamburg.de (Helene Gudi) Date: Tue, 25 Nov 2014 13:15:46 +0100 Subject: [FieldTrip] spectral resolution & interpretation of power estimates Message-ID: <547472F2.6020107@uni-hamburg.de> Dear FieldTrip List, Since a while I am struggeling with a question regarding the spectral resolution and its consequences for interpreting the power vaules. I would appreciate any comments or hints which help me understand the issue. As described in the tutorial on TFR analysis when using the Morlet wavelets the spectral bandwidth at a given frequency is determined by the formula: F/width*2, meaning that when I define cfg.width=7 and look into the estimated power values of e.g. 8Hz, what I get is the power values not for 8 Hz but for a spectral band of 8Hz+/- (8/7*2)/2. Am I correct? If yes, is this also true when estimating the power values using a Hanning window? As described in the tutorial when using the Hanning taper the frequency resolution is defined by: 1/length of the sliding window. Let's say my sliding window = .5s, resulting in a frequency resolution of 2 Hz. Now, if i look into the power estimate for 10 Hz, do I get the spectral band of 2Hz at a given frequency eg. 9-11Hz, for 10Hz etc.? My next question refers to the 'cfg.pad' parameter, in the help it says: "the padding determines the spectral resolution". I unfortunately could not find any further explanations. What exactly does it mean? How do I compute the exact frequency resolution once cfg.pad has been used? Is it 1/cfg.pad? Does the padding allow to estimate power values for frequencies other than given by '1/length of time window'-resolution? As in the code below power estimates are calculated in 1Hz steps. Do the power estimates at 3Hz,4Hz etc. make sense at all, given the frequency resolution of 2.5Hz (as defined by 1/cfg.t_ftimwin)? What spectral band is actually included in the single 1Hz bins? Is it a problem if the frequency resolution ist not an integer? cfg = []; cfg.output = 'pow'; cfg.channel = 'all'; cfg.keeptapers = 'no'; cfg.pad = 7; cfg.method = 'mtmconvol'; cfg.toi = -1.75:0.05:1.75; cfg.taper = 'hanning'; cfg.keeptrials = 'yes'; cfg.foi = 3:35; cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; ft_freqanalysis(cfg, data); I would be very thankful for any help! Lena From ben.vanlier at bsse.ethz.ch Tue Nov 25 13:43:40 2014 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Tue, 25 Nov 2014 12:43:40 +0000 Subject: [FieldTrip] baselinetype decibel and plotting error Message-ID: Hi, I would like to plot my data in decibel. It works fine when running singleplotTFR, however I get an error when i use the plot interactivity to select a time/freq range within the singleplotTFR. The resulting topoplot has no color (it does show the contourlines of the data) and the layout outline is stretched (should be square). running topoplotTFR directly works fine and using the other baselinetypes is also no problem. the error is only when interacting with a spectrogram in decibel. Error using surf (line 75) X, Y, Z, and C cannot be complex Error in ft_plot_topo (line 251) h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in topoplot_common (line 704) ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ft_topoplotTFR (line 186) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_singleplotTFR>select_topoplotTFR (line 579) ft_topoplotTFR(cfg, varargin{:}); Error in ft_select_range>evalCallback (line 325) feval(funhandle, funargs{:}, val, cmenulab); Error in ft_select_range (line 159) evalCallback(callback, userData.range); Error while evaluating figure WindowButtonDownFcn its not the end of the world, but its such a nice feature to have... thank you, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Tue Nov 25 15:33:33 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Tue, 25 Nov 2014 14:33:33 +0000 Subject: [FieldTrip] spectral resolution & interpretation of power estimates In-Reply-To: <547472F2.6020107@uni-hamburg.de> References: <547472F2.6020107@uni-hamburg.de> Message-ID: Hi Helene, The idea in general is to design one's experiment in a way that allows one to observe effects at the frequency of interest. Otherwise, what you might end up with is an experiment that doesn't allow you to estimate power at the frequencies of interest. For wavelets, given your specifications, you would get a spectral bandwidth of 8/7*2 = 2.28 Hz. So 8 +/- 2.28 Hz ( 5.72 - 10.28) i.e. the bandwidth calculated refers to the bandwidth on one end, not both. Therefore, you shouldn't divide by two. Similarly with multitapers, if you have a smoothing for 8 Hz, that's -8Hz and +8Hz. For the Hanning taper, 1/0.5s = 2Hz, means you get estimates of power that are multiples of 2 Hz, so 10, 12, 14 Hz ..etc. With regards to what the spectral bandwidth is, the short answer is that it is plus and minus half the frequency resolution. So, for 10 Hz, it is 9 - 11Hz. The reasons behind this answer are to do with the spectral profile of the taper (e.g., a Hanning window) that you apply to your data. I would suggest that you take a look at one of our lecture video's here by Robert: https://www.youtube.com/watch?feature=player_detailpage&v=QLvsa1r1Voc#t=741 where he provides a much more detailed explanation. cfg.pad parameter in ft_freqanalysis: This parameter is helpful if your trials are of different length. If you set cfg.pad = 7, that means any trial shorter than 7s long will be padded to become 7s worth of data. The type of data that you use to pad is specified in cfg.padtype. The frequency resolution of your data is indeed 1/cfg.pad. There is a suggested limit for how much you should pad given your data, but I'm not sure what the limit is, maybe someone else knows. Now with your code, cfg.toi = -1.75:0.05:1.75; cfg.taper = 'hanning'; cfg.foi = 3:35; cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; You have a 0.4 second window. So 1/0.4 = 2.5Hz frequency resolution, as you figured out. This means you can only estimate in steps of 2.5Hz so doing power estimates at 1 Hz steps does *not* make sense. To get any sensible estimate, you would need something like this cfg.foi = 2.5:2.5:35; Finally, no, the frequency resolution does not have to be an integer. We don't know what frequency(ies) the brain oscillates, but integers allow for us to deal with the data more easily. I hope this helps, and I hope that if I've not been entirely accurate with my explanations that someone will jump in to correct me. Best, Nietzsche ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helene Gudi [helene.gudi at uni-hamburg.de] Sent: 25 November 2014 13:15 To: fieldtrip at science.ru.nl Subject: [FieldTrip] spectral resolution & interpretation of power estimates Dear FieldTrip List, Since a while I am struggeling with a question regarding the spectral resolution and its consequences for interpreting the power vaules. I would appreciate any comments or hints which help me understand the issue. As described in the tutorial on TFR analysis when using the Morlet wavelets the spectral bandwidth at a given frequency is determined by the formula: F/width*2, meaning that when I define cfg.width=7 and look into the estimated power values of e.g. 8Hz, what I get is the power values not for 8 Hz but for a spectral band of 8Hz+/- (8/7*2)/2. Am I correct? If yes, is this also true when estimating the power values using a Hanning window? As described in the tutorial when using the Hanning taper the frequency resolution is defined by: 1/length of the sliding window. Let's say my sliding window = .5s, resulting in a frequency resolution of 2 Hz. Now, if i look into the power estimate for 10 Hz, do I get the spectral band of 2Hz at a given frequency eg. 9-11Hz, for 10Hz etc.? My next question refers to the 'cfg.pad' parameter, in the help it says: "the padding determines the spectral resolution". I unfortunately could not find any further explanations. What exactly does it mean? How do I compute the exact frequency resolution once cfg.pad has been used? Is it 1/cfg.pad? Does the padding allow to estimate power values for frequencies other than given by '1/length of time window'-resolution? As in the code below power estimates are calculated in 1Hz steps. Do the power estimates at 3Hz,4Hz etc. make sense at all, given the frequency resolution of 2.5Hz (as defined by 1/cfg.t_ftimwin)? What spectral band is actually included in the single 1Hz bins? Is it a problem if the frequency resolution ist not an integer? cfg = []; cfg.output = 'pow'; cfg.channel = 'all'; cfg.keeptapers = 'no'; cfg.pad = 7; cfg.method = 'mtmconvol'; cfg.toi = -1.75:0.05:1.75; cfg.taper = 'hanning'; cfg.keeptrials = 'yes'; cfg.foi = 3:35; cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; ft_freqanalysis(cfg, data); I would be very thankful for any help! Lena _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jorn at artinis.com Wed Nov 26 08:43:47 2014 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Wed, 26 Nov 2014 08:43:47 +0100 Subject: [FieldTrip] spectral resolution & interpretation of power estimates In-Reply-To: References: <547472F2.6020107@uni-hamburg.de> Message-ID: <000001d0094c$b734ce00$259e6a00$@artinis.com> Hey, as an addition, maybe keep in mind that using filters you in fact widen your main lobe (i.e. decrease the effective frequency resolution, e.g. for a Hanning taper the main lobe drops to zero at twice the Raleigh frequency), and you do this to decrease magnitude of the side lobes. Most people tend to forget such things when interpreting their data (incl. me). Best, Jörn -- Jörn M. Horschig, Software Engineer Artinis Medical Systems  |  +31 481 350 980 > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Lam, N.H.L. (Nietzsche) > Sent: Tuesday, November 25, 2014 3:34 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] spectral resolution & interpretation of power > estimates > > Hi Helene, > > The idea in general is to design one's experiment in a way that allows one to > observe effects at the frequency of interest. Otherwise, what you might > end up with is an experiment that doesn't allow you to estimate power at > the frequencies of interest. > > For wavelets, given your specifications, you would get a spectral bandwidth > of 8/7*2 = 2.28 Hz. > So 8 +/- 2.28 Hz ( 5.72 - 10.28) i.e. the bandwidth calculated refers to the > bandwidth on one end, not both. Therefore, you shouldn't divide by two. > Similarly with multitapers, if you have a smoothing for 8 Hz, that's -8Hz and > +8Hz. > > For the Hanning taper, 1/0.5s = 2Hz, means you get estimates of power that > are multiples of 2 Hz, so 10, 12, 14 Hz ..etc. With regards to what the spectral > bandwidth is, the short answer is that it is plus and minus half the frequency > resolution. So, for 10 Hz, it is 9 - 11Hz. The reasons behind this answer are to > do with the spectral profile of the taper (e.g., a Hanning window) that you > apply to your data. I would suggest that you take a look at one of our lecture > video's here by Robert: > https://www.youtube.com/watch?feature=player_detailpage&v=QLvsa1r1V > oc#t=741 where he provides a much more detailed explanation. > > cfg.pad parameter in ft_freqanalysis: This parameter is helpful if your trials > are of different length. If you set cfg.pad = 7, that means any trial shorter > than 7s long will be padded to become 7s worth of data. The type of data > that you use to pad is specified in cfg.padtype. The frequency resolution of > your data is indeed 1/cfg.pad. There is a suggested limit for how much you > should pad given your data, but I'm not sure what the limit is, maybe > someone else knows. > > Now with your code, > cfg.toi = -1.75:0.05:1.75; > cfg.taper = 'hanning'; > cfg.foi = 3:35; > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > > You have a 0.4 second window. So 1/0.4 = 2.5Hz frequency resolution, as you > figured out. > This means you can only estimate in steps of 2.5Hz so doing power estimates > at 1 Hz steps does *not* make sense. To get any sensible estimate, you > would need something like this cfg.foi = 2.5:2.5:35; > > Finally, no, the frequency resolution does not have to be an integer. We > don't know what frequency(ies) the brain oscillates, but integers allow for us > to deal with the data more easily. > > I hope this helps, and I hope that if I've not been entirely accurate with my > explanations that someone will jump in to correct me. > > Best, > Nietzsche > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on > behalf of Helene Gudi [helene.gudi at uni-hamburg.de] > Sent: 25 November 2014 13:15 > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] spectral resolution & interpretation of power estimates > > Dear FieldTrip List, > > Since a while I am struggeling with a question regarding the spectral > resolution and its consequences for interpreting the power vaules. I would > appreciate any comments or hints which help me understand the issue. > > As described in the tutorial on TFR analysis when using the Morlet wavelets > the spectral bandwidth at a given frequency is determined by the formula: > F/width*2, meaning that when I define cfg.width=7 and look into the > estimated power values of e.g. 8Hz, what I get is the power values not for 8 > Hz but for a spectral band of 8Hz+/- (8/7*2)/2. > Am I correct? > If yes, is this also true when estimating the power values using a Hanning > window? As described in the tutorial when using the Hanning taper the > frequency resolution is defined by: 1/length of the sliding window. Let's say > my sliding window = .5s, resulting in a frequency resolution of 2 Hz. Now, if i > look into the power estimate for 10 Hz, do I get the spectral band of 2Hz at a > given frequency eg. 9-11Hz, for 10Hz etc.? > > My next question refers to the 'cfg.pad' parameter, in the help it says: > "the padding determines the spectral resolution". I unfortunately could not > find any further explanations. What exactly does it mean? How do I compute > the exact frequency resolution once cfg.pad has been used? Is it 1/cfg.pad? > Does the padding allow to estimate power values for frequencies other than > given by '1/length of time window'-resolution? As in the code below power > estimates are calculated in 1Hz steps. Do the power estimates at 3Hz,4Hz etc. > make sense at all, given the frequency resolution of 2.5Hz (as defined by > 1/cfg.t_ftimwin)? What spectral band is actually included in the single 1Hz > bins? Is it a problem if the frequency resolution ist not an integer? > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'all'; > cfg.keeptapers = 'no'; > cfg.pad = 7; > cfg.method = 'mtmconvol'; > cfg.toi = -1.75:0.05:1.75; > cfg.taper = 'hanning'; > cfg.keeptrials = 'yes'; > cfg.foi = 3:35; > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > ft_freqanalysis(cfg, data); > > I would be very thankful for any help! > Lena > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jorn at artinis.com Wed Nov 26 08:44:33 2014 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Wed, 26 Nov 2014 08:44:33 +0100 Subject: [FieldTrip] baselinetype decibel and plotting error In-Reply-To: References: Message-ID: <000101d0094c$d26d3040$774790c0$@artinis.com> Hi Ben, nice to see here, and that you are actively using FieldTrip ;) My guess is that the error occurs because you have negative values that you want to transform, e.g. because you are taking a contrats between conditions. Converting to decibels involves taking the logarithm, and the logarithm of negative numbers is not good (i.e. you get complex numbers out). A simple solution is to first take the logarithm of e.g. individual conditions and then subtract or, which is equivalent, dividing the two conditions from one another and then taking the logarithm. Best, Jörn -- Jörn M. Horschig, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of van Lier Ben Sent: Tuesday, November 25, 2014 1:44 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] baselinetype decibel and plotting error Hi, I would like to plot my data in decibel. It works fine when running singleplotTFR, however I get an error when i use the plot interactivity to select a time/freq range within the singleplotTFR. The resulting topoplot has no color (it does show the contourlines of the data) and the layout outline is stretched (should be square). running topoplotTFR directly works fine and using the other baselinetypes is also no problem. the error is only when interacting with a spectrogram in decibel. Error using surf (line 75) X, Y, Z, and C cannot be complex Error in ft_plot_topo (line 251) h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in topoplot_common (line 704) ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ft_topoplotTFR (line 186) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_singleplotTFR>select_topoplotTFR (line 579) ft_topoplotTFR(cfg, varargin{:}); Error in ft_select_range>evalCallback (line 325) feval(funhandle, funargs{:}, val, cmenulab); Error in ft_select_range (line 159) evalCallback(callback, userData.range); Error while evaluating figure WindowButtonDownFcn its not the end of the world, but its such a nice feature to have... thank you, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Wed Nov 26 08:47:39 2014 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Wed, 26 Nov 2014 08:47:39 +0100 Subject: [FieldTrip] spectral resolution & interpretation of power estimates In-Reply-To: <000001d0094c$b734ce00$259e6a00$@artinis.com> References: <547472F2.6020107@uni-hamburg.de> <000001d0094c$b734ce00$259e6a00$@artinis.com> Message-ID: <000b01d0094d$415844e0$c408cea0$@artinis.com> please allow me to correct my first sentence: > as an addition, maybe keep in mind that using *tapers* you in fact widen your -- Jörn M. Horschig, Software Engineer Artinis Medical Systems  |  +31 481 350 980 > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Jörn M. Horschig > Sent: Wednesday, November 26, 2014 8:44 AM > To: 'FieldTrip discussion list' > Subject: Re: [FieldTrip] spectral resolution & interpretation of power > estimates > > Hey, > > as an addition, maybe keep in mind that using filters you in fact widen your > main lobe (i.e. decrease the effective frequency resolution, e.g. for a > Hanning taper the main lobe drops to zero at twice the Raleigh frequency), > and you do this to decrease magnitude of the side lobes. Most people tend > to forget such things when interpreting their data (incl. me). > > Best, > Jörn > > -- > > Jörn M. Horschig, Software Engineer > Artinis Medical Systems  |  +31 481 350 980 > > > -----Original Message----- > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > > bounces at science.ru.nl] On Behalf Of Lam, N.H.L. (Nietzsche) > > Sent: Tuesday, November 25, 2014 3:34 PM > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] spectral resolution & interpretation of power > > estimates > > > > Hi Helene, > > > > The idea in general is to design one's experiment in a way that allows > > one > to > > observe effects at the frequency of interest. Otherwise, what you > > might end up with is an experiment that doesn't allow you to estimate > > power at the frequencies of interest. > > > > For wavelets, given your specifications, you would get a spectral > bandwidth > > of 8/7*2 = 2.28 Hz. > > So 8 +/- 2.28 Hz ( 5.72 - 10.28) i.e. the bandwidth calculated > > refers > to the > > bandwidth on one end, not both. Therefore, you shouldn't divide by two. > > Similarly with multitapers, if you have a smoothing for 8 Hz, that's > > -8Hz > and > > +8Hz. > > > > For the Hanning taper, 1/0.5s = 2Hz, means you get estimates of > > power > that > > are multiples of 2 Hz, so 10, 12, 14 Hz ..etc. With regards to what the > spectral > > bandwidth is, the short answer is that it is plus and minus half the > frequency > > resolution. So, for 10 Hz, it is 9 - 11Hz. The reasons behind this > answer are to > > do with the spectral profile of the taper (e.g., a Hanning window) > > that > you > > apply to your data. I would suggest that you take a look at one of > > our > lecture > > video's here by Robert: > > > https://www.youtube.com/watch?feature=player_detailpage&v=QLvsa1r1V > > oc#t=741 where he provides a much more detailed explanation. > > > > cfg.pad parameter in ft_freqanalysis: This parameter is helpful if > > your > trials > > are of different length. If you set cfg.pad = 7, that means any trial > shorter > > than 7s long will be padded to become 7s worth of data. The type of data > > that you use to pad is specified in cfg.padtype. The frequency > resolution of > > your data is indeed 1/cfg.pad. There is a suggested limit for how much > you > > should pad given your data, but I'm not sure what the limit is, maybe > > someone else knows. > > > > Now with your code, > > cfg.toi = -1.75:0.05:1.75; > > cfg.taper = 'hanning'; > > cfg.foi = 3:35; > > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > > > > You have a 0.4 second window. So 1/0.4 = 2.5Hz frequency resolution, > > as > you > > figured out. > > This means you can only estimate in steps of 2.5Hz so doing power > estimates > > at 1 Hz steps does *not* make sense. To get any sensible estimate, > > you would need something like this cfg.foi = 2.5:2.5:35; > > > > Finally, no, the frequency resolution does not have to be an integer. > > We don't know what frequency(ies) the brain oscillates, but integers > > allow > for us > > to deal with the data more easily. > > > > I hope this helps, and I hope that if I've not been entirely accurate > > with > my > > explanations that someone will jump in to correct me. > > > > Best, > > Nietzsche > > > > ________________________________________ > > From: fieldtrip-bounces at science.ru.nl > > [fieldtrip-bounces at science.ru.nl] on behalf of Helene Gudi > > [helene.gudi at uni-hamburg.de] > > Sent: 25 November 2014 13:15 > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] spectral resolution & interpretation of power > estimates > > > > Dear FieldTrip List, > > > > Since a while I am struggeling with a question regarding the spectral > > resolution and its consequences for interpreting the power vaules. I > > would appreciate any comments or hints which help me understand the > issue. > > > > As described in the tutorial on TFR analysis when using the Morlet > wavelets > > the spectral bandwidth at a given frequency is determined by the formula: > > F/width*2, meaning that when I define cfg.width=7 and look into the > > estimated power values of e.g. 8Hz, what I get is the power values not > > for > 8 > > Hz but for a spectral band of 8Hz+/- (8/7*2)/2. > > Am I correct? > > If yes, is this also true when estimating the power values using a > > Hanning window? As described in the tutorial when using the Hanning > > taper the frequency resolution is defined by: 1/length of the sliding > > window. Let's > say > > my sliding window = .5s, resulting in a frequency resolution of 2 Hz. > > Now, > if i > > look into the power estimate for 10 Hz, do I get the spectral band of > > 2Hz > at a > > given frequency eg. 9-11Hz, for 10Hz etc.? > > > > My next question refers to the 'cfg.pad' parameter, in the help it says: > > "the padding determines the spectral resolution". I unfortunately > > could > not > > find any further explanations. What exactly does it mean? How do I > > compute the exact frequency resolution once cfg.pad has been used? Is > > it > 1/cfg.pad? > > Does the padding allow to estimate power values for frequencies other > > than given by '1/length of time window'-resolution? As in the code > > below power estimates are calculated in 1Hz steps. Do the power > > estimates at 3Hz,4Hz > etc. > > make sense at all, given the frequency resolution of 2.5Hz (as defined > > by 1/cfg.t_ftimwin)? What spectral band is actually included in the > > single > 1Hz > > bins? Is it a problem if the frequency resolution ist not an integer? > > > > cfg = []; > > cfg.output = 'pow'; > > cfg.channel = 'all'; > > cfg.keeptapers = 'no'; > > cfg.pad = 7; > > cfg.method = 'mtmconvol'; > > cfg.toi = -1.75:0.05:1.75; > > cfg.taper = 'hanning'; > > cfg.keeptrials = 'yes'; > > cfg.foi = 3:35; > > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > > ft_freqanalysis(cfg, data); > > > > I would be very thankful for any help! > > Lena > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Wed Nov 26 14:26:27 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Wed, 26 Nov 2014 13:26:27 +0000 Subject: [FieldTrip] Averaging on a random sample In-Reply-To: References: <8d9e856a862b4df1a4d98b40c1e18b48@EXPRD01.hosting.ru.nl> Message-ID: Thanks Eelke If this can help someone else, here is the correct code: arrondi=roundn(size(cleandata.trial,2)/2, 0); a = randperm(size(cleandata.trial,2)); r1=a(1:arrondi); r2=a(arrondi+1:end); cfg = []; cfg.trials = r1; avgFCIndexHALF1 = ft_timelockanalysis(cfg, cleandata); cfg = []; cfg.trials = r2; avgFCIndexHALF2 = ft_timelockanalysis(cfg, cleandata); Best, Emilie --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 21 nov. 2014 à 10:29, Eelke Spaak > a écrit : Dear Emilie, You are not providing a FT data structure to ft_timelockanalysis (which you should), instead you are providing the raw cell array of trials (which you shouldn't). Hence, FT complains that the data is not in a structure that it can work with. There is a cfg-option cfg.trials, which you might like to use instead. Best, Eelke On 21 November 2014 10:09, Caspar, Emilie > wrote: Dear Fieldtrippers, I have a sample of 350 trials for one condition, but for statistical analysis reasons I would like to split randomly this sample in two and average these two parts. so, I used the "randsample" matlab function which seems to work very well and then I averaged this selected sample: randomhalf = randsample(cleandata.trial, 175); avgFCMiddleRing = ft_timelockanalysis(cfg, randomhalf); However, I have the following error message : Error using ft_checkdata (line 366) This function requires raw or comp data as input. Error in ft_timelockanalysis (line 105) data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Does anyone have a solution to fix the problem? Thank you very much! Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From giuseppespinelli88 at gmail.com Fri Nov 28 13:06:33 2014 From: giuseppespinelli88 at gmail.com (Giuseppe Spinelli) Date: Fri, 28 Nov 2014 13:06:33 +0100 Subject: [FieldTrip] HELP time_frequency Message-ID: *n *Dear FieldTrippers I am new to FieldTrip so I hope you could forgive my inexperience! I am trying to segment a triggered EEGLAB dataset (.set) which has been already preprocessed (resempled, filtered and cleaned by ICA). What I did was basically to define ethe eventvalue field with respect to each experimental condition (32,64,128) in the continuous eeglab dataset then defining trial and then I run the preprocess function. Finally I run the ft_databrowser for visual inspecting one condition only (data_SE). The process results in these errors: Error using ft_fetch_data (line 62) data does not contain a consistent trial definition, fetching data is not possible Error in ft_databrowser>redraw_cb (line 1485) art = ft_fetch_data(opt.artdata, 'begsample', begsample, 'endsample', endsample); Error in ft_databrowser (line 696) redraw_cb(h); Error in eeglab2fieldtrip (line 30) cfg = ft_databrowser(cfg); here the script % loading .set dataset (from EEGLAB) cfg = []; cfg.dataset = 'C:\Users\GiuS\Documents\MATLAB\CAVE_ERROR_2_FIELDTRIP\EEG\S01.set'; cfg.continuous = 'yes'; % defining trials cfg.trialfun = 'ft_trialfun_general'; cfg.trialdef.eventtype = 'trigger'; % cfg.trialdef.eventvalue = 32; cfg.trialdef.eventvalue = 64; % cfg.trialdef.eventvalue = 128; cfg.trialdef.prestim = 1; cfg.trialdef.poststim = 2; cfg = ft_definetrial(cfg); % data_CO = ft_preprocessing(cfg); % n = 140 data_SE = ft_preprocessing(cfg); % n = 30 % data_LE = ft_preprocessing(cfg); % n = 30 % % plotting cfg.viewmode = 'vertical'; cfg.plotlabels = 'yes'; cfg.blocksize = 10; % cfg = ft_databrowser(cfg, data_CO); cfg = ft_databrowser(cfg, data_SE); % cfg = ft_databrowser(cfg, data_LE); I would be glad to receive some help. Many thanks in advance - *Giuseppe Spinelli*, Ph.D. student *Social and Cognitive Neuroscience Laboratory* *http://agliotilab.org/lab-staff/phd-students/1st-year/giuseppe-spinelli#anchor * Department of Psychology, Sapienza University of Rome *via dei Marsi 78, 00185 - Rome* Phone/Fax: (+39) 06-49917635 IRCCS Fondazione Santa Lucia *via Ardeatina 306, 00142 - Rome* *Tel. (+39) 06 5150 1107 <%28%2B39%29%2006%205150%201107>* @: giuseppe.spinelli at uniroma1.it -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Nov 28 13:57:02 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 28 Nov 2014 13:57:02 +0100 Subject: [FieldTrip] HELP time_frequency In-Reply-To: <211016fc25f346999e5b700acd099c3a@EXPRD02.hosting.ru.nl> References: <211016fc25f346999e5b700acd099c3a@EXPRD02.hosting.ru.nl> Message-ID: Dear Giuseppe, Try initializing your cfg to empty (cfg = [];) at the beginning of your %% plotting block. In general, every FT function call should use its own cfg-structure. (The one exception being the pattern cfg = ft_definetrial(cfg); data = ft_preprocessing(cfg);, which remains for historical reasons).) Best, Eelke On 28 November 2014 at 13:06, Giuseppe Spinelli wrote: > n Dear FieldTrippers > > I am new to FieldTrip so I hope you could forgive my inexperience! > > I am trying to segment a triggered EEGLAB dataset (.set) which has been > already preprocessed (resempled, filtered and cleaned by ICA). > > What I did was basically to define ethe eventvalue field with respect to > each experimental condition (32,64,128) in the continuous eeglab dataset > then defining trial and then I run the preprocess function. Finally I run > the ft_databrowser for visual inspecting one condition only (data_SE). > > The process results in these errors: > > Error using ft_fetch_data (line 62) > data does not contain a consistent trial definition, fetching data is not > possible > > Error in ft_databrowser>redraw_cb (line 1485) > art = ft_fetch_data(opt.artdata, 'begsample', begsample, 'endsample', > endsample); > > Error in ft_databrowser (line 696) > redraw_cb(h); > > Error in eeglab2fieldtrip (line 30) > cfg = ft_databrowser(cfg); > > > here the script > > % loading .set dataset (from EEGLAB) > cfg = []; > cfg.dataset = > 'C:\Users\GiuS\Documents\MATLAB\CAVE_ERROR_2_FIELDTRIP\EEG\S01.set'; > cfg.continuous = 'yes'; > > % defining trials > cfg.trialfun = 'ft_trialfun_general'; > cfg.trialdef.eventtype = 'trigger'; > > % cfg.trialdef.eventvalue = 32; > cfg.trialdef.eventvalue = 64; > % cfg.trialdef.eventvalue = 128; > > cfg.trialdef.prestim = 1; > cfg.trialdef.poststim = 2; > > cfg = ft_definetrial(cfg); > > % data_CO = ft_preprocessing(cfg); % n = 140 > data_SE = ft_preprocessing(cfg); % n = 30 > % data_LE = ft_preprocessing(cfg); % n = 30 > > % % plotting > cfg.viewmode = 'vertical'; > cfg.plotlabels = 'yes'; > cfg.blocksize = 10; > % cfg = ft_databrowser(cfg, data_CO); > cfg = ft_databrowser(cfg, data_SE); > % cfg = ft_databrowser(cfg, data_LE); > > I would be glad to receive some help. > > Many thanks in advance > > - > Giuseppe Spinelli, Ph.D. student > Social and Cognitive Neuroscience Laboratory > http://agliotilab.org/lab-staff/phd-students/1st-year/giuseppe-spinelli#anchor > > Department of Psychology, Sapienza University of Rome > via dei Marsi 78, 00185 - Rome > Phone/Fax: (+39) 06-49917635 > > IRCCS Fondazione Santa Lucia > via Ardeatina 306, 00142 - Rome > Tel. (+39) 06 5150 1107 > > @: giuseppe.spinelli at uniroma1.it From Hahn at psych.uni-frankfurt.de Sat Nov 1 11:27:49 2014 From: Hahn at psych.uni-frankfurt.de (Tim Hahn) Date: Sat, 01 Nov 2014 11:27:49 +0100 Subject: [FieldTrip] channel time series from simulated brain data Message-ID: <5454B5A5.5080408@psych.uni-frankfurt.de> Dear all, I simulated neural dynamics. Now, I'd like to compare it to my EEG data. To generate scalp maps (i.e. time series at each channel) from my simulation, I would need to put my simulated data into a forward model if I understand correctly. How could I do this using fieldtrip? If I'm not mistaken, I need to generate a lead-field matrix to "project" my simulated brain data onto the channel locations. Unfortunately, all examples need individual MRI data to build the model whereas I simply modeled my data in MNI space in the first place and thus don't have MRI data (nor should I need it in this case, I think). Thanks a lot for your help. Cheers, Tim From tzvetan.popov at uni-konstanz.de Sat Nov 1 13:00:53 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Sat, 1 Nov 2014 13:00:53 +0100 Subject: [FieldTrip] channel time series from simulated brain data In-Reply-To: <5454B5A5.5080408@psych.uni-frankfurt.de> References: <5454B5A5.5080408@psych.uni-frankfurt.de> Message-ID: <9953AEC7-A11C-404F-8644-DC0452EDFFCE@uni-konstanz.de> Dear Tim, you might have a look here: http://fieldtrip.fcdonders.nl/example/compute_forward_simulated_data_and_apply_a_dipole_fit and also at this post http://mailman.science.ru.nl/pipermail/fieldtrip/2014-September/008482.html good luck, tzvetan > Dear all, > I simulated neural dynamics. Now, I'd like to compare it to my EEG data. To generate scalp maps (i.e. time series at each channel) from my simulation, I would need to put my simulated data into a forward model if I understand correctly. How could I do this using fieldtrip? If I'm not mistaken, I need to generate a lead-field matrix to "project" my simulated brain data onto the channel locations. Unfortunately, all examples need individual MRI data to build the model whereas I simply modeled my data in MNI space in the first place and thus don't have MRI data (nor should I need it in this case, I think). > Thanks a lot for your help. > Cheers, > Tim > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eh776 at york.ac.uk Mon Nov 3 12:04:17 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Mon, 3 Nov 2014 11:04:17 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Hi Nietzsche, That's much clearer--thanks for your help. It seems as though I should have entered my sources estimates into data.pow.avg rather than data.avg. However, I am still getting an error. My data is structured: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.pow.avg = [902629 x 11 double] % source estimates When I try: grandavgA = ft_sourcegrandaverage(cfg, data{:}); I get the error message: ??? Error using ==> ft_checkdata>fixsource at 1259 the input does not contain an avg or trial field Error in ==> ft_checkdata at 650 data = fixsource(data, 'type', sourcerepresentation); Error in ==> ft_sourcegrandaverage at 107 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); It appears as though the function is searching for a data{i}.avg or data{i}.trial field. What data should these fields contain? The wiki (http://fieldtrip.fcdonders.nl/reference/ft_datatype_source) seems to state that these are "historical" fields, although I have updated to fieldtrip-20141030 (the same error also occurs with older versions) Best, Emma On 31 October 2014 16:02, Lam, N.H.L. (Nietzsche) wrote: > Hi Emma, > > In this part: > ??? Undefined function or method 'fieldnames' for input arguments of >type 'double'. > > > Error in ==> parameterselection at 47 > tmp = fieldnames(data.avg); > > it says that the function 'fieldnames' doesn't know how to deal with data that is of the type > double. This is because fieldnames expects your data to be in the format of a struct. I'm > guessing there was just an error in your implementation because from your message you > understood that "input data to ft_sourcegrandaverage contains a cell array of structures -- ones > for each participant. Furthermore, you need to put your source estimates in data.pow.avg. > > Based on your description, you might try something like this (but it's not guaranteed to work > because I'm not entirely sure about the details of your data) > > data.pos = [902629x3 double] > data.dim = [91 109 91] > data.time = [1 x Z double] % vector of time points > data.pow.avg = [902629 x time points] % source estimates (or potentially voxel x frequency > x time points, depending on your data). > > As a side note, the size of your data will be quite taxing on computational memory so you > might also want to consider using a lower spatial resolution. > > Finally, in the future, when describing your data, it would be best to show the structure of your > data as shown in matlab (as done above), because this makes it easier for everyone else to > see what you've done. Please check this FAQ for more details http://fieldtrip.fcdonders.nl/ > faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/ > how_to_ask_good_questions_to_the_community > > Best, > Nietzsche -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Nov 3 12:35:55 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 3 Nov 2014 12:35:55 +0100 (CET) Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: References: Message-ID: <075001cff75a$5487d8a0$fd9789e0$@vanpelt@fcdonders.ru.nl> Hi Emma, Try using data{i}.avg.pow instead of data{i}.pow.avg (or use cfg.funparameter = 'pow.avg' instead of cfg.funparameter = 'avg.pow') Best, Stan From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Emma Holmes Sent: maandag 3 november 2014 12:04 To: fieldtrip at science.ru.nl Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Hi Nietzsche, That's much clearer--thanks for your help. It seems as though I should have entered my sources estimates into data.pow.avg rather than data.avg. However, I am still getting an error. My data is structured: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.pow.avg = [902629 x 11 double] % source estimates When I try: grandavgA = ft_sourcegrandaverage(cfg, data{:}); I get the error message: ??? Error using ==> ft_checkdata>fixsource at 1259 the input does not contain an avg or trial field Error in ==> ft_checkdata at 650 data = fixsource(data, 'type', sourcerepresentation); Error in ==> ft_sourcegrandaverage at 107 varargin{i} = ft_checkdata(varargin{i}, 'datatype', {'source'}, 'feedback', 'no', 'inside', 'logical', 'sourcerepresentation', 'new'); It appears as though the function is searching for a data{i}.avg or data{i}.trial field. What data should these fields contain? The wiki (http://fieldtrip.fcdonders.nl/reference/ft_datatype_source) seems to state that these are "historical" fields, although I have updated to fieldtrip-20141030 (the same error also occurs with older versions) Best, Emma On 31 October 2014 16:02, Lam, N.H.L. (Nietzsche) wrote: > Hi Emma, > > In this part: > ??? Undefined function or method 'fieldnames' for input arguments of >type > 'double'. > > > Error in ==> parameterselection at 47 > tmp = fieldnames(data.avg); > > it says that the function 'fieldnames' doesn't know how to deal with data > that is of the type > double. This is because fieldnames expects your data to be in the format > of a struct. I'm > guessing there was just an error in your implementation because from your > message you > understood that "input data to ft_sourcegrandaverage contains a cell array > of structures -- ones > for each participant. Furthermore, you need to put your source estimates > in data.pow.avg. > > Based on your description, you might try something like this (but it's not > guaranteed to work > because I'm not entirely sure about the details of your data) > > data.pos = [902629x3 double] > data.dim = [91 109 91] > data.time = [1 x Z double] % vector of time points > data.pow.avg = [902629 x time points] % source estimates (or > potentially voxel x frequency > x time points, depending on your data). > > As a side note, the size of your data will be quite taxing on > computational memory so you > might also want to consider using a lower spatial resolution. > > Finally, in the future, when describing your data, it would be best to > show the structure of your > data as shown in matlab (as done above), because this makes it easier for > everyone else to > see what you've done. Please check this FAQ for more details > http://fieldtrip.fcdonders.nl/ > > faq/how_to_ask_good_questions_to_the_communityhttp://fieldtrip.fcdonders.nl/faq/ > > how_to_ask_good_questions_to_the_community > > > Best, > Nietzsche -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Mon Nov 3 14:01:32 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Mon, 3 Nov 2014 13:01:32 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Hi Stan, Thanks for the suggestion. When I try that, I get the following error ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Error in ==> ft_sourcegrandaverage at 82 varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I am unsure why this occurs. My data is now structured in the following way: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.avg.pow = [902629 x 11 double] % source estimates The following is the method I use: cfg = []; cfg.keepindividual = 'yes'; cfg.parameter = 'pow'; grandavgA = ft_sourcegrandaverage(cfg, data{:}); Best, Emma On 31 October 2014 16:02, Stan van Pelt wrote: > Hi Emma, > > > > Try using data{i}.avg.pow instead of data{i}.pow.avg > > > > (or use cfg.funparameter = 'pow.avg' instead of cfg.funparameter = > 'avg.pow') > > > > Best, > > Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Mon Nov 3 16:24:31 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Mon, 3 Nov 2014 16:24:31 +0100 Subject: [FieldTrip] Radiological convention In-Reply-To: References: Message-ID: Hello, Please how I can flip the template MRI from Nuerological convention to radiological convention. Mercy Azeez A. Adebimpe "Knowledge and good manner, the beauty of a man" -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.vanpelt at fcdonders.ru.nl Mon Nov 3 16:54:15 2014 From: s.vanpelt at fcdonders.ru.nl (Stan van Pelt) Date: Mon, 3 Nov 2014 16:54:15 +0100 (CET) Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources In-Reply-To: References: Message-ID: <07bb01cff77e$6b7a9790$426fc6b0$@vanpelt@fcdonders.ru.nl> Hi Emma, I am unfamiliar with this type of error. It seems however that you still have an inconsistency in your data. You define “data{i}.avg.pow”, but later on use “cfg.parameter = 'pow';”. You should change one of the two (e.g. use cfg.parameter = 'avg.pow';) Hope that helps. Stan From: Emma Holmes [mailto:eh776 at york.ac.uk] Sent: maandag 3 november 2014 14:02 To: fieldtrip at science.ru.nl Cc: s.vanpelt at fcdonders.ru.nl Subject: Spatio-temporal cluster-based permutation analysis on EEG sources Hi Stan, Thanks for the suggestion. When I try that, I get the following error ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Error in ==> ft_sourcegrandaverage at 82 varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I am unsure why this occurs. My data is now structured in the following way: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.avg.pow = [902629 x 11 double] % source estimates The following is the method I use: cfg = []; cfg.keepindividual = 'yes'; cfg.parameter = 'pow'; grandavgA = ft_sourcegrandaverage(cfg, data{:}); Best, Emma On 31 October 2014 16:02, Stan van Pelt wrote: > Hi Emma, > > > > Try using data{i}.avg.pow instead of data{i}.pow.avg > > > > (or use cfg.funparameter = 'pow.avg' instead of cfg.funparameter = > 'avg.pow') > > > > Best, > > Stan -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Mon Nov 3 17:27:57 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Mon, 3 Nov 2014 17:27:57 +0100 Subject: [FieldTrip] Radiological convention In-Reply-To: <4cf51038d81e4fdeba513bc77268f0d8@EXPRD01.hosting.ru.nl> References: <4cf51038d81e4fdeba513bc77268f0d8@EXPRD01.hosting.ru.nl> Message-ID: Hi Azeez, Have a look at the private (and hence untested for direct use by end-users) function /private/volumeflip.m . Best, Eelke On 3 November 2014 16:24, Azeez Adebimpe wrote: > > > Hello, > > Please how I can flip the template MRI from Nuerological convention to > radiological convention. > > Mercy > > Azeez A. Adebimpe > > > "Knowledge and good manner, the beauty of a man" From f.roux at bcbl.eu Tue Nov 4 11:59:18 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 4 Nov 2014 11:59:18 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <0d9c01cff523$322a09b0$967e1d10$@maris@psych.ru.nl> Message-ID: <537192336.3738792.1415098758947.JavaMail.root@bcbl.eu> Dear all, I would like to follow up on this, as I am currently struggling myself with the coding of the design matrix of my analysis. I have MEG data from n = 95 participants aged between 12 and 27 years on a WM-task with 3 WM-load conditions. I would like to investigate the effects of age (continuous variable ranging from 12 to 27) and WM-load (categorical variable ranging from 1-3) on delay-activity in different frequency-bands. What would be the correct way to perform such an analysis in fieldtrip? Would this be akin to a mixed-effects design? Best regards, Fred Frédéric Roux ----- Original Message ----- From: "Eric Maris" To: "FieldTrip discussion list" Sent: Friday, October 31, 2014 4:56:16 PM Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Dear Dylan, I replied to your question on the Fieldtrip faq page that you refer to. Although the problem can be solved, it is not implemented yet, because it requires the implementation of three new statfuns: Hotelling’s T-square for dependent samples, Hotelling’s T-square for independent samples, and Wilk’s lambda. A good statistics book (e.g., Johnson & Wichern) will show you how to do this yourself. Otherwise, you have to be patient. Although your statistical problem can be solved, with neurobiological data, it is almost never wise to statistically test interaction effects in designs more complicated than the 2-by-2 factorial design. In these more complicated designs, you always end up with F-tests, which do not inform you about the pattern in the data that is responsible for the interaction effect. Best, Eric From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] Sent: dinsdag 28 oktober 2014 13:22 To: FieldTrip discussion list Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Thank you, Eelke. I'm sorry I am not picking this up more quickly. Your examples of passing either multiple structs or cell arrays to ft_freqstatistics deals with one group of subjects in multiple conditions, or two groups in one condition, respectively. I have two groups, both doing multiple (11) conditions and I would like to know how to handle that in ft_freqstatistics. What I require seems to be similar to what Eric Maris wrote about here: http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effect_using_cluster-based_permutation_tests but instead of a 2-by-2 factorial design, I am using a 2-by-11 factorial design. As such, I am not sure how this translates when making difference data structures. I hope I am not missing something obvious. Thanks again, Dylan On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > wrote: Dear Dylan, You don't want (or need) a single struct with a subj X chan X freq X time powspctrm. Instead, it is often convenient to collect each individual subject's struct in a *cell* array (rather than a struct array). See, for example, here: http://www.mathworks.nl/help/matlab/cell-arrays.html and here: http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their-contents/ . At the statistics step you should pass in multiple structs, each one corresponding to one unit-of-observation, to ft_freqstatistics. This can be done like so: stat = ft_freqstatistics(cfg, struct11, struct12, struct13,...struct21, struct22, ...); or, using the cell arrays, like so: stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); Make sure that each column in your design matrix describes one unit-of-observation, in the order in which the structs are passed into ft_freqstatistics. Best, Eelke On 21 October 2014 03:41, Dylan DeLosAngeles < dylan.delosangeles at gmail.com > wrote: > Dear Eelke, > > Thank you for help regarding cluster-based permutation analysis of two or more conditions. > > I am using time-frequency data (not time-lock structures). My first problem seems to be getting my 12 subjects into the 4D powspectrum. > > My code below loads 12 subjects from the first group, but I end up with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 electrodes x 3 frequencies x 2049 time points, rather than one struct with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x time points. > > for k = 1:Nmt, % states > for i = 1%:Ng, % groups > for j = 1:Ns, % subjects > > % load files > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > % convert to eeglab to get channel locations > EEG(j) = eeg2eeglab( p(j)); > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > % preprocessing in fieldtrip > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > % specify length of time to use in config > time = EEG(j).xmax-EEG(j).xmin; > > % setup configuration for freqanalysis > cfg = []; % clear cfg > cfg.output = 'pow'; > cfg.channel = 'EEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 0.5:3; % delta > cfg.toi = 1:0.05:time; % length of each state > cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > cfg.keeptrials = 'yes'; > > % do freqanalysis > freqdata(j) = ft_freqanalysis( cfg, d(j)); > end > end > end > > My second problem is loading in the second group of 12 subjects and what that will look like when I run ft_freqstatistics. > > Lastly, I just want to confirm what you said in your previous email, that I should be using indepsamplesF for more than two conditions (I have 11), and therefore my design should look like this; > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > Any help would be appreciated. > > Kind regards, > Dylan > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < eelke.spaak at donders.ru.nl > wrote: > Hello Dylan, > > You can analyse a between-subjects design exactly as you would a > between-trials design (at least as far as the statistics step is > concerned), in both cases the two conditions correspond to two groups > of observations, and not to the same group of observations measured in > two separate conditions (which would be a within-UO design). In > FieldTrip, you would typically compute averages per subject, then use > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > (not depsamples). indepsamplesT only requires one row in the design > matrix, indicating the condition. > > Note that if you have e.g. timelock structures in two (or more) cell > arrays, corresponding to the conditions, you can input them into the > statistics function as follows: > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > without having to call ft_timelockgrandaverage. In fact, the above is > the preferred way to do statistics now. (The same holds for > ft_freqstatistics.) > > Hope that helps, > Best, > Eelke > > On 24 September 2014 02:32, Dylan DeLosAngeles > < dylan.delosangeles at gmail.com > wrote: >> Hello, >> >> So far, the tutorial on "Cluster-based permutation tests on time-frequency >> data" has been very helpful. >> >> Out of the four combinations from the two UO-types (subjects and trials) and >> the two experimental designs (between- and within-UO), the tutorial covers >> statistics on data in two conditions in a between-trials, in a within-trials >> and in a within-subjects design. However, I am wondering if there is any >> information about the fourth type of experiment design: between-subjects. >> >> I have data for 2 groups with 12 subjects in each group. Both groups are >> measured during 11 conditions. >> Can I approach this in a similar fashion to within-subjects design (multiple >> subjects in multiple experimental conditions), such that my design is >> multiple groups in multiple experimental conditions. Is it a case of first >> averaging over all trials belonging to each of the experimental conditions >> for each subject (as instructed in tutorial), and then averaging over all >> subjects in each group? >> >> Configuration code for setting up the design currently looks like this; >> grp = 2; >> subj = 11; >> design = zeros(2, subj*grp); >> >> for i = 1:grp >> design(1,i:2:end) = i; >> end >> >> idx = 1; >> for i = 1:subj >> design(2,idx:idx+1) = i; >> idx = idx+2; >> end >> >> Is there anything else I need to take into consideration when doing these >> statistics? >> >> Thank you, >> Dr Dylan DeLosAngeles >> Research Fellow >> Brain Signal Laboratory >> Flinders University >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.maris at psych.ru.nl Tue Nov 4 12:22:12 2014 From: e.maris at psych.ru.nl (Eric Maris) Date: Tue, 4 Nov 2014 12:22:12 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <537192336.3738792.1415098758947.JavaMail.root@bcbl.eu> References: <0d9c01cff523$322a09b0$967e1d10$@maris@psych.ru.nl> <537192336.3738792.1415098758947.JavaMail.root@bcbl.eu> Message-ID: <020d01cff821$91fab690$b5f023b0$@maris@psych.ru.nl> Hi Fred, What you ask can definitely be done in Fieldtrip. The analyses you need are very similar to those of Vladimir Litvak, for who I implemented the statfuns indepsamplesRegrT and depsamplesRegrT. To give you the recipe, I would have to go back to the code, because it is such a long time ago. Anyhow, you now know where to look, and I trust that you can get a long way yourself. Best, Eric Maris > -----Original Message----- > From: Frédéric Roux [mailto:f.roux at bcbl.eu] > Sent: dinsdag 4 november 2014 11:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > Dear all, > > I would like to follow up on this, as I am currently struggling > myself with the coding of the design matrix of my analysis. > > I have MEG data from n = 95 participants aged between 12 and 27 years > on a WM-task with 3 WM-load conditions. > > I would like to investigate the effects of age (continuous variable > ranging from 12 to 27) and WM-load (categorical variable ranging from > 1-3) on delay-activity in different frequency-bands. > > What would be the correct way to perform such an analysis in > fieldtrip? > > Would this be akin to a mixed-effects design? > > Best regards, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Eric Maris" > To: "FieldTrip discussion list" > Sent: Friday, October 31, 2014 4:56:16 PM > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > > > > > > Dear Dylan, > > > > I replied to your question on the Fieldtrip faq page that you refer > to. Although the problem can be solved, it is not implemented yet, > because it requires the implementation of three new statfuns: > Hotelling’s T-square for dependent samples, Hotelling’s T-square for > independent samples, and Wilk’s lambda. A good statistics book (e.g., > Johnson & Wichern) will show you how to do this yourself. Otherwise, > you have to be patient. > > > > Although your statistical problem can be solved, with neurobiological > data, it is almost never wise to statistically test interaction > effects in designs more complicated than the 2-by-2 factorial design. > In these more complicated designs, you always end up with F-tests, > which do not inform you about the pattern in the data that is > responsible for the interaction effect. > > > > Best, > > > > Eric > > > > > > > > > From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] > Sent: dinsdag 28 oktober 2014 13:22 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > > > > Thank you, Eelke. > I'm sorry I am not picking this up more quickly. > > > > > > Your examples of passing either multiple structs or cell arrays to > ft_freqstatistics deals with one group of subjects in multiple > conditions, or two groups in one condition, respectively. I have two > groups, both doing multiple (11) conditions and I would like to know > how to handle that in ft_freqstatistics. What I require seems to be > similar to what Eric Maris wrote about here: > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effec > t_using_cluster-based_permutation_tests > > > > > > but instead of a 2-by-2 factorial design, I am using a 2-by-11 > factorial design. As such, I am not sure how this translates when > making difference data structures. I hope I am not missing something > obvious. > > > > > > Thanks again, > > > Dylan > > > > > > On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > > wrote: > > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their- > contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one unit- > of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles < > dylan.delosangeles at gmail.com > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of > two or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up > with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 > electrodes x 3 frequencies x 2049 time points, rather than one struct > with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x > time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config time = > > EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis cfg = []; % clear cfg > > cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = > 1:0.05:time; > > % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end > > > > My second problem is loading in the second group of 12 subjects and > what that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous > email, > > that I should be using indepsamplesF for more than two conditions > (I > > have 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < > eelke.spaak at donders.ru.nl > > wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two > groups > > of observations, and not to the same group of observations measured > in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then > use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) > cell > > arrays, corresponding to the conditions, you can input them into > the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above > is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles < > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > >> time-frequency data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > >> trials) and the two experimental designs (between- and within-UO), > >> the tutorial covers statistics on data in two conditions in a > >> between-trials, in a within-trials and in a within-subjects > design. > >> However, I am wondering if there is any information about the > fourth type of experiment design: between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both > groups > >> are measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > >> (multiple subjects in multiple experimental conditions), such that > my > >> design is multiple groups in multiple experimental conditions. Is > it > >> a case of first averaging over all trials belonging to each of the > >> experimental conditions for each subject (as instructed in > tutorial), > >> and then averaging over all subjects in each group? > >> > >> Configuration code for setting up the design currently looks like > >> this; grp = 2; subj = 11; design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when > doing > >> these statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > From f.roux at bcbl.eu Tue Nov 4 12:40:29 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 4 Nov 2014 12:40:29 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <020d01cff821$91fab690$b5f023b0$@maris@psych.ru.nl> Message-ID: <746608921.3739439.1415101229761.JavaMail.root@bcbl.eu> Hi Eric, thanks for getting back about this so quickly. This is very helpful. Do you think I could also combine depsamplesT with indepsamplesregrT? I was thinking to do something like this: % First test for the general effect of WM-load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'depsamplesT'; cfg.ivar = 1; cfg.uvar = 2; cfg.design = []; cfg.design(1,:) = [ones(1,length(dat3)) 2*ones(1,length(dat2))]; cfg.design(2,:) = [1:length(dat3) 1:length(dat2)]; [depT1] = ft_freqstatistics(cfg,dat3{:},dat2{:});% WM-load effect #1 cfg.design = []; cfg.design(1,:) = [ones(1,length(dat2)) 2*ones(1,length(dat1))]; cfg.design(2,:) = [1:length(dat2) 1:length(dat1)]; [depT2] = ft_freqstatistics(cfg,dat2{:},dat1{:});% WM-load effect #2 % Second test for the general effect of age in the data while controlling for load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'indepsamplesregrT'; cfg.ivar = 1; cfg.cvar = 2; cfg.design = []; cfg.design(1,:) = [Age Age Age]; cfg.design(2,:) = [ones(1,length(dat1)) 2*ones(1,length(dat2)) 3*ones(1,length(dat3))]; indepregT = ft_freqstatistics(cfg,dat1{:},dat2{:},dat3{:}); % Finally get the mixed-effects for Age and WM-load by combining the mask-data from the previous steps mixed_effects.mask = depT1.mask.*depT2.mask.*indepregT.mask; That way I would identify the channelxtimexfrequency data-points showing both an effect of WM-load and Age. Do you think that this would make sense or should I stick to depsamplesregrT and indepsamplesregrT? Best, Fred Frédéric Roux ----- Original Message ----- From: "Eric Maris" To: "FieldTrip discussion list" Sent: Tuesday, November 4, 2014 12:22:12 PM Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Hi Fred, What you ask can definitely be done in Fieldtrip. The analyses you need are very similar to those of Vladimir Litvak, for who I implemented the statfuns indepsamplesRegrT and depsamplesRegrT. To give you the recipe, I would have to go back to the code, because it is such a long time ago. Anyhow, you now know where to look, and I trust that you can get a long way yourself. Best, Eric Maris > -----Original Message----- > From: Frédéric Roux [mailto:f.roux at bcbl.eu] > Sent: dinsdag 4 november 2014 11:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > Dear all, > > I would like to follow up on this, as I am currently struggling > myself with the coding of the design matrix of my analysis. > > I have MEG data from n = 95 participants aged between 12 and 27 years > on a WM-task with 3 WM-load conditions. > > I would like to investigate the effects of age (continuous variable > ranging from 12 to 27) and WM-load (categorical variable ranging from > 1-3) on delay-activity in different frequency-bands. > > What would be the correct way to perform such an analysis in > fieldtrip? > > Would this be akin to a mixed-effects design? > > Best regards, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Eric Maris" > To: "FieldTrip discussion list" > Sent: Friday, October 31, 2014 4:56:16 PM > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > > > > > > Dear Dylan, > > > > I replied to your question on the Fieldtrip faq page that you refer > to. Although the problem can be solved, it is not implemented yet, > because it requires the implementation of three new statfuns: > Hotelling’s T-square for dependent samples, Hotelling’s T-square for > independent samples, and Wilk’s lambda. A good statistics book (e.g., > Johnson & Wichern) will show you how to do this yourself. Otherwise, > you have to be patient. > > > > Although your statistical problem can be solved, with neurobiological > data, it is almost never wise to statistically test interaction > effects in designs more complicated than the 2-by-2 factorial design. > In these more complicated designs, you always end up with F-tests, > which do not inform you about the pattern in the data that is > responsible for the interaction effect. > > > > Best, > > > > Eric > > > > > > > > > From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] > Sent: dinsdag 28 oktober 2014 13:22 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > > > > Thank you, Eelke. > I'm sorry I am not picking this up more quickly. > > > > > > Your examples of passing either multiple structs or cell arrays to > ft_freqstatistics deals with one group of subjects in multiple > conditions, or two groups in one condition, respectively. I have two > groups, both doing multiple (11) conditions and I would like to know > how to handle that in ft_freqstatistics. What I require seems to be > similar to what Eric Maris wrote about here: > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effec > t_using_cluster-based_permutation_tests > > > > > > but instead of a 2-by-2 factorial design, I am using a 2-by-11 > factorial design. As such, I am not sure how this translates when > making difference data structures. I hope I am not missing something > obvious. > > > > > > Thanks again, > > > Dylan > > > > > > On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > > wrote: > > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their- > contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one unit- > of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles < > dylan.delosangeles at gmail.com > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of > two or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up > with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 > electrodes x 3 frequencies x 2049 time points, rather than one struct > with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x > time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config time = > > EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis cfg = []; % clear cfg > > cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = > 1:0.05:time; > > % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end > > > > My second problem is loading in the second group of 12 subjects and > what that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous > email, > > that I should be using indepsamplesF for more than two conditions > (I > > have 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < > eelke.spaak at donders.ru.nl > > wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two > groups > > of observations, and not to the same group of observations measured > in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then > use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) > cell > > arrays, corresponding to the conditions, you can input them into > the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above > is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles < > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > >> time-frequency data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > >> trials) and the two experimental designs (between- and within-UO), > >> the tutorial covers statistics on data in two conditions in a > >> between-trials, in a within-trials and in a within-subjects > design. > >> However, I am wondering if there is any information about the > fourth type of experiment design: between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both > groups > >> are measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > >> (multiple subjects in multiple experimental conditions), such that > my > >> design is multiple groups in multiple experimental conditions. Is > it > >> a case of first averaging over all trials belonging to each of the > >> experimental conditions for each subject (as instructed in > tutorial), > >> and then averaging over all subjects in each group? > >> > >> Configuration code for setting up the design currently looks like > >> this; grp = 2; subj = 11; design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when > doing > >> these statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From f.roux at bcbl.eu Tue Nov 4 12:40:29 2014 From: f.roux at bcbl.eu (=?utf-8?B?RnLDqWTDqXJpYw==?= Roux) Date: Tue, 4 Nov 2014 12:40:29 +0100 (CET) Subject: [FieldTrip] Cluster-based permutation tests for between-subject design In-Reply-To: <020d01cff821$91fab690$b5f023b0$@maris@psych.ru.nl> Message-ID: <746608921.3739439.1415101229761.JavaMail.root@bcbl.eu> Hi Eric, thanks for getting back about this so quickly. This is very helpful. Do you think I could also combine depsamplesT with indepsamplesregrT? I was thinking to do something like this: % First test for the general effect of WM-load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'depsamplesT'; cfg.ivar = 1; cfg.uvar = 2; cfg.design = []; cfg.design(1,:) = [ones(1,length(dat3)) 2*ones(1,length(dat2))]; cfg.design(2,:) = [1:length(dat3) 1:length(dat2)]; [depT1] = ft_freqstatistics(cfg,dat3{:},dat2{:});% WM-load effect #1 cfg.design = []; cfg.design(1,:) = [ones(1,length(dat2)) 2*ones(1,length(dat1))]; cfg.design(2,:) = [1:length(dat2) 1:length(dat1)]; [depT2] = ft_freqstatistics(cfg,dat2{:},dat1{:});% WM-load effect #2 % Second test for the general effect of age in the data while controlling for load cfg = []; cfg.method = 'montecarlo'; ... cfg.statfun = 'indepsamplesregrT'; cfg.ivar = 1; cfg.cvar = 2; cfg.design = []; cfg.design(1,:) = [Age Age Age]; cfg.design(2,:) = [ones(1,length(dat1)) 2*ones(1,length(dat2)) 3*ones(1,length(dat3))]; indepregT = ft_freqstatistics(cfg,dat1{:},dat2{:},dat3{:}); % Finally get the mixed-effects for Age and WM-load by combining the mask-data from the previous steps mixed_effects.mask = depT1.mask.*depT2.mask.*indepregT.mask; That way I would identify the channelxtimexfrequency data-points showing both an effect of WM-load and Age. Do you think that this would make sense or should I stick to depsamplesregrT and indepsamplesregrT? Best, Fred Frédéric Roux ----- Original Message ----- From: "Eric Maris" To: "FieldTrip discussion list" Sent: Tuesday, November 4, 2014 12:22:12 PM Subject: Re: [FieldTrip] Cluster-based permutation tests for between-subject design Hi Fred, What you ask can definitely be done in Fieldtrip. The analyses you need are very similar to those of Vladimir Litvak, for who I implemented the statfuns indepsamplesRegrT and depsamplesRegrT. To give you the recipe, I would have to go back to the code, because it is such a long time ago. Anyhow, you now know where to look, and I trust that you can get a long way yourself. Best, Eric Maris > -----Original Message----- > From: Frédéric Roux [mailto:f.roux at bcbl.eu] > Sent: dinsdag 4 november 2014 11:59 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > Dear all, > > I would like to follow up on this, as I am currently struggling > myself with the coding of the design matrix of my analysis. > > I have MEG data from n = 95 participants aged between 12 and 27 years > on a WM-task with 3 WM-load conditions. > > I would like to investigate the effects of age (continuous variable > ranging from 12 to 27) and WM-load (categorical variable ranging from > 1-3) on delay-activity in different frequency-bands. > > What would be the correct way to perform such an analysis in > fieldtrip? > > Would this be akin to a mixed-effects design? > > Best regards, > > Fred > > Frédéric Roux > > ----- Original Message ----- > From: "Eric Maris" > To: "FieldTrip discussion list" > Sent: Friday, October 31, 2014 4:56:16 PM > Subject: Re: [FieldTrip] Cluster-based permutation tests for > between-subject design > > > > > > Dear Dylan, > > > > I replied to your question on the Fieldtrip faq page that you refer > to. Although the problem can be solved, it is not implemented yet, > because it requires the implementation of three new statfuns: > Hotelling’s T-square for dependent samples, Hotelling’s T-square for > independent samples, and Wilk’s lambda. A good statistics book (e.g., > Johnson & Wichern) will show you how to do this yourself. Otherwise, > you have to be patient. > > > > Although your statistical problem can be solved, with neurobiological > data, it is almost never wise to statistically test interaction > effects in designs more complicated than the 2-by-2 factorial design. > In these more complicated designs, you always end up with F-tests, > which do not inform you about the pattern in the data that is > responsible for the interaction effect. > > > > Best, > > > > Eric > > > > > > > > > From: Dylan DeLosAngeles [mailto:dylan.delosangeles at gmail.com] > Sent: dinsdag 28 oktober 2014 13:22 > To: FieldTrip discussion list > Subject: Re: [FieldTrip] Cluster-based permutation tests for between- > subject design > > > > > Thank you, Eelke. > I'm sorry I am not picking this up more quickly. > > > > > > Your examples of passing either multiple structs or cell arrays to > ft_freqstatistics deals with one group of subjects in multiple > conditions, or two groups in one condition, respectively. I have two > groups, both doing multiple (11) conditions and I would like to know > how to handle that in ft_freqstatistics. What I require seems to be > similar to what Eric Maris wrote about here: > > > http://fieldtrip.fcdonders.nl/faq/how_can_i_test_an_interaction_effec > t_using_cluster-based_permutation_tests > > > > > > but instead of a 2-by-2 factorial design, I am using a 2-by-11 > factorial design. As such, I am not sure how this translates when > making difference data structures. I hope I am not missing something > obvious. > > > > > > Thanks again, > > > Dylan > > > > > > On Tuesday, 28 October 2014, Eelke Spaak < eelke.spaak at donders.ru.nl > > wrote: > > Dear Dylan, > > You don't want (or need) a single struct with a subj X chan X freq X > time powspctrm. Instead, it is often convenient to collect each > individual subject's struct in a *cell* array (rather than a struct > array). See, for example, here: > http://www.mathworks.nl/help/matlab/cell-arrays.html and here: > http://blogs.mathworks.com/loren/2006/06/21/cell-arrays-and-their- > contents/ > . > > At the statistics step you should pass in multiple structs, each one > corresponding to one unit-of-observation, to ft_freqstatistics. This > can be done like so: > > stat = ft_freqstatistics(cfg, struct11, struct12, > struct13,...struct21, struct22, ...); > > or, using the cell arrays, like so: > > stat = ft_freqstatistics(cfg, groupA{:}, groupB{:}); > > Make sure that each column in your design matrix describes one unit- > of-observation, in the order in which the structs are passed into > ft_freqstatistics. > > Best, > Eelke > > On 21 October 2014 03:41, Dylan DeLosAngeles < > dylan.delosangeles at gmail.com > wrote: > > Dear Eelke, > > > > Thank you for help regarding cluster-based permutation analysis of > two or more conditions. > > > > I am using time-frequency data (not time-lock structures). My first > problem seems to be getting my 12 subjects into the 4D powspectrum. > > > > My code below loads 12 subjects from the first group, but I end up > with a 1 x 12 struct where each struct's .powspctrm is 1 subject x 11 > electrodes x 3 frequencies x 2049 time points, rather than one struct > with a 4D powspctrm with 12 subjects as rows x electrodes x freqs x > time points. > > > > for k = 1:Nmt, % states > > for i = 1%:Ng, % groups > > for j = 1:Ns, % subjects > > > > % load files > > p(j) = eeg3.eeg.load(fullfile(fpath,fname2)); > > > > % convert to eeglab to get channel locations > > EEG(j) = eeg2eeglab( p(j)); > > EEG(j) = pop_chanedit( EEG(j), 'lookup', chanlocfile); > > > > % preprocessing in fieldtrip > > d(j) = eeglab2fieldtrip( EEG(j), 'preprocessing'); > > > > % specify length of time to use in config time = > > EEG(j).xmax-EEG(j).xmin; > > > > % setup configuration for freqanalysis cfg = []; % clear cfg > > cfg.output = 'pow'; cfg.channel = 'EEG'; cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; cfg.foi = 0.5:3; % delta cfg.toi = > 1:0.05:time; > > % length of each state cfg.t_ftimwin = 7./cfg.foi; % 7 cycles > > cfg.keeptrials = 'yes'; > > > > % do freqanalysis > > freqdata(j) = ft_freqanalysis( cfg, d(j)); end end end > > > > My second problem is loading in the second group of 12 subjects and > what that will look like when I run ft_freqstatistics. > > > > Lastly, I just want to confirm what you said in your previous > email, > > that I should be using indepsamplesF for more than two conditions > (I > > have 11), and therefore my design should look like this; > > 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 (two groups) > > 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 (11 conditions) > > > > Any help would be appreciated. > > > > Kind regards, > > Dylan > > > > > > > > > > On Wed, Sep 24, 2014 at 3:29 PM, Eelke Spaak < > eelke.spaak at donders.ru.nl > > wrote: > > Hello Dylan, > > > > You can analyse a between-subjects design exactly as you would a > > between-trials design (at least as far as the statistics step is > > concerned), in both cases the two conditions correspond to two > groups > > of observations, and not to the same group of observations measured > in > > two separate conditions (which would be a within-UO design). In > > FieldTrip, you would typically compute averages per subject, then > use > > an "indepsamplesT" (or indepsamplesF with >2 conditions) statistic > > (not depsamples). indepsamplesT only requires one row in the design > > matrix, indicating the condition. > > > > Note that if you have e.g. timelock structures in two (or more) > cell > > arrays, corresponding to the conditions, you can input them into > the > > statistics function as follows: > > > > stat = ft_timelockstatistics(cfg, tlCondA{:}, tlCondB{:}); > > > > without having to call ft_timelockgrandaverage. In fact, the above > is > > the preferred way to do statistics now. (The same holds for > > ft_freqstatistics.) > > > > Hope that helps, > > Best, > > Eelke > > > > On 24 September 2014 02:32, Dylan DeLosAngeles < > > dylan.delosangeles at gmail.com >> wrote: > >> Hello, > >> > >> So far, the tutorial on "Cluster-based permutation tests on > >> time-frequency data" has been very helpful. > >> > >> Out of the four combinations from the two UO-types (subjects and > >> trials) and the two experimental designs (between- and within-UO), > >> the tutorial covers statistics on data in two conditions in a > >> between-trials, in a within-trials and in a within-subjects > design. > >> However, I am wondering if there is any information about the > fourth type of experiment design: between-subjects. > >> > >> I have data for 2 groups with 12 subjects in each group. Both > groups > >> are measured during 11 conditions. > >> Can I approach this in a similar fashion to within-subjects design > >> (multiple subjects in multiple experimental conditions), such that > my > >> design is multiple groups in multiple experimental conditions. Is > it > >> a case of first averaging over all trials belonging to each of the > >> experimental conditions for each subject (as instructed in > tutorial), > >> and then averaging over all subjects in each group? > >> > >> Configuration code for setting up the design currently looks like > >> this; grp = 2; subj = 11; design = zeros(2, subj*grp); > >> > >> for i = 1:grp > >> design(1,i:2:end) = i; > >> end > >> > >> idx = 1; > >> for i = 1:subj > >> design(2,idx:idx+1) = i; > >> idx = idx+2; > >> end > >> > >> Is there anything else I need to take into consideration when > doing > >> these statistics? > >> > >> Thank you, > >> Dr Dylan DeLosAngeles > >> Research Fellow > >> Brain Signal Laboratory > >> Flinders University > >> > >> _______________________________________________ > >> fieldtrip mailing list > >> fieldtrip at donders.ru.nl > >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From ktyler at swin.edu.au Wed Nov 5 14:50:48 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Wed, 5 Nov 2014 13:50:48 +0000 Subject: [FieldTrip] (no subject) Message-ID: Dear Field trippers, And especially dear Neuromag users, I have been going back over the analysis of my study, ironing out issues, and am finding that I am still having problems with source analysis coming up with some unexpected and probably inaccurate locations for clusters of significant effects. I have decided to go back and look at a simple right handed button push, in one subject, to check if I was able to locate a realistic region in M1. >From the attached jpeg, you will see that the analysis is not accurately locating left hemisphere motor regions. I know I can't expect absolute accuracy, but I would be hoping for more than this. I have included my code (below) and if any one has any suggestions about how to remedy this and produce more accurate results, please let me know!!! I am wondering if I have realigned my mri to the neuromag system correctly, and have attached another jpeg of my volume conduction model, plotted alongside the neuromag sensors. Neuromag users, does this look accurate to you? As a general fix, I was wondering if any neuromag users would be happy to supply their FT code for use of mri, including realignment of mri to the neuromag system, segmentation and the creation of the volume conduction model? As always, any help is much appreciated! Here is the code as I have been currently using it: %% Load MRI mri = ft_read_mri('Subject1.nii'); %% Realigning cfg=[]; cfg.coordsys = 'neuromag'; mri = ft_volumerealign(cfg, mri); %% Segmentation. cfg = []; cfg.coordsys='neuromag'; cfg.units='mm'; seg = ft_volumesegment(cfg, mri); %% Prepare volumne conduction model cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); %% Non warped grid for use in single subject comparison btw conditions cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.vol = vol; sourcemodel = ft_prepare_sourcemodel(cfg); %% Calculates leadfields cfg = []; cfg.grid=sourcemodel; cfg.vol = vol; cfg.channel={'MEGGRAD'};% For Planar gradiometers only cfg.grad=grad;%This needs to be edited to represent the MEG data set which has just been loaded grid = ft_prepare_leadfield(cfg, Condition1); %% Append individuals data from two conditions. %This is so as to create a common filter, from the two conditions. cfg=[]; cfg.appenddim = 'rpt'; combined = ft_appendtimelock(cfg, Condition1, Condition2); %% Calculate covariance and timelock. Input data should NOT have been timelocked before this. cfg = []; cfg.keeptrials = 'yes'; cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; cfg.vartrllength = 2; cfg.channel='MEGGRAD'; tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); tlckavgCombined = ft_timelockanalysis(cfg, combined); %% Create spatial filter using the lcmv beamformer cfg = []; cfg.grid = grid; % leadfield, which has the grid information cfg.grad=grad; cfg.vol = vol; % volume conduction model (headmodel) cfg.keepfilter = 'yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD cfg.channel='MEGGRAD'; sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% %% cfg.grid.filter = sourceCombined.avg.filter; cfg.rawtrial='yes'; sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); %% The cluster stats at source space: %% cfg=[]; cfg.dim=sourceCond1.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.05; cfg.tail = 0; cfg.clusteralpha = 0.005; cfg.minnbchan = 8; cfg.correcttail = 'alpha'; cfg.clusterstatistic = 'maxsum'; Nsub = 84; cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; cfg.ivar = 1; % the 1st row in cfg.design contains the independent variable cfg.uvar = 2; % the 2nd row in cfg.design contains the subject number stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); %% interpolate the t maps to the structural MRI of the subject % cfg = []; cfg.parameter = 'mask'; statplot = ft_sourceinterpolate(cfg,stat, mri); %% plot the t values on the MRI % cfg = []; cfg.method = 'slice'; cfg.funparameter = 'mask'; cfg.maskparameter = 'funparameter'; figure ft_sourceplot(cfg, statplot); %% -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: RH_ButtonPush.jpg Type: image/jpeg Size: 37138 bytes Desc: RH_ButtonPush.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Sensors_Volume.jpg Type: image/jpeg Size: 26947 bytes Desc: Sensors_Volume.jpg URL: From stephen.whitmarsh at gmail.com Wed Nov 5 15:59:09 2014 From: stephen.whitmarsh at gmail.com (Stephen Whitmarsh) Date: Wed, 5 Nov 2014 15:59:09 +0100 Subject: [FieldTrip] (no subject) In-Reply-To: References: Message-ID: Hi Kaelasha, It's hard to evaluate why the localization in not exactly how you would expect it, but here are some idea you could try from the top of my head. Note I never used LCMV beamformer myself, although I've done DICS. Also, to me there seems to be not something obviously *wrong *in the code or pictures, so I'm just suggesting some thoughts here. - Beamformer performance is VERY dependent on the data. Check your sensor level data, clean it more if necessary. - Play around with including more or less data centered around the component you are localizing for both the common filter as the data you localize. Since I don't know the details of the data (nor do i have experience with LCMV) your choices here are hard to evaluate. - Plot the scalp as well to get a better idea whether your co-registration is accurate. If you have additional headpoints e.g. by using a Polhemus, that would help. - Play around with some regularization - in ft_sourceanalysis use e.g.: cfg.alpha = '10%'; - Evaluate your lcmv beamformer with a dipole fit. - Check other subjects/recordings - other recordings might be better (or worse...) Finally, if you haven't already, take a look at the scripts we used in our recent workshop using a Neuromag system (although as I said I see nothing wrong with your script): http://fieldtrip.fcdonders.nl/workshop/stockholm2014q3 The beamformer lecture there given by Robert on Beamforming is also online: http://natmeg.se/wp/activities/natmeg-lectures/ Good luck! Stephen On 5 November 2014 14:50, Kaelasha Tyler wrote: > Dear Field trippers, > And especially dear Neuromag users, > > I have been going back over the analysis of my study, ironing out > issues, and am finding that I am still having problems with source analysis > coming up with some unexpected and probably inaccurate locations for > clusters of significant effects. > > I have decided to go back and look at a simple right handed button push, > in one subject, to check if I was able to locate a realistic region in M1. > > From the attached jpeg, you will see that the analysis is not accurately > locating left hemisphere motor regions. I know I can't expect absolute > accuracy, but I would be hoping for more than this. > > I have included my code (below) and if any one has any suggestions about > how to remedy this and produce more accurate results, please let me know!!! > > I am wondering if I have realigned my mri to the neuromag system > correctly, and have attached another jpeg of my volume conduction model, > plotted alongside the neuromag sensors. > > Neuromag users, does this look accurate to you? > > As a general fix, I was wondering if any neuromag users would be happy > to supply their FT code for use of mri, including realignment of mri to the > neuromag system, segmentation and the creation of the volume conduction > model? > > As always, any help is much appreciated! > > Here is the code as I have been currently using it: > > %% Load MRI > > mri = ft_read_mri('Subject1.nii'); > > %% Realigning > cfg=[]; > cfg.coordsys = 'neuromag'; > mri = ft_volumerealign(cfg, mri); > > %% Segmentation. > > cfg = []; > cfg.coordsys='neuromag'; > cfg.units='mm'; > seg = ft_volumesegment(cfg, mri); > > %% Prepare volumne conduction model > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > %% Non warped grid for use in single subject comparison btw conditions > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.vol = vol; > sourcemodel = ft_prepare_sourcemodel(cfg); > > %% Calculates leadfields > > cfg = []; > cfg.grid=sourcemodel; > cfg.vol = vol; > cfg.channel={'MEGGRAD'};% For Planar gradiometers only > cfg.grad=grad;%This needs to be edited to represent the MEG data set which > has just been loaded > grid = ft_prepare_leadfield(cfg, Condition1); > > %% Append individuals data from two conditions. > %This is so as to create a common filter, from the two conditions. > cfg=[]; > cfg.appenddim = 'rpt'; > combined = ft_appendtimelock(cfg, Condition1, Condition2); > > %% Calculate covariance and timelock. Input data should NOT have been > timelocked before this. > > cfg = []; > cfg.keeptrials = 'yes'; > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > cfg.vartrllength = 2; > cfg.channel='MEGGRAD'; > tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); > tlckavgCombined = ft_timelockanalysis(cfg, combined); > > %% Create spatial filter using the lcmv beamformer > cfg = []; > cfg.grid = grid; % leadfield, which has the grid information > cfg.grad=grad; > cfg.vol = vol; % volume conduction model (headmodel) > cfg.keepfilter = 'yes'; > cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD > cfg.channel='MEGGRAD'; > sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% > %% > cfg.grid.filter = sourceCombined.avg.filter; > cfg.rawtrial='yes'; > sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); > > %% The cluster stats at source space: > > %% > cfg=[]; > cfg.dim=sourceCond1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.05; > cfg.tail = 0; > cfg.clusteralpha = 0.005; > cfg.minnbchan = 8; > cfg.correcttail = 'alpha'; > cfg.clusterstatistic = 'maxsum'; > Nsub = 84; > cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > cfg.ivar = 1; % the 1st row in cfg.design contains the > independent variable > cfg.uvar = 2; % the 2nd row in cfg.design contains the > subject number > > stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); > > %% interpolate the t maps to the structural MRI of the subject % > cfg = []; > cfg.parameter = 'mask'; > statplot = ft_sourceinterpolate(cfg,stat, mri); > %% plot the t values on the MRI % > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'mask'; > cfg.maskparameter = 'funparameter'; > figure > ft_sourceplot(cfg, statplot); > %% > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joramvandriel at gmail.com Wed Nov 5 16:15:31 2014 From: joramvandriel at gmail.com (Joram van Driel) Date: Wed, 5 Nov 2014 16:15:31 +0100 Subject: [FieldTrip] (no subject) In-Reply-To: References: Message-ID: Dear Kaelasha, I recently came across the exact same problem in my Neuromag source analysis: mislocalization of motor beta over M1 (it was too posterior in my case). I used LCMV, so my analyses are quite similar to yours. Do you use the Elekta Maxfilter routine of *tSSS *(a preprocessing step to remove non-brain noise)? There, I had the option *-trans* enabled, which transforms the sensor data of every subject to a common space, so that subjects become better comparable *in sensor space*. But this should not be used if you do source analysis, because the forward model uses the coregistered MRI, taking into account how that subject was positioned in the scanner. When I redid tSSS without the -trans option, and recomputed the forward model, motor beta suppression was right where it should be. As for the coregistration, we used a polhemus point method of digitized 3D points, which allows for continuous tracking of head position in the Elekta scanner. With those points, there are built-in ways to coregister the MRI using the Elekta software (somebody else helped me with that, so I don't know the details how to do this). With the coregistered MRIs, I just followed the fieldtrip tutorial up to ft_prepare_leadfield, and everything went fine. Best, Joram On Wed, Nov 5, 2014 at 2:50 PM, Kaelasha Tyler wrote: > Dear Field trippers, > And especially dear Neuromag users, > > I have been going back over the analysis of my study, ironing out > issues, and am finding that I am still having problems with source analysis > coming up with some unexpected and probably inaccurate locations for > clusters of significant effects. > > I have decided to go back and look at a simple right handed button push, > in one subject, to check if I was able to locate a realistic region in M1. > > From the attached jpeg, you will see that the analysis is not accurately > locating left hemisphere motor regions. I know I can't expect absolute > accuracy, but I would be hoping for more than this. > > I have included my code (below) and if any one has any suggestions about > how to remedy this and produce more accurate results, please let me know!!! > > I am wondering if I have realigned my mri to the neuromag system > correctly, and have attached another jpeg of my volume conduction model, > plotted alongside the neuromag sensors. > > Neuromag users, does this look accurate to you? > > As a general fix, I was wondering if any neuromag users would be happy > to supply their FT code for use of mri, including realignment of mri to the > neuromag system, segmentation and the creation of the volume conduction > model? > > As always, any help is much appreciated! > > Here is the code as I have been currently using it: > > %% Load MRI > > mri = ft_read_mri('Subject1.nii'); > > %% Realigning > cfg=[]; > cfg.coordsys = 'neuromag'; > mri = ft_volumerealign(cfg, mri); > > %% Segmentation. > > cfg = []; > cfg.coordsys='neuromag'; > cfg.units='mm'; > seg = ft_volumesegment(cfg, mri); > > %% Prepare volumne conduction model > > cfg = []; > cfg.method = 'singleshell'; > vol = ft_prepare_headmodel(cfg, seg); > > %% Non warped grid for use in single subject comparison btw conditions > cfg = []; > cfg.grid.xgrid = -20:1:20; > cfg.grid.ygrid = -20:1:20; > cfg.grid.zgrid = -20:1:20; > cfg.grid.unit = 'cm'; > cfg.grid.tight = 'yes'; > cfg.vol = vol; > sourcemodel = ft_prepare_sourcemodel(cfg); > > %% Calculates leadfields > > cfg = []; > cfg.grid=sourcemodel; > cfg.vol = vol; > cfg.channel={'MEGGRAD'};% For Planar gradiometers only > cfg.grad=grad;%This needs to be edited to represent the MEG data set which > has just been loaded > grid = ft_prepare_leadfield(cfg, Condition1); > > %% Append individuals data from two conditions. > %This is so as to create a common filter, from the two conditions. > cfg=[]; > cfg.appenddim = 'rpt'; > combined = ft_appendtimelock(cfg, Condition1, Condition2); > > %% Calculate covariance and timelock. Input data should NOT have been > timelocked before this. > > cfg = []; > cfg.keeptrials = 'yes'; > cfg.covariance = 'yes'; > cfg.covariancewindow = 'all'; > cfg.vartrllength = 2; > cfg.channel='MEGGRAD'; > tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); > tlckavgCombined = ft_timelockanalysis(cfg, combined); > > %% Create spatial filter using the lcmv beamformer > cfg = []; > cfg.grid = grid; % leadfield, which has the grid information > cfg.grad=grad; > cfg.vol = vol; % volume conduction model (headmodel) > cfg.keepfilter = 'yes'; > cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD > cfg.channel='MEGGRAD'; > sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% > %% > cfg.grid.filter = sourceCombined.avg.filter; > cfg.rawtrial='yes'; > sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); > > %% The cluster stats at source space: > > %% > cfg=[]; > cfg.dim=sourceCond1.dim; > cfg.method = 'montecarlo'; > cfg.statistic = 'depsamplesT'; > cfg.parameter = 'pow'; > cfg.correctm = 'cluster'; > cfg.numrandomization = 1000; > cfg.alpha = 0.05; > cfg.tail = 0; > cfg.clusteralpha = 0.005; > cfg.minnbchan = 8; > cfg.correcttail = 'alpha'; > cfg.clusterstatistic = 'maxsum'; > Nsub = 84; > cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; > cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; > cfg.ivar = 1; % the 1st row in cfg.design contains the > independent variable > cfg.uvar = 2; % the 2nd row in cfg.design contains the > subject number > > stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); > > %% interpolate the t maps to the structural MRI of the subject % > cfg = []; > cfg.parameter = 'mask'; > statplot = ft_sourceinterpolate(cfg,stat, mri); > %% plot the t values on the MRI % > > cfg = []; > cfg.method = 'slice'; > cfg.funparameter = 'mask'; > cfg.maskparameter = 'funparameter'; > figure > ft_sourceplot(cfg, statplot); > %% > > > > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.oostenveld at donders.ru.nl Wed Nov 5 19:30:29 2014 From: r.oostenveld at donders.ru.nl (Robert Oostenveld) Date: Wed, 5 Nov 2014 19:30:29 +0100 Subject: [FieldTrip] Timestamp format using ft_spike functions In-Reply-To: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> References: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> Message-ID: Hi Dominic, Timestamps are encoded in the original representation of the corresponding acquisition system. For Plexon that means that they are at 40kHz, for Neuralynx they are approximately 1MHz. This allows the different types of data acquired with the system (spikes, LFP, events) to be synchronized. best regards, Robert On 31 Oct 2014, at 16:47, Dominic Depke wrote: > Dear all, > > I have a question regarding the data structure of spikedata. > Especially I would like to ask how timestamps are encoded in the spike.timestamp structure (which timecode format e.g. clockticks, micro/mili/seconds) for further analysis in fieldtrip. > > > Thanks and best wishes, > Dominic > > _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > Dominic Depke, M.Sc. > PhD student > Institut für Physiologie I > Robert-Koch-Straße 27a > DE-48149 Münster > Tel. : +49 251-83-58112 > Email: depke at uni-muenster.de > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From eh776 at york.ac.uk Wed Nov 5 21:55:25 2014 From: eh776 at york.ac.uk (Emma Holmes) Date: Wed, 5 Nov 2014 20:55:25 +0000 Subject: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: Hi Stan, Thanks for the suggestion. However, the same error also occurs when i use cfg.parameter = 'avg.pow'. I wonder if anyone else has encountered problems when inputting data to ft_sourcegrandaverag and might be able to help me? Or if anyone has encountered the following error before or knows why it might be occurring? ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Best, Emma Date: Mon, 3 Nov 2014 16:54:15 +0100 (CET) From: "Stan van Pelt" To: "'FieldTrip discussion list'" Subject: Re: [FieldTrip] Spatio-temporal cluster-based permutation analysis on EEG sources Message-ID: <07bb01cff77e$6b7a9790$ 426fc6b0$@vanpelt at fcdonders.ru.nl> Content-Type: text/plain; charset="utf-8" Hi Emma, I am unfamiliar with this type of error. It seems however that you still have an inconsistency in your data. You define ?data{i}.avg.pow?, but later on use ?cfg.parameter = 'pow';?. You should change one of the two (e.g. use cfg.parameter = 'avg.pow';) Hope that helps. Stan From: Emma Holmes [mailto:eh776 at york.ac.uk] Sent: maandag 3 november 2014 14:02 To: fieldtrip at science.ru.nl Cc: s.vanpelt at fcdonders.ru.nl Subject: Spatio-temporal cluster-based permutation analysis on EEG sources Hi Stan, Thanks for the suggestion. When I try that, I get the following error ??? Error using ==> ft_datatype_source at 173 unsupported version "upcoming" for source datatype Error in ==> ft_sourcegrandaverage at 82 varargin{i} = ft_datatype_source(varargin{i}, 'version', 'upcoming'); I am unsure why this occurs. My data is now structured in the following way: data = <20x1 cell> % one cell array for each participant, n=20 data{i}.pos = [902629x3 double] % x,y,z positions data{i}.dim = [91 109 91] data{i}.time = [1 x 11 double] % vector of time points data{i}.avg.pow = [902629 x 11 double] % source estimates The following is the method I use: cfg = []; cfg.keepindividual = 'yes'; cfg.parameter = 'pow'; grandavgA = ft_sourcegrandaverage(cfg, data{:}); Best, Emma -------------- next part -------------- An HTML attachment was scrubbed... URL: From ktyler at swin.edu.au Thu Nov 6 06:20:31 2014 From: ktyler at swin.edu.au (Kaelasha Tyler) Date: Thu, 6 Nov 2014 05:20:31 +0000 Subject: [FieldTrip] (no subject) In-Reply-To: References: , Message-ID: Hi all, Some great suggestions and resources here. I'll try a few of these suggestions out and get back to the post with results. Cheers, Kaelasha ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Joram van Driel [joramvandriel at gmail.com] Sent: Thursday, 6 November 2014 2:15 AM To: FieldTrip discussion list Subject: Re: [FieldTrip] (no subject) Dear Kaelasha, I recently came across the exact same problem in my Neuromag source analysis: mislocalization of motor beta over M1 (it was too posterior in my case). I used LCMV, so my analyses are quite similar to yours. Do you use the Elekta Maxfilter routine of tSSS (a preprocessing step to remove non-brain noise)? There, I had the option -trans enabled, which transforms the sensor data of every subject to a common space, so that subjects become better comparable in sensor space. But this should not be used if you do source analysis, because the forward model uses the coregistered MRI, taking into account how that subject was positioned in the scanner. When I redid tSSS without the -trans option, and recomputed the forward model, motor beta suppression was right where it should be. As for the coregistration, we used a polhemus point method of digitized 3D points, which allows for continuous tracking of head position in the Elekta scanner. With those points, there are built-in ways to coregister the MRI using the Elekta software (somebody else helped me with that, so I don't know the details how to do this). With the coregistered MRIs, I just followed the fieldtrip tutorial up to ft_prepare_leadfield, and everything went fine. Best, Joram Thursday, 6 November 2014 2:14 AM Hi Kaelasha, It's hard to evaluate why the localization in not exactly how you would expect it, but here are some idea you could try from the top of my head. Note I never used LCMV beamformer myself, although I've done DICS. Also, to me there seems to be not something obviously wrong in the code or pictures, so I'm just suggesting some thoughts here. - Beamformer performance is VERY dependent on the data. Check your sensor level data, clean it more if necessary. - Play around with including more or less data centered around the component you are localizing for both the common filter as the data you localize. Since I don't know the details of the data (nor do i have experience with LCMV) your choices here are hard to evaluate. - Plot the scalp as well to get a better idea whether your co-registration is accurate. If you have additional headpoints e.g. by using a Polhemus, that would help. - Play around with some regularization - in ft_sourceanalysis use e.g.: cfg.alpha = '10%'; - Evaluate your lcmv beamformer with a dipole fit. - Check other subjects/recordings - other recordings might be better (or worse...) Finally, if you haven't already, take a look at the scripts we used in our recent workshop using a Neuromag system (although as I said I see nothing wrong with your script): http://fieldtrip.fcdonders.nl/workshop/stockholm2014q3 The beamformer lecture there given by Robert on Beamforming is also online: http://natmeg.se/wp/activities/natmeg-lectures/ Good luck! Stephen On Wed, Nov 5, 2014 at 2:50 PM, Kaelasha Tyler > wrote: Dear Field trippers, And especially dear Neuromag users, I have been going back over the analysis of my study, ironing out issues, and am finding that I am still having problems with source analysis coming up with some unexpected and probably inaccurate locations for clusters of significant effects. I have decided to go back and look at a simple right handed button push, in one subject, to check if I was able to locate a realistic region in M1. >From the attached jpeg, you will see that the analysis is not accurately locating left hemisphere motor regions. I know I can't expect absolute accuracy, but I would be hoping for more than this. I have included my code (below) and if any one has any suggestions about how to remedy this and produce more accurate results, please let me know!!! I am wondering if I have realigned my mri to the neuromag system correctly, and have attached another jpeg of my volume conduction model, plotted alongside the neuromag sensors. Neuromag users, does this look accurate to you? As a general fix, I was wondering if any neuromag users would be happy to supply their FT code for use of mri, including realignment of mri to the neuromag system, segmentation and the creation of the volume conduction model? As always, any help is much appreciated! Here is the code as I have been currently using it: %% Load MRI mri = ft_read_mri('Subject1.nii'); %% Realigning cfg=[]; cfg.coordsys = 'neuromag'; mri = ft_volumerealign(cfg, mri); %% Segmentation. cfg = []; cfg.coordsys='neuromag'; cfg.units='mm'; seg = ft_volumesegment(cfg, mri); %% Prepare volumne conduction model cfg = []; cfg.method = 'singleshell'; vol = ft_prepare_headmodel(cfg, seg); %% Non warped grid for use in single subject comparison btw conditions cfg = []; cfg.grid.xgrid = -20:1:20; cfg.grid.ygrid = -20:1:20; cfg.grid.zgrid = -20:1:20; cfg.grid.unit = 'cm'; cfg.grid.tight = 'yes'; cfg.vol = vol; sourcemodel = ft_prepare_sourcemodel(cfg); %% Calculates leadfields cfg = []; cfg.grid=sourcemodel; cfg.vol = vol; cfg.channel={'MEGGRAD'};% For Planar gradiometers only cfg.grad=grad;%This needs to be edited to represent the MEG data set which has just been loaded grid = ft_prepare_leadfield(cfg, Condition1); %% Append individuals data from two conditions. %This is so as to create a common filter, from the two conditions. cfg=[]; cfg.appenddim = 'rpt'; combined = ft_appendtimelock(cfg, Condition1, Condition2); %% Calculate covariance and timelock. Input data should NOT have been timelocked before this. cfg = []; cfg.keeptrials = 'yes'; cfg.covariance = 'yes'; cfg.covariancewindow = 'all'; cfg.vartrllength = 2; cfg.channel='MEGGRAD'; tlckavgCond1 = ft_timelockanalysis(cfg, Condition1); tlckavgCombined = ft_timelockanalysis(cfg, combined); %% Create spatial filter using the lcmv beamformer cfg = []; cfg.grid = grid; % leadfield, which has the grid information cfg.grad=grad; cfg.vol = vol; % volume conduction model (headmodel) cfg.keepfilter = 'yes'; cfg.lcmv.fixedori = 'yes'; % project on axis of most variance using SVD cfg.channel='MEGGRAD'; sourceCombined = ft_sourceanalysis(cfg, tlckavgCombined);% %% cfg.grid.filter = sourceCombined.avg.filter; cfg.rawtrial='yes'; sourceCond1=ft_sourceanalysis(cfg, tlckavgCond1); %% The cluster stats at source space: %% cfg=[]; cfg.dim=sourceCond1.dim; cfg.method = 'montecarlo'; cfg.statistic = 'depsamplesT'; cfg.parameter = 'pow'; cfg.correctm = 'cluster'; cfg.numrandomization = 1000; cfg.alpha = 0.05; cfg.tail = 0; cfg.clusteralpha = 0.005; cfg.minnbchan = 8; cfg.correcttail = 'alpha'; cfg.clusterstatistic = 'maxsum'; Nsub = 84; cfg.design(1,1:2*Nsub) = [ones(1,Nsub) 2*ones(1,Nsub)]; cfg.design(2,1:2*Nsub) = [1:Nsub 1:Nsub]; cfg.ivar = 1; % the 1st row in cfg.design contains the independent variable cfg.uvar = 2; % the 2nd row in cfg.design contains the subject number stat = ft_sourcestatistics(cfg, sourceCond1, sourceCond2); %% interpolate the t maps to the structural MRI of the subject % cfg = []; cfg.parameter = 'mask'; statplot = ft_sourceinterpolate(cfg,stat, mri); %% plot the t values on the MRI % cfg = []; cfg.method = 'slice'; cfg.funparameter = 'mask'; cfg.maskparameter = 'funparameter'; figure ft_sourceplot(cfg, statplot); %% _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- Joram van Driel, MSc. PhD student @ University of Amsterdam Brain & Cognition @ Department of Psychology -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominic.depke at ruhr-uni-bochum.de Thu Nov 6 13:57:47 2014 From: dominic.depke at ruhr-uni-bochum.de (Dominic Depke) Date: Thu, 6 Nov 2014 13:57:47 +0100 Subject: [FieldTrip] Timestamp format using ft_spike functions In-Reply-To: References: <0d0f01cff521$ffe1d5b0$ffa58110$@ruhr-uni-bochum.de> Message-ID: <005401cff9c1$43aba340$cb02e9c0$@ruhr-uni-bochum.de> Hi Robert, Thanks for your answer. Actually I’m working with a dataformat which is currently not supported (Sonfiles, .smr), but it is possible to access and export the data in various timeformats (including clockticks, microseconds etc.) using functions from the SON-library provided by SigTOOL. Now I would like to know whether I can simply create my own raw data structure for further analysis using functions from the spike-toolbox or do ft_spike functions still deal with different timecode-formats once the raw data has been read into memory (so how should the (raw) spike data be represented if no fileformat is specified)? Here’s just an example of my import procedure: fid = fopen(‘filename.smr'); %open file and return filehandle info_tmp = SONChanList(fid); %get channelinformation spike = []; kind = reshape({info_tmp.kind},size({info_tmp.kind},2),1); %find units and LFP if any(cell2mat(kind(:)) == 6) == 0 error('no spike channels detected') end %find indices and names of spikechannels %kind = 1 -> waveform, kind = 6 -> wavemark (spikes) [wvmk] = find((cell2mat({info_tmp.kind})) == 6); %get index of wavemarkchannels spikechan = [info_tmp(wvmk)]; spike.label = reshape({spikechan.title},size({spikechan.title},2),1); sident = [spikechan.number]; %import channeldata for i = 1:length(sident) n = sident(i); tmp = [SONGetChannel(fid,n,'ticks')]; %export as clockticks spike.timestamp{1,i} = reshape([tmp.timings],1,size([tmp.timings],1)); %index (clockticks) of first spike-sample spike.waveform{1,i}(1,:,:) = double(tmp.adc)*1/6553.6; %10 V range; 16 bit int units to double (1x 32 datapoints per sike x timestamps) %create channelheader: %samplinginterval in Hz spike.hdr.Fs{1,i} = 1/(SONGetSampleInterval(fid,sident)*1e-6); spike.hdr.label{1,i} = {spikechan.title(i)}; end So in this case spikes are just represented by their clocktick-indices as well as the rest of the data. Since I know the sampling rate and the index of the first spike-datapoint (which would be similar to the timestamppersample field in the tutorials) it should be easy to synchronize them with the continuous LFP data. I assume that all the required fields are present in my spike structure but I am unsure about how fieldtrip functions deal with my timestamp representation. Thanks and best regards, Dominic Von: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] Im Auftrag von Robert Oostenveld Gesendet: Mittwoch, 5. November 2014 19:30 An: FieldTrip discussion list Betreff: Re: [FieldTrip] Timestamp format using ft_spike functions Hi Dominic, Timestamps are encoded in the original representation of the corresponding acquisition system. For Plexon that means that they are at 40kHz, for Neuralynx they are approximately 1MHz. This allows the different types of data acquired with the system (spikes, LFP, events) to be synchronized. best regards, Robert On 31 Oct 2014, at 16:47, Dominic Depke wrote: Dear all, I have a question regarding the data structure of spikedata. Especially I would like to ask how timestamps are encoded in the spike.timestamp structure (which timecode format e.g. clockticks, micro/mili/seconds) for further analysis in fieldtrip. Thanks and best wishes, Dominic _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Dominic Depke, M.Sc. PhD student Institut für Physiologie I Robert-Koch-Straße 27a DE-48149 Münster Tel. : +49 251-83-58112 Email: depke at uni-muenster.de _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From longjinyi at gmail.com Fri Nov 7 00:23:47 2014 From: longjinyi at gmail.com (Jinyi Long) Date: Thu, 6 Nov 2014 18:23:47 -0500 Subject: [FieldTrip] power-frequency figure Message-ID: Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! Best, Jinyi -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 7 07:33:13 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 7 Nov 2014 07:33:13 +0100 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: Message-ID: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Dear Jinyi, You can use ft_singleplotER to plot the power spectrum of a single channel. If you are interested in the same but for multiple channels than use ft_multiplotER. Finally if you are interested in the topography of a particular frequency you'd specify it in cfg.xlim=[begin end] and call ft_topoplotER. Good luck Tzvetan > Am 07.11.2014 um 00:23 schrieb Jinyi Long : > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! > > Best, > Jinyi > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From wangpele at gmail.com Fri Nov 7 08:12:30 2014 From: wangpele at gmail.com (Wang Jing) Date: Fri, 7 Nov 2014 15:12:30 +0800 Subject: [FieldTrip] Newbie question on WPLI Message-ID: Hi, I am a newbie in FieldTrip. I want to calculate wpli (weighted phase lag index) of two time series, e.g. EEG collected from C3 and C4. The data are ASCII format. Could you indicate me how to proceed? Thanks a lot! Regards, Wang Jing -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 7 09:27:39 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 7 Nov 2014 09:27:39 +0100 Subject: [FieldTrip] Newbie question on WPLI In-Reply-To: References: Message-ID: Dear Wang Jing, one way to get you started would be: 1.Read the ascii delimited data into matlab: http://www.mathworks.de/help/matlab/ref/dlmread.html 2.Create a data structure FieldTrip can deal with. Something along this lines: tmpdat.label={'C3' ;'C4'};% subfield with your labels fsample=1000; % for a sampling rate of 1000 this would be one second tmpdat.time = {nan(1,1000)};% create your time vector tmpdat.time{1}=(1:1:1000);% fill the time vector tmpdat.trial = {nan(2,length(tmpdat.time{1}))}; 3. Fill the NaN fields with your data from step 1. Good luck tzvetan > Hi, > > I am a newbie in FieldTrip. I want to calculate wpli (weighted phase lag index) of two time series, e.g. EEG collected from C3 and C4. The data are ASCII format. Could you indicate me how to proceed? Thanks a lot! > > Regards, > Wang Jing > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From longjinyi at gmail.com Fri Nov 7 14:24:18 2014 From: longjinyi at gmail.com (Jinyi Long) Date: Fri, 7 Nov 2014 08:24:18 -0500 Subject: [FieldTrip] power-frequency figure In-Reply-To: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Message-ID: Dear Tzvetan, Thanks for your help. First, to plot the spectral power for one channel with the 'ft_singleplotER', how can I calculate the power spectrum with 'ft_freqanalsis'? Can I use the following code to calculate and plot power spectrum? Thanks a lot! Best, Jinyi %% frequency analysis cfg = []; cfg.output = 'pow';%'fourier';% % cfg.channel = 'MEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0.5:0.05:4; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, data); %% visualize cfg = []; cfg.baseline = [-0.9 -0.1]; cfg.baselinetype = 'absolute'; cfg.maskstyle = 'saturation'; cfg.zlim = [-3e-7 3e-7]; % cfg.channel = '26'; figure ft_singleplotER(cfg, TFRhann) 2014-11-07 1:33 GMT-05:00 Tzvetan Popov : > Dear Jinyi, > You can use ft_singleplotER to plot the power spectrum of a single > channel. If you are interested in the same but for multiple channels than > use ft_multiplotER. Finally if you are interested in the topography of a > particular frequency you'd specify it in cfg.xlim=[begin end] and call > ft_topoplotER. > Good luck > Tzvetan > > > > > Am 07.11.2014 um 00:23 schrieb Jinyi Long : > > > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. > When I perform the frequency analysis with the function of > 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D > time-frequency figure at single channel? Thanks! > > > > Best, > > Jinyi > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Fri Nov 7 14:55:01 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Fri, 7 Nov 2014 13:55:01 +0000 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de>, Message-ID: Hi Jinyi, The name of the function gives you a clue on what function to use for plotting. ft_singleplotER vs. ft_singleplotTFR. ER for event-related potentials/fields, and TFR = time frequency data. Please take a look at this tutorial, all the questions you have asked can be found here: http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysishttp://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis Nietzsche ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Jinyi Long [longjinyi at gmail.com] Sent: 07 November 2014 14:24 To: FieldTrip discussion list Subject: Re: [FieldTrip] power-frequency figure Dear Tzvetan, Thanks for your help. First, to plot the spectral power for one channel with the 'ft_singleplotER', how can I calculate the power spectrum with 'ft_freqanalsis'? Can I use the following code to calculate and plot power spectrum? Thanks a lot! Best, Jinyi %% frequency analysis cfg = []; cfg.output = 'pow';%'fourier';% % cfg.channel = 'MEG'; cfg.method = 'mtmconvol'; cfg.taper = 'hanning'; cfg.foi = 2:1:40; % analysis 2 to 30 Hz in steps of 2 Hz cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec cfg.toi = -0.5:0.05:4; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) TFRhann = ft_freqanalysis(cfg, data); %% visualize cfg = []; cfg.baseline = [-0.9 -0.1]; cfg.baselinetype = 'absolute'; cfg.maskstyle = 'saturation'; cfg.zlim = [-3e-7 3e-7]; % cfg.channel = '26'; figure ft_singleplotER(cfg, TFRhann) 2014-11-07 1:33 GMT-05:00 Tzvetan Popov >: Dear Jinyi, You can use ft_singleplotER to plot the power spectrum of a single channel. If you are interested in the same but for multiple channels than use ft_multiplotER. Finally if you are interested in the topography of a particular frequency you'd specify it in cfg.xlim=[begin end] and call ft_topoplotER. Good luck Tzvetan > Am 07.11.2014 um 00:23 schrieb Jinyi Long >: > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! > > Best, > Jinyi > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 7 14:56:41 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 7 Nov 2014 14:56:41 +0100 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Message-ID: Dear Jinyi, what you’re referring to is time-frequency analysis. From your e-mail I assumed that you’ve already performed frequency analysis, yet apparently not. You can compute the power spectrum bei using something like this: cfg = []; cfg.output = 'pow'; cfg.method = 'mtmfft'; cfg.taper = 'dpss'; cfg.foilim = [1 20]; cfg.tapsmofrq = 2; fft_data= ft_freqanalysis(cfg,data); Subsequently you can plot fft_data with the functions I mentioned in my previous e-mail. Note that we have also a video lectures section where you can get some detailed insight into frequency domain analysis. Please have a look here: http://fieldtrip.fcdonders.nl/video and also here https://www.youtube.com/watch?v=QLvsa1r1Voc best tzvetan > Dear Tzvetan, Thanks for your help. First, to plot the spectral power for one channel with the 'ft_singleplotER', how can I calculate the power spectrum with 'ft_freqanalsis'? Can I use the following code to calculate and plot power spectrum? Thanks a lot! > > Best, > Jinyi > > > %% frequency analysis > cfg = []; > cfg.output = 'pow';%'fourier';% > % cfg.channel = 'MEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 2:1:40; % analysis 2 to 30 Hz in steps of 2 Hz > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time window = 0.5 sec > cfg.toi = -0.5:0.05:4; % time window "slides" from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > TFRhann = ft_freqanalysis(cfg, data); > %% visualize > cfg = []; > cfg.baseline = [-0.9 -0.1]; > cfg.baselinetype = 'absolute'; > cfg.maskstyle = 'saturation'; > cfg.zlim = [-3e-7 3e-7]; % > cfg.channel = '26'; > figure > ft_singleplotER(cfg, TFRhann) > > > > > 2014-11-07 1:33 GMT-05:00 Tzvetan Popov : > Dear Jinyi, > You can use ft_singleplotER to plot the power spectrum of a single channel. If you are interested in the same but for multiple channels than use ft_multiplotER. Finally if you are interested in the topography of a particular frequency you'd specify it in cfg.xlim=[begin end] and call ft_topoplotER. > Good luck > Tzvetan > > > > > Am 07.11.2014 um 00:23 schrieb Jinyi Long : > > > > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. When I perform the frequency analysis with the function of 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D time-frequency figure at single channel? Thanks! > > > > Best, > > Jinyi > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From longjinyi at gmail.com Fri Nov 7 16:13:15 2014 From: longjinyi at gmail.com (Jinyi Long) Date: Fri, 7 Nov 2014 10:13:15 -0500 Subject: [FieldTrip] power-frequency figure In-Reply-To: References: <8BF814B2-128C-4B30-B8BB-DF4D0D8137DE@uni-konstanz.de> Message-ID: Thanks Tzvetan. 2014-11-07 8:56 GMT-05:00 Tzvetan Popov : > Dear Jinyi, > what you’re referring to is time-frequency analysis. From your e-mail I > assumed that you’ve already performed frequency analysis, yet apparently > not. You can compute the power spectrum bei using something like this: > > cfg = []; > cfg.output = 'pow'; > cfg.method = 'mtmfft'; > cfg.taper = 'dpss'; > cfg.foilim = [1 20]; > cfg.tapsmofrq = 2; > fft_data= ft_freqanalysis(cfg,data); > > Subsequently you can plot fft_data with the functions I mentioned in my > previous e-mail. > Note that we have also a video lectures section where you can get some > detailed insight into frequency domain analysis. Please have a look here: > http://fieldtrip.fcdonders.nl/video > and also here > https://www.youtube.com/watch?v=QLvsa1r1Voc > > > best > tzvetan > > Dear Tzvetan, Thanks for your help. First, to plot the spectral power for > one channel with the 'ft_singleplotER', how can I calculate the power > spectrum with 'ft_freqanalsis'? Can I use the following code to calculate > and plot power spectrum? Thanks a lot! > > Best, > Jinyi > > > %% frequency analysis > cfg = []; > cfg.output = 'pow';%'fourier';% > % cfg.channel = 'MEG'; > cfg.method = 'mtmconvol'; > cfg.taper = 'hanning'; > cfg.foi = 2:1:40; % analysis 2 to 30 Hz > in steps of 2 Hz > cfg.t_ftimwin = ones(length(cfg.foi),1).*0.5; % length of time > window = 0.5 sec > cfg.toi = -0.5:0.05:4; % time window "slides" > from -0.5 to 1.5 sec in steps of 0.05 sec (50 ms) > TFRhann = ft_freqanalysis(cfg, data); > %% visualize > cfg = []; > cfg.baseline = [-0.9 -0.1]; > cfg.baselinetype = 'absolute'; > cfg.maskstyle = 'saturation'; > cfg.zlim = [-3e-7 3e-7]; % > cfg.channel = '26'; > figure > ft_singleplotER(cfg, TFRhann) > > > > > 2014-11-07 1:33 GMT-05:00 Tzvetan Popov : > >> Dear Jinyi, >> You can use ft_singleplotER to plot the power spectrum of a single >> channel. If you are interested in the same but for multiple channels than >> use ft_multiplotER. Finally if you are interested in the topography of a >> particular frequency you'd specify it in cfg.xlim=[begin end] and call >> ft_topoplotER. >> Good luck >> Tzvetan >> >> >> >> > Am 07.11.2014 um 00:23 schrieb Jinyi Long : >> > >> > Dear Sir/Madam, Thanks for your powerful tool. Now I have one question. >> When I perform the frequency analysis with the function of >> 'ft_freqanalaysis', how can I plot the power-frequency figure but not 2D >> time-frequency figure at single channel? Thanks! >> > >> > Best, >> > Jinyi >> > _______________________________________________ >> > fieldtrip mailing list >> > fieldtrip at donders.ru.nl >> > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip >> > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.heldmann at neuro.uni-luebeck.de Fri Nov 7 17:51:02 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Fri, 7 Nov 2014 17:51:02 +0100 Subject: [FieldTrip] strange time frequency results after converting data with eeglab2fieldtrip Message-ID: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> I preprocessed my data (6 channels, 1Kz, minimum 97 trial/condition) with eeglab. Since I’d like to perform the time frequency analysis with field trip, I converted the data to field trip using the eegalb2fieldtrip function. However, after the conversion I’ve got very strange results, meaning that for most of the frequencies I get zeros or NaNs. I am wondering, if I have to change something in the file structure. Does anybody has an idea what’s wrong? Thanx for any help or hints, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 From rmontefusco at med.uchile.cl Fri Nov 7 21:13:54 2014 From: rmontefusco at med.uchile.cl (Rodrigo Montefusco) Date: Fri, 7 Nov 2014 15:13:54 -0500 Subject: [FieldTrip] strange time frequency results after converting data with eeglab2fieldtrip In-Reply-To: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> References: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> Message-ID: It's hard to say at what level is the problem, for me works perfect. Can you check your data using ft_databrowser([],data) before the spectral decomposition? Can you copy how your data structure looks like? Best On Fri, Nov 7, 2014 at 11:51 AM, Marcus Heldmann < marcus.heldmann at neuro.uni-luebeck.de> wrote: > I preprocessed my data (6 channels, 1Kz, minimum 97 trial/condition) with > eeglab. Since I’d like to perform the time frequency analysis with field > trip, I converted the data to field trip using the eegalb2fieldtrip > function. However, after the conversion I’ve got very strange results, > meaning that for most of the frequencies I get zeros or NaNs. I am > wondering, if I have to change something in the file structure. Does > anybody has an idea what’s wrong? > > Thanx for any help or hints, Marcus > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Michael.S.Beauchamp at uth.tmc.edu Sat Nov 8 01:20:22 2014 From: Michael.S.Beauchamp at uth.tmc.edu (Beauchamp, Michael S) Date: Sat, 8 Nov 2014 00:20:22 +0000 Subject: [FieldTrip] Postdoctoral position in Houston--Multisensory Integration and Visual Perception Message-ID: <2EDEDA4E3AFFFB44B07F320540CA2B6E2EDCE1@UTHMAIL1.uthouston.edu> The Beauchamp Lab at the University of Texas Medical School at Houston (http://openwetware.org/wiki/Beauchamp) seeks a postdoctoral fellow for a federally-funded research program. The main focus of the lab is to understand the neural substrates of multisensory integration and visual perception. The laboratory uses multiple techniques, including fMRI and electrocorticography: experience with one of these techniques (or related) is a requirement. Data analysis is carried out with specialized software, including AFNI, EEGlab and Fieldtrip, requiring that applicants be comfortable with writing and modifying C-shell scripts. An interest in computational and quantitative modeling of behavioral and neuroimaging data is an asset. Houston has a rich neuroimaging and neuroscience community, with Rice University, Baylor College of Medicine, and the University of Texas Health Science Center at Houston as partners in the Gulf Coast Consortia for quantitative biomedical sciences. Facilities include multiple research‑dedicated 3 T scanners, a Blackrock Microsystems 128‑channel recording system, infrared eye trackers, and MR-compatible transcranial magnetic stimulation (TMS). The position is available immediately and the review of applications will continue until the position is filled. Please send your CV to beauchamplab at gmail.com for an immediate reply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Sat Nov 8 02:14:57 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Fri, 7 Nov 2014 17:14:57 -0800 Subject: [FieldTrip] FFT Message-ID: Hello I'm new to programming and to fieldtrip, but I'd like to run a basic FFT using fieldtrip. I've done all other preprocessing in EEGlab. I've looked through the wiki and watched some videos about fieldtrips FFT functions (which were great) I just need help with implementation. Could someone give me some example code for running an FFT? These are my more specific questions: 1. I found that eeglab2filedtrip is a function I can use to convert my file from the eeglab format to fieldtrip format. Can someone give me an example as to what that code would look like? 2. I was a 40% hanning window for my FFT. How do I specify the 40%? 3. What will the output look like? What I ideally want is the power for each electrode site within a certain frequency (whichever I specify as being of interest). Thanks for the help! Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.wutzke at gmail.com Sun Nov 9 21:54:32 2014 From: alex.wutzke at gmail.com (Alexander Wutzke) Date: Sun, 9 Nov 2014 21:54:32 +0100 Subject: [FieldTrip] Coherence calculation in phalow_amphigh advanced Message-ID: Dear Ladies and Gentlemen, i have some problem by using the example code "phalow_amphigh" in advanced (link: http://fieldtrip.fcdonders.nl/example/crossfreq/phalow_amphigh ). I do my best in the last days to understand my issue, which i will described below: First, the code will generate a powerspectrum with the 'mtmconvol' method. For Signal2 at every 2Hz until 60Hz. After that it will do a 'mtmfft' calculation, so that we get on both axies the frequency range. What will happened to the powerspectrum of signal2 at 2Hz etc. in this case? Powerspectrum of powerspectrum? This is another confusing point. Finally, when i calculate the coherence between the created channels (singal1 between signal2 at 2Hz etc.) i get some strange output. I use the example signals in the code at your homepage. The plotting with imagesc generate a picture which seems to be wrong. But maybe it can also be, that i cant understand the result and therefore my interpretation is false. In general, the signal1 and signal2 are independend at different frequencys and the result should be a blue (low or no coherence) picture. But i get some blue jets and the rest of the picture is amlost red (high coherence). This is very confusing to me! Please tell me what i do wrong or is there a fieldtrip bug? Thanks a lot and you will make me very happy with your answer! I used the Fieldtrip version from 9.11.14. Yours sincerely Alexander The code part for this issue: cfg = []; cfg.method = 'mtmconvol'; cfg.channel = 's2 (high)'; cfg.output = 'pow'; cfg.taper = 'hanning'; cfg.foi = [2:2:60]; cfg.toi = data.time{1}(3001:7000); %power is calculated at every sample cfg.t_ftimwin = 4./cfg.foi; %timewindow used to calculated power is 4 cycles long and therefore differs over frequencies cfg.keeptrials = 'yes'; freq4 = ft_freqanalysis(cfg,data); % Make data same length as freq1 data_cut = data; for iTr = 1:length(data.trial) data_cut.trial{iTr} = data.trial{iTr}(:,3001:7000); data_cut.time{iTr} = data.time{iTr}(3001:7000); end data_app = ft_appenddata([],data_cut, freq4); %contains original channel and channels with power %FieldTrip automatically converts the freq4 data to raw data. % mtmfft output cross-spectral-density between s2 (high)(raw) and freq4 cfg = []; cfg.method = 'mtmfft'; cfg.output = 'powandcsd'; cfg.tapsmofrq = 1; cfg.foilim = [2 60]; cfg.keeptrials = 'no'; cfg.pad = 4; cfg.channelcmb = {'s1 (AM)' 's2 (high)@2Hz'; 's1 (AM)' 's2 (high)@4Hz'; 's1 (AM)' 's2 (high)@6Hz'; 's1 (AM)' 's2 (high)@8Hz'; 's1 (AM)' 's2 (high)@10Hz'; 's1 (AM)' 's2 (high)@12Hz'; 's1 (AM)' 's2 (high)@14Hz'; 's1 (AM)' 's2 (high)@16Hz'; 's1 (AM)' 's2 (high)@18Hz'; 's1 (AM)' 's2 (high)@20Hz'; 's1 (AM)' 's2 (high)@22Hz'; 's1 (AM)' 's2 (high)@24Hz'; 's1 (AM)' 's2 (high)@26Hz'; 's1 (AM)' 's2 (high)@28Hz'; 's1 (AM)' 's2 (high)@30Hz'; 's1 (AM)' 's2 (high)@32Hz'; 's1 (AM)' 's2 (high)@34Hz'; 's1 (AM)' 's2 (high)@36Hz'; 's1 (AM)' 's2 (high)@38Hz'; 's1 (AM)' 's2 (high)@40Hz'; 's1 (AM)' 's2 (high)@42Hz'; 's1 (AM)' 's2 (high)@44Hz'; 's1 (AM)' 's2 (high)@46Hz'; 's1 (AM)' 's2 (high)@48Hz'; 's1 (AM)' 's2 (high)@50Hz'; 's1 (AM)' 's2 (high)@52Hz'; 's1 (AM)' 's2 (high)@54Hz'; 's1 (AM)' 's2 (high)@56Hz'; 's1 (AM)' 's2 (high)@58Hz'; 's1 (AM)' 's2 (high)@60Hz';}; freq5 = ft_freqanalysis(cfg,data_app); %calculate coherence cfg = []; cfg.method = 'coh'; coh = ft_connectivityanalysis(cfg,freq5); coh.freq5 = [2:2:60]; figure; imagesc(coh.freq, coh.freq5, coh.cohspctrm); colorbar xlabel('Frequency(1/Hz)'); ylabel('Frequency(1/Hz)');title('Coherencespectra S1 - S2'); axis xy print -dpng phalow_amphigh_fig11.png -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Mon Nov 10 01:06:01 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 10 Nov 2014 00:06:01 +0000 Subject: [FieldTrip] connectivity on DICS beamformer Message-ID: <2C4DB885-EFD0-4EA1-98CD-7E13247E7E95@flinders.edu.au> Hello fieldtrip, I was just wondering about the steps are doing a DICS beamformer on ft_freqanalysis output in terms of connectivity. (pointing me towards a tutorial is fine!). Ive already used the LCMV beamformer for a different purpose, where I made virtual channels and calculated connectivity between those virtual channels, but I am stumped what to do now with the ft_sourceanalysis output and the ft_freqanalysis output and how to do some connectivity analysis. Was the connectivity analysis ie granger causality, only designed to work with the ft_freqanalysis output? Thanking you in advance, please correct my inaccurate thinking! Tyler Sent from my iPad From balperin07 at gmail.com Mon Nov 10 04:30:51 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Sun, 9 Nov 2014 19:30:51 -0800 Subject: [FieldTrip] 40% hanning window Message-ID: Hello I converted my preprocessed data from eeglab to fieldtrip and successfully ran an FFT, but I would like to apply a 40% hanning window. I'm assuming by choosing hanning as my taper, it's applied to the entire trial. Here is what I have: %convert dataset from an EEGlab structure to a fieldtrip structure data = eeglab2fieldtrip(EEG,'preprocessing','none') cfg = []; cfg.method = 'mtmfft'; %run an fft cfg.taper = 'hanning'; %chose a hanning window cfg.foilim = [4 7] %frequencies of interest. In this case, theta cfg.output = 'pow' freq = ft_freqanalysis(cfg,data) Also, my data is made up of 2 second epochs. I'm assuming each cell in the output (freq.powspctrm) is the average of the power of a specific frequency (e.g. 4Hz) within each epoch. Is this accurate? Thanks for the help, Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From martine.vanschouwenburg at ucsf.edu Tue Nov 11 02:45:42 2014 From: martine.vanschouwenburg at ucsf.edu (Martine van Schouwenburg) Date: Mon, 10 Nov 2014 17:45:42 -0800 Subject: [FieldTrip] reading in ascii files Message-ID: <05b401cffd51$3400a6f0$9c01f4d0$@vanschouwenburg@ucsf.edu> Hi all, I have been using a new (wireless and dry!) EEG cap called Enobio (http://www.neuroelectrics.com/ ). It saves the data in a non-traditional format called .easy files, but they are basically just ascii files that can be read with dlmread into matlab. Is anyone aware of a way I can read these files into Fieldtrip? I tried changing the extension to .txt, because on the Fieldtrip website it mentions this as one of the supported data formats (for NIRS though..), but I get the following error. Error using ft_read_header (line 1833) unsupported header format (ascii_txt) I guess it makes sense cause there is no header in the file. J It is just a table with number of electrodes x number of data points. If anyone has succeeded in the past to read in ascii files into Fieldtrip, or has any idea on how to achieve this, I would very much appreciate your advice! Thanks! Best, Martine van Schouwenburg -------------- next part -------------- An HTML attachment was scrubbed... URL: From kumar at cbs.mpg.de Tue Nov 11 12:23:42 2014 From: kumar at cbs.mpg.de (Saurabh Kumar) Date: Tue, 11 Nov 2014 12:23:42 +0100 (CET) Subject: [FieldTrip] group_statistics_question In-Reply-To: <1346914686.4185.1415704812808.JavaMail.root@zimbra> Message-ID: <356719912.4230.1415705022318.JavaMail.root@zimbra> Hello fellow researchers, I have a general problem and am only seeking the solution in the correct direction. I am working with the EEG data and I have been able to locate the source in the brain using the MNE method that is implemented in the fieldtrip. My next step would be to do group statistics and for this I wanna know if there are some functions already implemented in fieldtrip. I have been doing source_statictics and as I understand it is used to find the significant difference between source conditions. Seeking a way, ---------------------------------------------------- Saurabh Kumar Cognitive Neurology Max Planck Institute for Human Cognitive and Brain Sciences Stephanstr. 1a 04103 Leipzig From m.stoica at uke.de Wed Nov 12 12:58:15 2014 From: m.stoica at uke.de (Stoica, Mircea) Date: Wed, 12 Nov 2014 11:58:15 +0000 Subject: [FieldTrip] How to plot hyper networks? Message-ID: Dear all, do you know any way to plot connections between two brains, i.e. two topoplots with lines connecting them? Thanks in advance. Best, Mircea Dept. of Neurophysiology and Pathophysiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg Germany -- DANKE FÜR 125 JAHRE ENGAGEMENT UND VERTRAUEN. www.uke.de/125 _____________________________________________________________________ Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING -------------- next part -------------- An HTML attachment was scrubbed... URL: From laura.marzetti at gmail.com Wed Nov 12 15:54:14 2014 From: laura.marzetti at gmail.com (Laura Marzetti) Date: Wed, 12 Nov 2014 15:54:14 +0100 Subject: [FieldTrip] intertrial coherence estimation Message-ID: Dear all, I want to compute the intertrial phase coherence and its variation across trials with a one taper hanning approach as in *cfg = [];* *cfg.output = 'fourier';* *cfg.channel = 'all';* *cfg.method = 'mtmconvol';* *cfg.taper = 'hanning';* *cfg.foi = 5:2:80;* *cfg.t_ftimwin = 5./cfg.foi; * *cfg.tapsmofrq = 0.4*cfg.foi; * *cfg.toi = time_vect;* *cfg.pad = 'maxperlen'; * *cfg.keeptrials = 'yes';* *% cfg.keeptapers = 'no';* *freqscprm = ft_freqanalysis(cfg, data);* *tmpdat = freqscprm.fourierspctrm;* *tmpdat = tmpdat./abs(tmpdat);* *itc = abs(mean(tmpdat)); * Nevertheless, the option *cfg.keeptrials = 'yes'; *does not seem to be applied and the output is already the average across trials, e.g. of size nfreq x ntimepoints and not of size ntrials x nfreq x ntimepoints as I would have expected due to the settings for *cfg.keeptrials.* Can anyone suggest me how to manage the configuration in order to have estimates in each trial as an output? Thanks, Laura -- Laura Marzetti, PhD Istituto di Tecnologie Avanzate Biomediche Università di Chieti "G. D'Annunzio" Via dei Vestini - Campus Universitario 66013 Chieti - ITALY phone: 0039-0871-3556944 fax: 0039-0871-3556930 -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.thomas at nin.knaw.nl Wed Nov 12 16:39:43 2014 From: r.thomas at nin.knaw.nl (Rajat Thomas) Date: Wed, 12 Nov 2014 15:39:43 +0000 Subject: [FieldTrip] EEG cap layout to SPM Message-ID: <4c7352a592774821a165217b5c0da029@EXNHI01.herseninstituut.knaw.nl> Dear FieldTrippers, ? I am trying to use both FieldTrip and SPM do to my SPM analysis. I have made my cap in the format of FT and would like to port it to SPM. Any ideas? I am using MATLAB scripts to do my analysis and I am not sure how to update the D.sensors and D.fiducials fields (where D is an SPM M/EEG structure) Thanks. Rajat Rajat Mani Thomas Social Brain Lab Netherlands Institute for Neuroscience Amsterdam -------------- next part -------------- An HTML attachment was scrubbed... URL: From litvak.vladimir at gmail.com Wed Nov 12 17:30:30 2014 From: litvak.vladimir at gmail.com (Vladimir Litvak) Date: Wed, 12 Nov 2014 16:30:30 +0000 Subject: [FieldTrip] EEG cap layout to SPM In-Reply-To: <4c7352a592774821a165217b5c0da029@EXNHI01.herseninstituut.knaw.nl> References: <4c7352a592774821a165217b5c0da029@EXNHI01.herseninstituut.knaw.nl> Message-ID: Dear Rajat, One thing you can try is to save your elec struct in a mat file and then load it via Prepare in SPM (for both sensors and fiducials). Note that for things like standard 10-20 labels SPM assigns default channel locations so if your locations are not custom or individually measured it might be easier for you to go with that (also via Prepare). Best, Vladimir On Wed, Nov 12, 2014 at 3:39 PM, Rajat Thomas wrote: > Dear FieldTrippers, > > ​ > > I am trying to use both FieldTrip and SPM do to my SPM analysis. I have > made my cap in the > > format of FT and would like to port it to SPM. > > Any ideas? > > I am using MATLAB scripts to do my analysis and I am not sure how to > update the D.sensors > > and D.fiducials fields (where D is an SPM M/EEG structure) > > > Thanks. > > > Rajat > > > > > Rajat Mani Thomas > Social Brain Lab > Netherlands Institute for Neuroscience > Amsterdam > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnmark.taylor at yale.edu Wed Nov 12 17:45:31 2014 From: johnmark.taylor at yale.edu (JohnMark Taylor) Date: Wed, 12 Nov 2014 11:45:31 -0500 Subject: [FieldTrip] How to Crop .cnt files? (Forgot to stop recording) Message-ID: Hello, I have a quick question about how to manipulate .cnt files. While running one subject, we forgot to stop the EEG recording after the experiment was done (so there is about 20 minutes of empty data). This has made the .cnt file size unwieldy and too large for some of our analysis programs. We were wondering, then: is there some fieldtrip tool that can be used to crop .cnt files? We would like to get rid of all parts of the recording that happened after the experiment was finished. Thank you very much for your help, JohnMark -------------- next part -------------- An HTML attachment was scrubbed... URL: From gerome.manson at utoronto.ca Thu Nov 13 10:07:21 2014 From: gerome.manson at utoronto.ca (Gerome Manson) Date: Thu, 13 Nov 2014 10:07:21 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip Message-ID: Hello All, I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) Thanks alot, Gerome Here is the brain vision sequence I am trying to replicate - Read in Data - Reference to mastiod - 100Hz Band rejection filter - bandwidth 8, slope 2 - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) - Notch Filter at 50Hz - Segmentation - Baseline Correction -200 ms to - 5 ms - Averaging segments Here is my Field trip code: %rereference all trials cfg.reref = 'yes'; cfg.continuous = 'yes'; % reference what channels cfg.channel = 'all'; %choose the reference channel cfg.refchannel = {'EXG1' 'EXG2'}; % cfg.dataset = 'CVP1S1.bdf'; cfg.continuous = 'yes'; % %bandfilter cfg.bsfilter = 'yes'; cfg.bsfiltord = 2; % cfg.bsfiltdir = 'onepass-zerophase'; cfg.bsfreq = [92 108]; % %DFT cfg.dftfilter = 'yes'; % IIR Filters cfg.lpfilter = 'yes'; cfg.lpfilttype = 'but'; % cfg.lpfiltdir = 'onepass-zerophase'; cfg.lpfreq = 45; cfg.hpfilter = 'yes'; cfg.hpfilttype = 'but'; % cfg.hpfiltdir = 'onepass-zerophase'; cfg.hpfreq = 0.53; data = ft_preprocessing(cfg); % Define Trial cfg = []; cfg.trialdef.eventtype = 'STATUS'; cfg.dataset = eeg_file; cfg.trialdef.eventvalue = 65522; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 0.3; cfg = ft_definetrial(cfg); data_vep = ft_redefinetrial(cfg, data); % Baseline Correction cfg = []; cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 -0.05]; data_vep = ft_preprocessing(cfg, data_vep); %Averaging cfg=[]; avg_data = ft_timelockanalysis(cfg, data_vep); cfg.ylim = [-10 10]; cfg.channel = 'O1'; ft_singleplotER(cfg,avg_data); -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Thu Nov 13 11:13:43 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Thu, 13 Nov 2014 11:13:43 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: <040E6541-0D1E-4675-92D8-88B1578C7FE8@uni-konstanz.de> Dear Gerome, one thing you could change is keep the reference the same in both cases. So far you are referencing the data against the mastoids in BVA and a common reference in FieldTrip. This is a potential source of variance in the waveforms you’ll get. best tzvetan > Hello All, > > I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) > > > Thanks alot, > Gerome > > Here is the brain vision sequence I am trying to replicate > - Read in Data > - Reference to mastiod > - 100Hz Band rejection filter - bandwidth 8, slope 2 > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) > - Notch Filter at 50Hz > - Segmentation > - Baseline Correction -200 ms to - 5 ms > - Averaging segments > > > > Here is my Field trip code: > > %rereference all trials > cfg.reref = 'yes'; > cfg.continuous = 'yes'; > > % reference what channels > cfg.channel = 'all'; > %choose the reference channel > cfg.refchannel = {'EXG1' 'EXG2'}; > > % cfg.dataset = 'CVP1S1.bdf'; > cfg.continuous = 'yes'; > % > > %bandfilter > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; > % cfg.bsfiltdir = 'onepass-zerophase'; > cfg.bsfreq = [92 108]; > > > % > %DFT > cfg.dftfilter = 'yes'; > > % IIR Filters > cfg.lpfilter = 'yes'; > cfg.lpfilttype = 'but'; > % cfg.lpfiltdir = 'onepass-zerophase'; > cfg.lpfreq = 45; > > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > % cfg.hpfiltdir = 'onepass-zerophase'; > cfg.hpfreq = 0.53; > > data = ft_preprocessing(cfg); > > > % Define Trial > cfg = []; > cfg.trialdef.eventtype = 'STATUS'; > cfg.dataset = eeg_file; > cfg.trialdef.eventvalue = 65522; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 0.3; > cfg = ft_definetrial(cfg); > > data_vep = ft_redefinetrial(cfg, data); > > % Baseline Correction > cfg = []; > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 -0.05]; > data_vep = ft_preprocessing(cfg, data_vep); > > %Averaging > cfg=[]; > avg_data = ft_timelockanalysis(cfg, data_vep); > > > cfg.ylim = [-10 10]; > cfg.channel = 'O1'; > > ft_singleplotER(cfg,avg_data); > > -- > _____________________ > Gerome Manson PhD Student > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > Perceptual Motor Behavior lab- University of Toronto > gerome.manson at utoronto.ca > gerome.manson at univ-amu.fr > 416-978-6109 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.herring at fcdonders.ru.nl Thu Nov 13 13:16:25 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 13 Nov 2014 12:16:25 +0000 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: <040E6541-0D1E-4675-92D8-88B1578C7FE8@uni-konstanz.de> References: <040E6541-0D1E-4675-92D8-88B1578C7FE8@uni-konstanz.de> Message-ID: <3D00B7615FB58D46A0B49B9AD67A33EB0C2076@exprd01.hosting.ru.nl> Hi Gerome and Tzvetan, Actually, you are referencing to the linked mastoids if EXG1 and EXG2 represent the mastoid channels as you specified them in cfg.refchannel. cfg.channel only specifies on what channels to apply the re-referencing on. At a first glance I can see that in Fieldtrip you are applying a band-stop filter between 92 and 108 Hz, while in BVA you are applying a band-stop filter at 100Hz with a bandwidth of 8. I am not that familiar with BVA but does that mean plus AND minus 8Hz or 8Hz around 100Hz, so 96 - 104Hz? Also, in BVA you are applying a notch filter at 50Hz, in Fieldtrip you are applying a DFT filter at 50, 100 and 150Hz. A notch filter is a band-stop filter with a narrow band (usually 1-2Hz). DFT filters try to fit and subtract sinusoids at the specified frequency. To make it more similar to BVA I would suggest a band-stop filter between 49 and 51Hz. Furthermore, in Fieldtrip you are applying Butterworth filters, is this the same filter-type applied in BVA? Additionally, in BVA your baseline is from -200 to -5ms, while in Fieldtrip you specify: cfg.baselinewindow = [-0.2 -0.05]; which is from -200 to -50ms. I hope this can help you make the analysis more similar. Could you perhaps make a picture of a result that you find is different (e.g. ERPs calculated in Fieldtrip and BVA)?. That could help identifying the exact problem if this did not help you. Best, Jim From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Tzvetan Popov Sent: donderdag 13 november 2014 11:14 To: FieldTrip discussion list Subject: Re: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip Dear Gerome, one thing you could change is keep the reference the same in both cases. So far you are referencing the data against the mastoids in BVA and a common reference in FieldTrip. This is a potential source of variance in the waveforms you'll get. best tzvetan Hello All, I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) Thanks alot, Gerome Here is the brain vision sequence I am trying to replicate - Read in Data - Reference to mastiod - 100Hz Band rejection filter - bandwidth 8, slope 2 - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) - Notch Filter at 50Hz - Segmentation - Baseline Correction -200 ms to - 5 ms - Averaging segments Here is my Field trip code: %rereference all trials cfg.reref = 'yes'; cfg.continuous = 'yes'; % reference what channels cfg.channel = 'all'; %choose the reference channel cfg.refchannel = {'EXG1' 'EXG2'}; % cfg.dataset = 'CVP1S1.bdf'; cfg.continuous = 'yes'; % %bandfilter cfg.bsfilter = 'yes'; cfg.bsfiltord = 2; % cfg.bsfiltdir = 'onepass-zerophase'; cfg.bsfreq = [92 108]; % %DFT cfg.dftfilter = 'yes'; % IIR Filters cfg.lpfilter = 'yes'; cfg.lpfilttype = 'but'; % cfg.lpfiltdir = 'onepass-zerophase'; cfg.lpfreq = 45; cfg.hpfilter = 'yes'; cfg.hpfilttype = 'but'; % cfg.hpfiltdir = 'onepass-zerophase'; cfg.hpfreq = 0.53; data = ft_preprocessing(cfg); % Define Trial cfg = []; cfg.trialdef.eventtype = 'STATUS'; cfg.dataset = eeg_file; cfg.trialdef.eventvalue = 65522; cfg.trialdef.prestim = 0.2; cfg.trialdef.poststim = 0.3; cfg = ft_definetrial(cfg); data_vep = ft_redefinetrial(cfg, data); % Baseline Correction cfg = []; cfg.demean = 'yes'; cfg.baselinewindow = [-0.2 -0.05]; data_vep = ft_preprocessing(cfg, data_vep); %Averaging cfg=[]; avg_data = ft_timelockanalysis(cfg, data_vep); cfg.ylim = [-10 10]; cfg.channel = 'O1'; ft_singleplotER(cfg,avg_data); -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From widmann at uni-leipzig.de Thu Nov 13 16:44:28 2014 From: widmann at uni-leipzig.de (Andreas Widmann) Date: Thu, 13 Nov 2014 16:44:28 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: Hi, besides the already mentioned differences, you cannot easily replicate the Brainvision Analyzer Butterworth filters with Fieldtrip. The Analyzer internally adjusts filter order *and* cutoff frequency to compensate for two-pass filtering. The (onepass) filter order actually applied by Analyzer is half the requested order. You can correspondingly reduce filter order in Fieldtrip to replicate this behavior. The (onepass) filter cutoff frequency actually applied by Analyzer is undocumented. It is adjusted so that the requested cutoff has -3dB attenuation after *twopass* filtering. You can measure the -6dB cutoff (applicable in Fieldtrip) by feeding an impulse into Analyzer and checking the frequency response. This problem is discussed here in more detail: http://www.ncbi.nlm.nih.gov/pubmed/25128257 Hope this helps, Andreas > Am 13.11.2014 um 10:07 schrieb Gerome Manson : > > Hello All, > > I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) > > > Thanks alot, > Gerome > > Here is the brain vision sequence I am trying to replicate > - Read in Data > - Reference to mastiod > - 100Hz Band rejection filter - bandwidth 8, slope 2 > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) > - Notch Filter at 50Hz > - Segmentation > - Baseline Correction -200 ms to - 5 ms > - Averaging segments > > > > Here is my Field trip code: > > %rereference all trials > cfg.reref = 'yes'; > cfg.continuous = 'yes'; > > % reference what channels > cfg.channel = 'all'; > %choose the reference channel > cfg.refchannel = {'EXG1' 'EXG2'}; > > % cfg.dataset = 'CVP1S1.bdf'; > cfg.continuous = 'yes'; > % > > %bandfilter > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; > % cfg.bsfiltdir = 'onepass-zerophase'; > cfg.bsfreq = [92 108]; > > > % > %DFT > cfg.dftfilter = 'yes'; > > % IIR Filters > cfg.lpfilter = 'yes'; > cfg.lpfilttype = 'but'; > % cfg.lpfiltdir = 'onepass-zerophase'; > cfg.lpfreq = 45; > > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > % cfg.hpfiltdir = 'onepass-zerophase'; > cfg.hpfreq = 0.53; > > data = ft_preprocessing(cfg); > > > % Define Trial > cfg = []; > cfg.trialdef.eventtype = 'STATUS'; > cfg.dataset = eeg_file; > cfg.trialdef.eventvalue = 65522; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 0.3; > cfg = ft_definetrial(cfg); > > data_vep = ft_redefinetrial(cfg, data); > > % Baseline Correction > cfg = []; > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 -0.05]; > data_vep = ft_preprocessing(cfg, data_vep); > > %Averaging > cfg=[]; > avg_data = ft_timelockanalysis(cfg, data_vep); > > > cfg.ylim = [-10 10]; > cfg.channel = 'O1'; > > ft_singleplotER(cfg,avg_data); > > -- > _____________________ > Gerome Manson PhD Student > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > Perceptual Motor Behavior lab- University of Toronto > gerome.manson at utoronto.ca > gerome.manson at univ-amu.fr > 416-978-6109 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From gerome.manson at utoronto.ca Thu Nov 13 19:09:41 2014 From: gerome.manson at utoronto.ca (Gerome Manson) Date: Thu, 13 Nov 2014 19:09:41 +0100 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: Thank you for your help everyone, the solution was fairly simple (although the datasets still don't quite match up) I adjusted the baseline window and also the filters as stated in the answers by Andreas, and Jim, and changed the reference -as stated by tzvetan these changes did the trick. I do have one more question though that I couldn't quite find enough information on: Is it possible to create and eletrode pool (for instance a new channel that is the average of some channels (eg: PO3, O1 and PO7) and have it added as a new channel (in a similar way that we can create new channels for eog). Thanks again, Gerome 2014-11-13 16:44 GMT+01:00 Andreas Widmann : > Hi, > > besides the already mentioned differences, you cannot easily replicate the > Brainvision Analyzer Butterworth filters with Fieldtrip. The Analyzer > internally adjusts filter order *and* cutoff frequency to compensate for > two-pass filtering. The (onepass) filter order actually applied by Analyzer > is half the requested order. You can correspondingly reduce filter order in > Fieldtrip to replicate this behavior. The (onepass) filter cutoff frequency > actually applied by Analyzer is undocumented. It is adjusted so that the > requested cutoff has -3dB attenuation after *twopass* filtering. You can > measure the -6dB cutoff (applicable in Fieldtrip) by feeding an impulse > into Analyzer and checking the frequency response. This problem is > discussed here in more detail: > http://www.ncbi.nlm.nih.gov/pubmed/25128257 > > Hope this helps, > Andreas > > > Am 13.11.2014 um 10:07 schrieb Gerome Manson >: > > > > Hello All, > > > > I would like some help to replicate an analysis done in brain vision > analyzer in field trip. Here is the details of the analysis in brain > vision. I have done most of the code but I get almost completely different > results which is puzziling. Maybe some of the filteres are not defined > properly- so if anyone has some time I would appreciate the help :-) > > > > > > Thanks alot, > > Gerome > > > > Here is the brain vision sequence I am trying to replicate > > - Read in Data > > - Reference to mastiod > > - 100Hz Band rejection filter - bandwidth 8, slope 2 > > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, > 24db/ oct) > > - Notch Filter at 50Hz > > - Segmentation > > - Baseline Correction -200 ms to - 5 ms > > - Averaging segments > > > > > > > > Here is my Field trip code: > > > > %rereference all trials > > cfg.reref = 'yes'; > > cfg.continuous = 'yes'; > > > > % reference what channels > > cfg.channel = 'all'; > > %choose the reference channel > > cfg.refchannel = {'EXG1' 'EXG2'}; > > > > % cfg.dataset = 'CVP1S1.bdf'; > > cfg.continuous = 'yes'; > > % > > > > %bandfilter > > cfg.bsfilter = 'yes'; > > cfg.bsfiltord = 2; > > % cfg.bsfiltdir = 'onepass-zerophase'; > > cfg.bsfreq = [92 108]; > > > > > > % > > %DFT > > cfg.dftfilter = 'yes'; > > > > % IIR Filters > > cfg.lpfilter = 'yes'; > > cfg.lpfilttype = 'but'; > > % cfg.lpfiltdir = 'onepass-zerophase'; > > cfg.lpfreq = 45; > > > > cfg.hpfilter = 'yes'; > > cfg.hpfilttype = 'but'; > > % cfg.hpfiltdir = 'onepass-zerophase'; > > cfg.hpfreq = 0.53; > > > > data = ft_preprocessing(cfg); > > > > > > % Define Trial > > cfg = []; > > cfg.trialdef.eventtype = 'STATUS'; > > cfg.dataset = eeg_file; > > cfg.trialdef.eventvalue = 65522; > > cfg.trialdef.prestim = 0.2; > > cfg.trialdef.poststim = 0.3; > > cfg = ft_definetrial(cfg); > > > > data_vep = ft_redefinetrial(cfg, data); > > > > % Baseline Correction > > cfg = []; > > cfg.demean = 'yes'; > > cfg.baselinewindow = [-0.2 -0.05]; > > data_vep = ft_preprocessing(cfg, data_vep); > > > > %Averaging > > cfg=[]; > > avg_data = ft_timelockanalysis(cfg, data_vep); > > > > > > cfg.ylim = [-10 10]; > > cfg.channel = 'O1'; > > > > ft_singleplotER(cfg,avg_data); > > > > -- > > _____________________ > > Gerome Manson PhD Student > > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > > Perceptual Motor Behavior lab- University of Toronto > > gerome.manson at utoronto.ca > > gerome.manson at univ-amu.fr > > 416-978-6109 > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathanweisz at mac.com Thu Nov 13 20:19:40 2014 From: nathanweisz at mac.com (Nathan Weisz) Date: Thu, 13 Nov 2014 20:19:40 +0100 Subject: [FieldTrip] Postdoc opportunity @Centre for Cognitive Neuroscience Salzburg Message-ID: <4E925DA8-F688-494F-B0AC-2BF31F8535C8@mac.com> I am sending this job add on behalf of Manuel Schabus. Please see attached doc-file for details and contact him directly in case of questions. -------------- next part -------------- A non-text attachment was scrubbed... Name: Stellenausschreibung_PostDoc_E REV2.doc Type: application/msword Size: 52224 bytes Desc: not available URL: From j.herring at fcdonders.ru.nl Thu Nov 13 21:50:20 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 13 Nov 2014 20:50:20 +0000 Subject: [FieldTrip] Redoing Brain Vision Analyzer in Field Trip In-Reply-To: References: Message-ID: <121EA1A7-B55C-4E7B-AE2D-CFC3E03FA66F@donders.ru.nl> Hi Gerome, Have a look at ft_apply_montage (http://fieldtrip.fcdonders.nl/reference/ft_apply_montage), I think it will do what you want. Best, Jim On 13 Nov 2014, at 19:09, Gerome Manson > wrote: Thank you for your help everyone, the solution was fairly simple (although the datasets still don't quite match up) I adjusted the baseline window and also the filters as stated in the answers by Andreas, and Jim, and changed the reference -as stated by tzvetan these changes did the trick. I do have one more question though that I couldn't quite find enough information on: Is it possible to create and eletrode pool (for instance a new channel that is the average of some channels (eg: PO3, O1 and PO7) and have it added as a new channel (in a similar way that we can create new channels for eog). Thanks again, Gerome 2014-11-13 16:44 GMT+01:00 Andreas Widmann >: Hi, besides the already mentioned differences, you cannot easily replicate the Brainvision Analyzer Butterworth filters with Fieldtrip. The Analyzer internally adjusts filter order *and* cutoff frequency to compensate for two-pass filtering. The (onepass) filter order actually applied by Analyzer is half the requested order. You can correspondingly reduce filter order in Fieldtrip to replicate this behavior. The (onepass) filter cutoff frequency actually applied by Analyzer is undocumented. It is adjusted so that the requested cutoff has -3dB attenuation after *twopass* filtering. You can measure the -6dB cutoff (applicable in Fieldtrip) by feeding an impulse into Analyzer and checking the frequency response. This problem is discussed here in more detail: http://www.ncbi.nlm.nih.gov/pubmed/25128257 Hope this helps, Andreas > Am 13.11.2014 um 10:07 schrieb Gerome Manson >: > > Hello All, > > I would like some help to replicate an analysis done in brain vision analyzer in field trip. Here is the details of the analysis in brain vision. I have done most of the code but I get almost completely different results which is puzziling. Maybe some of the filteres are not defined properly- so if anyone has some time I would appreciate the help :-) > > > Thanks alot, > Gerome > > Here is the brain vision sequence I am trying to replicate > - Read in Data > - Reference to mastiod > - 100Hz Band rejection filter - bandwidth 8, slope 2 > - High cuttoff (low pass filter at 45Hz with a slope of 24dB/oct) > - Low cuttoff (high pass filter at 0.53Hz, time constant 0.3002923, 24db/ oct) > - Notch Filter at 50Hz > - Segmentation > - Baseline Correction -200 ms to - 5 ms > - Averaging segments > > > > Here is my Field trip code: > > %rereference all trials > cfg.reref = 'yes'; > cfg.continuous = 'yes'; > > % reference what channels > cfg.channel = 'all'; > %choose the reference channel > cfg.refchannel = {'EXG1' 'EXG2'}; > > % cfg.dataset = 'CVP1S1.bdf'; > cfg.continuous = 'yes'; > % > > %bandfilter > cfg.bsfilter = 'yes'; > cfg.bsfiltord = 2; > % cfg.bsfiltdir = 'onepass-zerophase'; > cfg.bsfreq = [92 108]; > > > % > %DFT > cfg.dftfilter = 'yes'; > > % IIR Filters > cfg.lpfilter = 'yes'; > cfg.lpfilttype = 'but'; > % cfg.lpfiltdir = 'onepass-zerophase'; > cfg.lpfreq = 45; > > cfg.hpfilter = 'yes'; > cfg.hpfilttype = 'but'; > % cfg.hpfiltdir = 'onepass-zerophase'; > cfg.hpfreq = 0.53; > > data = ft_preprocessing(cfg); > > > % Define Trial > cfg = []; > cfg.trialdef.eventtype = 'STATUS'; > cfg.dataset = eeg_file; > cfg.trialdef.eventvalue = 65522; > cfg.trialdef.prestim = 0.2; > cfg.trialdef.poststim = 0.3; > cfg = ft_definetrial(cfg); > > data_vep = ft_redefinetrial(cfg, data); > > % Baseline Correction > cfg = []; > cfg.demean = 'yes'; > cfg.baselinewindow = [-0.2 -0.05]; > data_vep = ft_preprocessing(cfg, data_vep); > > %Averaging > cfg=[]; > avg_data = ft_timelockanalysis(cfg, data_vep); > > > cfg.ylim = [-10 10]; > cfg.channel = 'O1'; > > ft_singleplotER(cfg,avg_data); > > -- > _____________________ > Gerome Manson PhD Student > Laboratoire de Neuroscience Cognitives- Aix Marseille Université > Perceptual Motor Behavior lab- University of Toronto > gerome.manson at utoronto.ca > gerome.manson at univ-amu.fr > 416-978-6109 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -- _____________________ Gerome Manson PhD Student Laboratoire de Neuroscience Cognitives- Aix Marseille Université Perceptual Motor Behavior lab- University of Toronto gerome.manson at utoronto.ca gerome.manson at univ-amu.fr 416-978-6109 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From balperin07 at gmail.com Fri Nov 14 00:57:46 2014 From: balperin07 at gmail.com (Brittany Alperin) Date: Thu, 13 Nov 2014 15:57:46 -0800 Subject: [FieldTrip] average power Message-ID: Hello I'm using mtmfft and want the average theta power. I was under the impression that (cfg.foilim = [4 7];) would give me the average of the power between 4 and 8 Hz, however my output is in .5 Hz steps. Am I missing something? Also, if I can get the average output rather than stepwise, is there a way that I can get several bands in one pass. For example [4 7] for theta and [12 30] for beta? Thanks, Brittany -------------- next part -------------- An HTML attachment was scrubbed... URL: From katrinheimann at gmail.com Fri Nov 14 01:16:17 2014 From: katrinheimann at gmail.com (KatrinH Heimann) Date: Fri, 14 Nov 2014 01:16:17 +0100 Subject: [FieldTrip] average power In-Reply-To: References: Message-ID: hey Brittany, I am far from being a fieldtrip profi, but as far as I can get you can either use ft_freqgrandaverage and average over frequencies (cfg.parameter='freg'), or you precise cfg.avgoverfreq = 'yes' in the ft_freqstatistics. Of course you could also change the steps of ft_freqanalysis to bigger steps... (for example cfg.foi = 7:1:31 for analysis from 7 to 31 in steps of 1 hertz cheers k 2014-11-14 0:57 GMT+01:00 Brittany Alperin : > Hello > > I'm using mtmfft and want the average theta power. I was under the > impression that (cfg.foilim = [4 7];) would give me the average of the > power between 4 and 8 Hz, however my output is in .5 Hz steps. Am I missing > something? > > Also, if I can get the average output rather than stepwise, is there a way > that I can get several bands in one pass. For example [4 7] for theta and > [12 30] for beta? > > Thanks, > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tyler.grummett at flinders.edu.au Fri Nov 14 05:45:53 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Fri, 14 Nov 2014 04:45:53 +0000 Subject: [FieldTrip] beamformer and granger casuality Message-ID: <99973235-3756-4005-A68D-2902FC8271A7@flinders.edu.au> Hello fieldtrip, I was just wondering whether it was possible to perform a beamformer analysis on some EEG data and then perform a connectivity analysis on the source using the granger casuality method. Currently I am following the connectivity/extended tutorials and just doing granger casuality connectivity analysis on EEG data (ft_mvaranalysis-ft_freqanalysis-ft_connectivityanalysis) and its working fine, just curious to see if it works on beamformed data. >From what Ive tested so far, ft_connectivityanalysis seems to want a 'mom' field, which doesnt appear to be present when you conduct a DICS beamformer (I am aware 'mom' refers to moment, which is in the time domain). Regards, Tyler From tzvetan.popov at uni-konstanz.de Fri Nov 14 08:03:12 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 14 Nov 2014 08:03:12 +0100 Subject: [FieldTrip] average power In-Reply-To: References: Message-ID: Hi Brittany, in addition to Katrin’s suggestions you can also rug ft_freqanalysis with cfg.foi = [4:1:30];, and then call ft_selectdata twice. Once with cfg.frequency = [4 7]; cfg.avgoverfreq = ‘yes’; and accordingly for your other freq band of interest. best tzvetan > hey Brittany, I am far from being a fieldtrip profi, but as far as I can get you can either use > ft_freqgrandaverage and average over frequencies (cfg.parameter='freg'), or you precise cfg.avgoverfreq = 'yes' in the ft_freqstatistics. Of course you could also change the steps of ft_freqanalysis to bigger steps... (for example cfg.foi = 7:1:31 for analysis from 7 to 31 in steps of 1 hertz > > > > cheers k > > > 2014-11-14 0:57 GMT+01:00 Brittany Alperin : > Hello > > I'm using mtmfft and want the average theta power. I was under the impression that (cfg.foilim = [4 7];) would give me the average of the power between 4 and 8 Hz, however my output is in .5 Hz steps. Am I missing something? > > Also, if I can get the average output rather than stepwise, is there a way that I can get several bands in one pass. For example [4 7] for theta and [12 30] for beta? > > Thanks, > Brittany > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From tzvetan.popov at uni-konstanz.de Fri Nov 14 08:38:54 2014 From: tzvetan.popov at uni-konstanz.de (Tzvetan Popov) Date: Fri, 14 Nov 2014 08:38:54 +0100 Subject: [FieldTrip] beamformer and granger casuality In-Reply-To: <99973235-3756-4005-A68D-2902FC8271A7@flinders.edu.au> References: <99973235-3756-4005-A68D-2902FC8271A7@flinders.edu.au> Message-ID: Dear Tyler, ‘mom’ refers indeed to a moment, yet not a moment in time (-domain) but a dipole moment. The modeling of brain activity at location X as dipolar activity at that location is used in many inverse solutions including spatial filtering. You can specify cfg.keepmom = ‘yes’; and subsequently call ft_sourcedescriptives with cfg.projectmom = ‘yes’; in order to obtain the dominant orientation. good luck tzvetan > Hello fieldtrip, > > I was just wondering whether it was possible to perform a beamformer analysis on some EEG data and then perform a connectivity analysis on the source using the granger casuality method. Currently I am following the connectivity/extended tutorials and just doing granger casuality connectivity analysis on EEG data (ft_mvaranalysis-ft_freqanalysis-ft_connectivityanalysis) and its working fine, just curious to see if it works on beamformed data. > > From what Ive tested so far, ft_connectivityanalysis seems to want a 'mom' field, which doesnt appear to be present when you conduct a DICS beamformer (I am aware 'mom' refers to moment, which is in the time domain). > > Regards, > > Tyler > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From marcus.heldmann at neuro.uni-luebeck.de Fri Nov 14 12:50:20 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Fri, 14 Nov 2014 12:50:20 +0100 Subject: [FieldTrip] strange time frequency results after converting data with eeglab2fieldtrip In-Reply-To: References: <5CCD8908-CA20-4D65-8A5D-DCAF06E57EEA@neuro.uni-luebeck.de> Message-ID: <69BA0730-3891-4603-8992-8FCC164DB6E4@neuro.uni-luebeck.de> Sorry for this late reply. Yes, I can display the data and they do look like expected. The cell-structure contains label (6 entries), sample (1kHz, this is correct), elec (structure containing the electrode positions ), cell structure trial (388 trials, each containing sample x channel data), time and cfg, just containing version information like name and id. Hope this helps. Strange enough, I performed a time frequency already in EEGLAB, but I’d like to use the statistical testing. I have no idea what#s going wrong. Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 Am 07.11.2014 um 21:13 schrieb Rodrigo Montefusco : > It's hard to say at what level is the problem, for me works perfect. Can you check your data using ft_databrowser([],data) before the spectral decomposition? > Can you copy how your data structure looks like? > > Best > > On Fri, Nov 7, 2014 at 11:51 AM, Marcus Heldmann wrote: > I preprocessed my data (6 channels, 1Kz, minimum 97 trial/condition) with eeglab. Since I’d like to perform the time frequency analysis with field trip, I converted the data to field trip using the eegalb2fieldtrip function. However, after the conversion I’ve got very strange results, meaning that for most of the frequencies I get zeros or NaNs. I am wondering, if I have to change something in the file structure. Does anybody has an idea what’s wrong? > > Thanx for any help or hints, Marcus > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > From polomacnenad at gmail.com Fri Nov 14 13:18:17 2014 From: polomacnenad at gmail.com (Nenad Polomac) Date: Fri, 14 Nov 2014 13:18:17 +0100 Subject: [FieldTrip] ICA subspace reduction with PCA eigenvalues Message-ID: Dear all, I have one question regarding ICA calculation subspace. I have high pass filtered MEG data (> 30 Hz) on which I calculated ICA. I know there are different methods to limit data dimensionality by ICA calculation, usually performed by PCA prior to ICA. E.g. taking 99% of variance explained or selecting first N components... However I did it by taking specific eigenvalue (2.5^27) and assuming that all components which have eigenvalue smaller than this represented noise. Argument for this would be that eigenvalue of one component represent scale of the variance explained by this component (for example, muscle artifacts component would have high eigenvalues while noise component oscillate in narrower range, hence variance and eigenvalue would be smaller). I have found this value to result in a stable number of components of around 45 per participant which is large enough to contain most of the signal and small enough to obtain stable and meaningful ICA components. Does anybody know any studies that used this constant eigenvalue approach to limit ICA subspace? Thank you very much in advance? all the best! Nenad -------------- next part -------------- An HTML attachment was scrubbed... URL: From DrakesmithM at cardiff.ac.uk Fri Nov 14 14:29:29 2014 From: DrakesmithM at cardiff.ac.uk (Mark Drakesmith) Date: Fri, 14 Nov 2014 13:29:29 +0000 Subject: [FieldTrip] using megplanar on cross-spectra In-Reply-To: <5465E4BE.5020802@cardiff.ac.uk> References: <5465E4BE.5020802@cardiff.ac.uk> Message-ID: <546603B9.3070508@cardiff.ac.uk> Dear FieldTripers I want to ask a quick question about applying megplanar to cross-spectra and coherence data. I want to compute sensor-sensor connectivity after the planar transform. I can do this quite easily after doing the initial planar transformation (run ft_megplanar and ft_freqanalysis). However, when I combine the channels after ft_freqanalysis using ft_combineplanar, the crssprtm field is no longer there, only the powsptrm. I havn't tried it with the coherence spectrum yet but I'm guessing the same thing will happen there. I dont want to work on the full uncombined planar data as this is quite expensive in terms of computer resources and harder to visualise. Does anyone have advise on how best to get planar-combined cross-spectra and coherences? Many thanks Mark Mark Drakesmith CUBRIC / NMHRI, Cardiff University From arno at cerco.ups-tlse.fr Fri Nov 14 16:41:03 2014 From: arno at cerco.ups-tlse.fr (Arnaud Delorme) Date: Fri, 14 Nov 2014 07:41:03 -0800 Subject: [FieldTrip] ICA subspace reduction with PCA eigenvalues In-Reply-To: References: Message-ID: <87A56D60-8339-4357-9B75-DBAACF9539D4@cerco.ups-tlse.fr> Hi Nehad, This is Arno from UCSD (developer of EEGLAB, the software which popularized ICA). All commercial software preprocess the data using PCA to reduce the dimensionality. This can not only bias ICA but also introduce artifacts in the data. ICA should only be done full rank if possible. You might want to contact Stepehn Shall Jones (shall-jones at infoscience.otago.ac.nz) which student Carl Leichter has written a thesis on that subject "Eigenspecters: Information Misallocation in Lossy Principal Component Reductions of Magnetoencephalographic and Electoencephalographic Data". He shows which artifacts are introduced by doing PCA before ICA. Cheers, Arno On Nov 14, 2014, at 4:18 AM, Nenad Polomac wrote: > Dear all, > > I have one question regarding ICA calculation subspace. I have high pass filtered MEG data (> 30 Hz) on which I calculated ICA. > I know there are different methods to limit data dimensionality by ICA calculation, usually performed by PCA prior to ICA. E.g. taking 99% of variance explained or selecting first N components... > However I did it by taking specific eigenvalue (2.5^27) and assuming that all components which have eigenvalue smaller than this represented noise. Argument for this would be that eigenvalue of one component represent scale of the variance explained by this component (for example, muscle artifacts component would have high eigenvalues while noise component oscillate in narrower range, hence variance and eigenvalue would be smaller). I have found this value to result in a stable number of components of around 45 per participant which is large enough to contain most of the signal and small enough to obtain stable and meaningful ICA components. > Does anybody know any studies that used this constant eigenvalue approach to limit ICA subspace? > Thank you very much in advance? > > all the best! > > Nenad > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ayobimpe2004 at hotmail.com Sun Nov 16 01:29:37 2014 From: ayobimpe2004 at hotmail.com (Azeez Adebimpe) Date: Sun, 16 Nov 2014 01:29:37 +0100 Subject: [FieldTrip] ROI midpoint Message-ID: Dear experts, please how can I identify the midpoint of each of the region of AAL atlas. thank you Azeez A. Adebimpe "Knowledge and good manner, the beauty of a man" -------------- next part -------------- An HTML attachment was scrubbed... URL: From roeysc at gmail.com Sun Nov 16 06:32:58 2014 From: roeysc at gmail.com (Roey) Date: Sun, 16 Nov 2014 07:32:58 +0200 Subject: [FieldTrip] ROI midpoint In-Reply-To: References: Message-ID: <752FD823-1B22-4F77-9902-EC28BF688B8E@gmail.com> Dear Azeez, It depends on whether you want an actual point (whose activity you want to use, for example) or just an (x,y,z) coordinate. In the latter case you could go over all the point of a given ROI in the atlas, and compute the mean of their x value, the mean if their y value and the mean of their x value (notice that you know which coordinate system you're using, e.g. SPM). If you want an actual point that resides on the atlas grid, you can then find the point closest to the point you computed above (for example, you could use the marlab function "norm" on the difference between the two points, which would be represented as vectors). I'm not sitting in front of fieldtrip at the moment, so hopefully this made sense to you. Best, Roey ‫ב-16 בנוב׳ 2014, בשעה 02:29, ‏‏Azeez Adebimpe ‏ כתב/ה:‬ > Dear experts, > > please how can I identify the midpoint of each of the region of AAL atlas. > > thank you > > Azeez A. Adebimpe > > > "Knowledge and good manner, the beauty of a man" > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Mon Nov 17 11:12:39 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Mon, 17 Nov 2014 10:12:39 +0000 Subject: [FieldTrip] Postdoctoral research positions, University of Nottingham Message-ID: On behalf of Matt: ---------- Forwarded message ---------- From: Matthew Brookes Date: 2014-11-11 16:54 GMT+00:00 Subject: [megcommunity] Postdoctoral research positions, University of Nottingham To: MEGCOMMUNITY at jiscmail.ac.uk The Sir Peter Mansfield Magnetic Resonance Centre, University of Nottingham is seeking to recruit two Research Associate/Fellows in the field of magnetoencephalography (MEG). Successful candidates will work on developing and applying novel ways to measure and understand the intrinsic modes of functional coupling between functionally specific brain regions. Specifically, areas of development will include: i) New ways to model neural oscillations in local circuits; ii) Novel methods to characterize long range linear and non-linear coupling and iii) Measurement of dynamic changes in functional connectivity during basic sensory and cognitive tasks. In addition, since electrophysiological activity and connectivity is mediated by neurochemistry, successful candidates will also be involved in performing parallel ultra-high field (7T) magnetic resonance spectroscopy (1H and 13C) experiments in order to relate the concentration of cortical neurotransmitters (glutamate/GABA) to electrophysiological metrics in MEG. Finally these metrics will be applied in schizophrenia in order to gain new insight into how impaired network activity and connectivity underlies core symptoms. The University of Nottingham has been at the forefront of imaging since the introduction of MRI in the 1970’s. Indeed a rich history of novel developments resulted in the award of a Nobel Prize to Sir Peter Mansfield in 2003. The Sir Peter Mansfield Magnetic Resonance Centre (SPMMRC), now headed by Prof. Peter Morris, remains at the forefront of neuroimaging development with significant contributions in the fields of MRI, MEG, multi-modal imaging, and simultaneous EEG/fMRI. The Centre is equipped with a 275 channel MEG, 7T, 3T and 1.5T MR systems as well as MR compatible 64 channel EEG. In addition, a £9m investment by the Medical Research Council (announced in October 2014) will see upgrades to 7T and MEG as well as the introduction of wide bore 3T and upright MRI systems, to begin in 2015. Candidates should have a PhD (or equivalent) or be nearing completion in neuroimaging and strong interest/experience in developing methods plus an undergraduate degree in Physics, Engineering, Mathematics or appropriately related discipline. There are two fixed term posts available, one for two years and one for three years duration from 1 January 2015. Informal enquiries may be addressed to Dr Matt Brookes, tel: 0115 9515188 or email matthew.brookes at nottingham.ac.uk. Please note that applications sent directly to this email address will not be accepted. This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.chait at ucl.ac.uk Mon Nov 17 15:18:30 2014 From: m.chait at ucl.ac.uk (Chait, Maria) Date: Mon, 17 Nov 2014 14:18:30 +0000 Subject: [FieldTrip] 4 year Post-Doc position in UCL Message-ID: <19cc8ff590b3487b85373b27556c4417@DB4PR01MB0414.eurprd01.prod.exchangelabs.com> A 4 year post-doctoral research associate position is available to work on a European Council-funded project that will use psychophysics, eye tracking and EEG to investigate auditory attention. We aim to understand the brain mechanisms involved in selective attention, and create a brain-machine interface able to identify listeners attentional focus in real time. This research program is part of an international project ("Cognitively controlled Hearing Aid") which includes partners in ENS, France (Shihab Shamma, Alain de Cheveigne, Daniel Pressnitzer), DTU, Denmark (Torsten Dau), UZH, Switzerland (Shih-Chii Liu) and Oticon (Thomas Lunner) . You will be supervised by Dr Maria Chait and based at the UCL Ear Institute (http://www.ucl.ac.uk/ear/research/chaitlab). Salary (inclusive of London allowance) £33,353 - £37,152 per annum Applicants should hold a PhD degree (or equivalent) in an engineering or Neuroscience-related subject and have substantial experience in digital signal processing and computer programming. Previous experience with auditory research and/or functional brain imaging is desirable. For an informal discussion please contact Dr. Maria Chait (m.chait at ucl.ac.uk). Application should be made via the UCL website: http://www.ucl.ac.uk/hr/jobs/ (Ref:1443980). Application deadline: 07 Dec 2014. Start date: Early 2015. The UCL Ear Institute provides state-of-the-art research facilities across a wide range of disciplines and is one of the foremost centres for hearing, speech and language-related research within Europe. Maria Chait PhD m.chait at ucl.ac.uk Reader in Auditory Cognitive Neuroscience Lab site: http://www.ucl.ac.uk/ear/research/chaitlab/ UCL Ear Institute 332 Gray's Inn Road London WC1X 8EE -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Tue Nov 18 11:53:08 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Nov 2014 11:53:08 +0100 Subject: [FieldTrip] reading in ascii files In-Reply-To: References: Message-ID: Hi Martine, You mentioned that you are already able to get it into Matlab, so my guess is that the best way to read it into FieldTrip is to get it into a generic Matlab array first, and then hack a bit to make it FT-compatible. If the data is not segmented yet, you can convert it into one big 'trial', and subsequently use ft_redefinetrial to get it segmented. A typical raw data structure would be: data = []; data.label = {'chan1'...'chanN'}; data.time = {0:1/fsample:tEnd}; data.trial = {dat}; % where dat is channel X timepoint For more details, see the help and code of ft_datatype_raw. Hope that helps! Best, Eelke On 11 November 2014 02:45, Martine van Schouwenburg wrote: > Hi all, > > > > I have been using a new (wireless and dry!) EEG cap called Enobio > (http://www.neuroelectrics.com/ ). It saves the data in a non-traditional > format called .easy files, but they are basically just ascii files that can > be read with dlmread into matlab. Is anyone aware of a way I can read these > files into Fieldtrip? I tried changing the extension to .txt, because on the > Fieldtrip website it mentions this as one of the supported data formats (for > NIRS though..), but I get the following error. > > > > Error using ft_read_header (line 1833) > > unsupported header format (ascii_txt) > > > > I guess it makes sense cause there is no header in the file. J It is just a > table with number of electrodes x number of data points. If anyone has > succeeded in the past to read in ascii files into Fieldtrip, or has any idea > on how to achieve this, I would very much appreciate your advice! > > > > Thanks! > > > > Best, > > Martine van Schouwenburg > > From eelke.spaak at donders.ru.nl Tue Nov 18 11:57:12 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Nov 2014 11:57:12 +0100 Subject: [FieldTrip] intertrial coherence estimation In-Reply-To: <19b158f3bc354e6f8f14294a05077d78@EXPRD03.hosting.ru.nl> References: <19b158f3bc354e6f8f14294a05077d78@EXPRD03.hosting.ru.nl> Message-ID: Dear Laura, Indeed, it should work the way you specified. If you did not find any other possible mistake in your script, could you file a bug on bugzilla and attach a small snippet of data and your cfg that reproduce the issue? Then we can look into it. Best, Eelke On 12 November 2014 15:54, Laura Marzetti wrote: > > Dear all, > > I want to compute the intertrial phase coherence and its variation across > trials with a one taper hanning approach as in > > > > cfg = []; > > > > cfg.output = 'fourier'; > > cfg.channel = 'all'; > > cfg.method = 'mtmconvol'; > > cfg.taper = 'hanning'; > > cfg.foi = 5:2:80; > > cfg.t_ftimwin = 5./cfg.foi; > > cfg.tapsmofrq = 0.4*cfg.foi; > > cfg.toi = time_vect; > > cfg.pad = 'maxperlen'; > > cfg.keeptrials = 'yes'; > > % cfg.keeptapers = 'no'; > > freqscprm = ft_freqanalysis(cfg, data); > > tmpdat = freqscprm.fourierspctrm; > > > > tmpdat = tmpdat./abs(tmpdat); > > itc = abs(mean(tmpdat)); > > > > > > Nevertheless, the option cfg.keeptrials = 'yes'; does not seem to be applied > and the output is already the average across trials, e.g. of size nfreq x > ntimepoints and not of size ntrials x nfreq x ntimepoints as I would have > expected due to the settings for cfg.keeptrials. > > > > Can anyone suggest me how to manage the configuration in order to have > estimates in each trial as an output? > > > > Thanks, > > Laura > > > -- > Laura Marzetti, PhD > Istituto di Tecnologie Avanzate Biomediche > Università di Chieti "G. D'Annunzio" > Via dei Vestini - Campus Universitario > 66013 Chieti - ITALY > > phone: 0039-0871-3556944 > fax: 0039-0871-3556930 From jan.schoffelen at fcdonders.ru.nl Tue Nov 18 13:46:40 2014 From: jan.schoffelen at fcdonders.ru.nl (Schoffelen, J.M. (Jan Mathijs)) Date: Tue, 18 Nov 2014 12:46:40 +0000 Subject: [FieldTrip] intertrial coherence estimation In-Reply-To: References: <19b158f3bc354e6f8f14294a05077d78@EXPRD03.hosting.ru.nl> Message-ID: Please don’t file a bug on bugzilla because it’s a misconception that intertrial coherence can be estimated at the level of the single trials and not a bug. By definition it is defined across trials (as multiple previous threads on this list have discussed). If you want to get a variance estimate, you should use a jackknife approach or something similar. The only reason why I can think of you ending up without more than 1 trial in the output of ft_freqanalysis is that you only had 1 trial in the input. If you want to get multiple ’trials’ from a single long trial, please use ft_redefinetrial and subsequently cfg.method = ‘mtmfft’ in ft_freqanalysis. Jan-Mathijs On Nov 18, 2014, at 11:57 AM, Eelke Spaak wrote: > Dear Laura, > > Indeed, it should work the way you specified. If you did not find any > other possible mistake in your script, could you file a bug on > bugzilla and attach a small snippet of data and your cfg that > reproduce the issue? Then we can look into it. > > Best, > Eelke > > On 12 November 2014 15:54, Laura Marzetti wrote: >> >> Dear all, >> >> I want to compute the intertrial phase coherence and its variation across >> trials with a one taper hanning approach as in >> >> >> >> cfg = []; >> >> >> >> cfg.output = 'fourier'; >> >> cfg.channel = 'all'; >> >> cfg.method = 'mtmconvol'; >> >> cfg.taper = 'hanning'; >> >> cfg.foi = 5:2:80; >> >> cfg.t_ftimwin = 5./cfg.foi; >> >> cfg.tapsmofrq = 0.4*cfg.foi; >> >> cfg.toi = time_vect; >> >> cfg.pad = 'maxperlen'; >> >> cfg.keeptrials = 'yes'; >> >> % cfg.keeptapers = 'no'; >> >> freqscprm = ft_freqanalysis(cfg, data); >> >> tmpdat = freqscprm.fourierspctrm; >> >> >> >> tmpdat = tmpdat./abs(tmpdat); >> >> itc = abs(mean(tmpdat)); >> >> >> >> >> >> Nevertheless, the option cfg.keeptrials = 'yes'; does not seem to be applied >> and the output is already the average across trials, e.g. of size nfreq x >> ntimepoints and not of size ntrials x nfreq x ntimepoints as I would have >> expected due to the settings for cfg.keeptrials. >> >> >> >> Can anyone suggest me how to manage the configuration in order to have >> estimates in each trial as an output? >> >> >> >> Thanks, >> >> Laura >> >> >> -- >> Laura Marzetti, PhD >> Istituto di Tecnologie Avanzate Biomediche >> Università di Chieti "G. D'Annunzio" >> Via dei Vestini - Campus Universitario >> 66013 Chieti - ITALY >> >> phone: 0039-0871-3556944 >> fax: 0039-0871-3556930 > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From eelke.spaak at donders.ru.nl Tue Nov 18 13:59:43 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Tue, 18 Nov 2014 13:59:43 +0100 Subject: [FieldTrip] FieldTrip data format In-Reply-To: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl> References: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl> Message-ID: Dear Xiong Xiao, First, in general, I would recommend you send questions like this to the general FieldTrip mailing list (cc), instead of to any of the developers personally. Responses on the general list will usually be faster, and will benefit other FieldTrip users as well. See here: http://fieldtrip.fcdonders.nl/discussion_list for instructions how to register. Then, I have never worked with the spike data formats, so I cannot tell you how to import them into FieldTrip. You could have a look at the various ft_datatype_xxx functions, which outline the structure of the data format. Best, Eelke On 10 November 2014 15:06, Xiong Xiao wrote: > Hi Eelke, > Sorry to trouble you, but I really want to use FieldTrip for my data > analysis. I am a graduate student from the Institute of Neuroscience, > Shanghai. I am a new FieldTrp user with good programming skills. But I > totally do not know how to convert my raw data (spikes, LFP and events) into > appropriate format for using FieldTrip. So I converted my data (spikes, LFP > and events) into .nex format. However, error occured when I read the events > from .nex files; but it was OK to read spikes. > > BTW, the data was converted to .nex files by using the toolbox provided by > NeuroExplorer. > > spike = ft_read_spike('xx1_SpikeEvents.nex'); > cfg = []; > cfg.spikechannel = {'N1xx1', 'N1xx3'}; % select only the two single units > spike = ft_spike_select(cfg, spike); > > event = ft_read_event('xx1_SpikeEvents.nex'); % there is error here > > > Error message: > Attempted to access adindx(1); index out of bounds because numel(adindx)=0. > > Error in read_nex_event (line 38) > smpfrq = hdr.varheader(adindx(1)).wfrequency; > > Error in ft_read_event (line 1528) > event = read_nex_event(filename); > > > Still I think this is not so convenient to convert my data into .nex files > and then to process it. Is there some other ways to convert the data into > appropriate formats? > > The structure of my data is like this: > > (1) Spikes: cell structure, { n*1 vector (timestamps) } > > (2) Waveform: cell structure, { n*4*32 matrix (waveforms for tetrodes)} > > (2) Events: m*2 matrix (the first column is the onset time of events, and > the second column is the duration of each event) > > (3) LFP: lfp (1*n vector, voltage of the LFP signal), lfp_time (1*n vector, > time of the LFP signal) > > > > Thank you for your time. > > Best regards, > Xiong Xiao > > ________________________________ > ************************************************* > PhD student > Lab of Neural Circuits and Animal Behavior > Institute of Neuroscience, Chinese Academy of Sciences > Room A0738, The New Life Science Building > 320, Yue Yang Road > Shanghai 200031, China > Email: xxiong at ion.ac.cn > Phone: 86-21-54921769 > Web: http://www.ion.ac.cn/laboratories/int.asp?id=46 > ************************************************* From sarita.tamang at mssm.edu Tue Nov 18 15:27:30 2014 From: sarita.tamang at mssm.edu (Tamang, Sarita) Date: Tue, 18 Nov 2014 14:27:30 +0000 Subject: [FieldTrip] FieldTrip data format In-Reply-To: References: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl>, Message-ID: <284E8105C3E44A4EA4C52972E5D13E8836C4BC@EXCHMBXCSM2.ExchMail.mssm.edu> Hi All, I had the same problem as I couldn't convert my LFP data into the field-trip format. I kept getting problems with defining trials. Any input on this would be very helpful. Thank you, Sarita ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Tuesday, November 18, 2014 7:59 AM To: Xiong Xiao Cc: Email discussion list for the FieldTrip project Subject: Re: [FieldTrip] FieldTrip data format Dear Xiong Xiao, First, in general, I would recommend you send questions like this to the general FieldTrip mailing list (cc), instead of to any of the developers personally. Responses on the general list will usually be faster, and will benefit other FieldTrip users as well. See here: https://urldefense.proofpoint.com/v2/url?u=http-3A__fieldtrip.fcdonders.nl_discussion-5Flist&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=xff7mp7yN1139dfVCzoRkmhWTwB1tTM97tyVCAxNb8U&e= for instructions how to register. Then, I have never worked with the spike data formats, so I cannot tell you how to import them into FieldTrip. You could have a look at the various ft_datatype_xxx functions, which outline the structure of the data format. Best, Eelke On 10 November 2014 15:06, Xiong Xiao wrote: > Hi Eelke, > Sorry to trouble you, but I really want to use FieldTrip for my data > analysis. I am a graduate student from the Institute of Neuroscience, > Shanghai. I am a new FieldTrp user with good programming skills. But I > totally do not know how to convert my raw data (spikes, LFP and events) into > appropriate format for using FieldTrip. So I converted my data (spikes, LFP > and events) into .nex format. However, error occured when I read the events > from .nex files; but it was OK to read spikes. > > BTW, the data was converted to .nex files by using the toolbox provided by > NeuroExplorer. > > spike = ft_read_spike('xx1_SpikeEvents.nex'); > cfg = []; > cfg.spikechannel = {'N1xx1', 'N1xx3'}; % select only the two single units > spike = ft_spike_select(cfg, spike); > > event = ft_read_event('xx1_SpikeEvents.nex'); % there is error here > > > Error message: > Attempted to access adindx(1); index out of bounds because numel(adindx)=0. > > Error in read_nex_event (line 38) > smpfrq = hdr.varheader(adindx(1)).wfrequency; > > Error in ft_read_event (line 1528) > event = read_nex_event(filename); > > > Still I think this is not so convenient to convert my data into .nex files > and then to process it. Is there some other ways to convert the data into > appropriate formats? > > The structure of my data is like this: > > (1) Spikes: cell structure, { n*1 vector (timestamps) } > > (2) Waveform: cell structure, { n*4*32 matrix (waveforms for tetrodes)} > > (2) Events: m*2 matrix (the first column is the onset time of events, and > the second column is the duration of each event) > > (3) LFP: lfp (1*n vector, voltage of the LFP signal), lfp_time (1*n vector, > time of the LFP signal) > > > > Thank you for your time. > > Best regards, > Xiong Xiao > > ________________________________ > ************************************************* > PhD student > Lab of Neural Circuits and Animal Behavior > Institute of Neuroscience, Chinese Academy of Sciences > Room A0738, The New Life Science Building > 320, Yue Yang Road > Shanghai 200031, China > Email: xxiong at ion.ac.cn > Phone: 86-21-54921769 > Web: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ion.ac.cn_laboratories_int.asp-3Fid-3D46&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=SPtddSTcRAxVHLC13eNxpQiAypQksJ9BrQpLZq6h3zU&e= > ************************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=Rq0Z-baW1Wo6TdBuJ8U4pVOYUQI9LUEiIkEcL7k1Ud4&e= From sarita.tamang at mssm.edu Tue Nov 18 15:27:30 2014 From: sarita.tamang at mssm.edu (Tamang, Sarita) Date: Tue, 18 Nov 2014 14:27:30 +0000 Subject: [FieldTrip] FieldTrip data format In-Reply-To: References: <7614919bbf7d44618ae8ecbbbae36b8c@EXPRD03.hosting.ru.nl>, Message-ID: <284E8105C3E44A4EA4C52972E5D13E8836C4BC@EXCHMBXCSM2.ExchMail.mssm.edu> Hi All, I had the same problem as I couldn't convert my LFP data into the field-trip format. I kept getting problems with defining trials. Any input on this would be very helpful. Thank you, Sarita ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Eelke Spaak [eelke.spaak at donders.ru.nl] Sent: Tuesday, November 18, 2014 7:59 AM To: Xiong Xiao Cc: Email discussion list for the FieldTrip project Subject: Re: [FieldTrip] FieldTrip data format Dear Xiong Xiao, First, in general, I would recommend you send questions like this to the general FieldTrip mailing list (cc), instead of to any of the developers personally. Responses on the general list will usually be faster, and will benefit other FieldTrip users as well. See here: https://urldefense.proofpoint.com/v2/url?u=http-3A__fieldtrip.fcdonders.nl_discussion-5Flist&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=xff7mp7yN1139dfVCzoRkmhWTwB1tTM97tyVCAxNb8U&e= for instructions how to register. Then, I have never worked with the spike data formats, so I cannot tell you how to import them into FieldTrip. You could have a look at the various ft_datatype_xxx functions, which outline the structure of the data format. Best, Eelke On 10 November 2014 15:06, Xiong Xiao wrote: > Hi Eelke, > Sorry to trouble you, but I really want to use FieldTrip for my data > analysis. I am a graduate student from the Institute of Neuroscience, > Shanghai. I am a new FieldTrp user with good programming skills. But I > totally do not know how to convert my raw data (spikes, LFP and events) into > appropriate format for using FieldTrip. So I converted my data (spikes, LFP > and events) into .nex format. However, error occured when I read the events > from .nex files; but it was OK to read spikes. > > BTW, the data was converted to .nex files by using the toolbox provided by > NeuroExplorer. > > spike = ft_read_spike('xx1_SpikeEvents.nex'); > cfg = []; > cfg.spikechannel = {'N1xx1', 'N1xx3'}; % select only the two single units > spike = ft_spike_select(cfg, spike); > > event = ft_read_event('xx1_SpikeEvents.nex'); % there is error here > > > Error message: > Attempted to access adindx(1); index out of bounds because numel(adindx)=0. > > Error in read_nex_event (line 38) > smpfrq = hdr.varheader(adindx(1)).wfrequency; > > Error in ft_read_event (line 1528) > event = read_nex_event(filename); > > > Still I think this is not so convenient to convert my data into .nex files > and then to process it. Is there some other ways to convert the data into > appropriate formats? > > The structure of my data is like this: > > (1) Spikes: cell structure, { n*1 vector (timestamps) } > > (2) Waveform: cell structure, { n*4*32 matrix (waveforms for tetrodes)} > > (2) Events: m*2 matrix (the first column is the onset time of events, and > the second column is the duration of each event) > > (3) LFP: lfp (1*n vector, voltage of the LFP signal), lfp_time (1*n vector, > time of the LFP signal) > > > > Thank you for your time. > > Best regards, > Xiong Xiao > > ________________________________ > ************************************************* > PhD student > Lab of Neural Circuits and Animal Behavior > Institute of Neuroscience, Chinese Academy of Sciences > Room A0738, The New Life Science Building > 320, Yue Yang Road > Shanghai 200031, China > Email: xxiong at ion.ac.cn > Phone: 86-21-54921769 > Web: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ion.ac.cn_laboratories_int.asp-3Fid-3D46&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=SPtddSTcRAxVHLC13eNxpQiAypQksJ9BrQpLZq6h3zU&e= > ************************************************* _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.science.ru.nl_mailman_listinfo_fieldtrip&d=AAICAg&c=4R1YgkJNMyVWjMjneTwN5tJRn8m8VqTSNCjYLg1wNX4&r=ZGIuqqMPZJ5Zc6lq0reutuU3Ur_DP6HgbiuxMhDx5mw&m=civVQfJg1oAZA4wKjKjNn0Lgoh2q2NTGZYMOnzLs3RM&s=Rq0Z-baW1Wo6TdBuJ8U4pVOYUQI9LUEiIkEcL7k1Ud4&e= From marcus.heldmann at neuro.uni-luebeck.de Wed Nov 19 09:58:08 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Wed, 19 Nov 2014 09:58:08 +0100 Subject: [FieldTrip] tfa produces zeros Message-ID: Dear all, I have a dataset with surface and local field potential recordings and I’d like to perform a tfa. The data are recorded with a BrainVision Recorder, 1KHz sampling frequency, bp 0.05-200Hz. After epoching (-1 to 2 s), filtering (bsfilter 49:51, lpfilter 70) and baseline correction I tried to perform a tfa using a wavelet analysis described in the tutorial (http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis, Time-frequency analysis IV). However, the powspctrm-field just contains NaNs (which is ok) and zeros (not ok). The data seem to be correct, I am able to plot single trials. The strange thing is, that my EEGLAB analysis provides some meaningful results. You can fined the preprocessed data for one condition under the following link https://drive.google.com/file/d/0B4-NxS-suG8dOXZnVHcxUDFyYXM/view?usp=sharing Any idea, why this happen’s? Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 From sarathykousik at gmail.com Wed Nov 19 10:12:29 2014 From: sarathykousik at gmail.com (kousik sarathy) Date: Wed, 19 Nov 2014 10:12:29 +0100 Subject: [FieldTrip] tfa produces zeros In-Reply-To: References: Message-ID: Dear Marcus, I tried running the "data_clean" through the same snippet of code (IV). It works fine for me. Could post the exact code you used? -- Regards, Kousik Sarathy, S On Wed, Nov 19, 2014 at 9:58 AM, Marcus Heldmann < marcus.heldmann at neuro.uni-luebeck.de> wrote: > Dear all, > I have a dataset with surface and local field potential recordings and I’d > like to perform a tfa. The data are recorded with a BrainVision Recorder, > 1KHz sampling frequency, bp 0.05-200Hz. After epoching (-1 to 2 s), > filtering (bsfilter 49:51, lpfilter 70) and baseline correction I tried to > perform a tfa using a wavelet analysis described in the tutorial ( > http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis, > Time-frequency analysis IV). However, the powspctrm-field just contains > NaNs (which is ok) and zeros (not ok). The data seem to be correct, I am > able to plot single trials. The strange thing is, that my EEGLAB analysis > provides some meaningful results. You can fined the preprocessed data for > one condition under the following link > > > https://drive.google.com/file/d/0B4-NxS-suG8dOXZnVHcxUDFyYXM/view?usp=sharing > > Any idea, why this happen’s? > > Greetings, Marcus > > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.heldmann at neuro.uni-luebeck.de Wed Nov 19 10:40:08 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Wed, 19 Nov 2014 10:40:08 +0100 Subject: [FieldTrip] tfa produces zeros In-Reply-To: References: Message-ID: <62B835A2-EFFD-47D0-90EA-FF26A6F63F8D@neuro.uni-luebeck.de> I used this code cfg = []; cfg.channel = '1_Fz'; cfg.method = 'wavelet'; cfg.width = 7; cfg.output = 'pow'; cfg.foi = 1:2:30; cfg.toi = -0.5:0.05:1.5; TFRwave = ft_freqanalysis(cfg, data_clean); Thanks, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 Am 19.11.2014 um 10:12 schrieb kousik sarathy : > Dear Marcus, > > I tried running the "data_clean" through the same snippet of code (IV). It works fine for me. > > Could post the exact code you used? > > -- > Regards, > Kousik Sarathy, S > > > On Wed, Nov 19, 2014 at 9:58 AM, Marcus Heldmann wrote: > Dear all, > I have a dataset with surface and local field potential recordings and I’d like to perform a tfa. The data are recorded with a BrainVision Recorder, 1KHz sampling frequency, bp 0.05-200Hz. After epoching (-1 to 2 s), filtering (bsfilter 49:51, lpfilter 70) and baseline correction I tried to perform a tfa using a wavelet analysis described in the tutorial (http://fieldtrip.fcdonders.nl/tutorial/timefrequencyanalysis, Time-frequency analysis IV). However, the powspctrm-field just contains NaNs (which is ok) and zeros (not ok). The data seem to be correct, I am able to plot single trials. The strange thing is, that my EEGLAB analysis provides some meaningful results. You can fined the preprocessed data for one condition under the following link > > https://drive.google.com/file/d/0B4-NxS-suG8dOXZnVHcxUDFyYXM/view?usp=sharing > > Any idea, why this happen’s? > > Greetings, Marcus > > --------------------------------------------- > > Dr. Marcus Heldmann > Klinik für Neurologie > UKSH, Campus Lübeck > Paul-Ehrlich-Strasse 1-3, MGZ > 23562 Lübeck > 0451 317 9313 14 > > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > From marcus.heldmann at neuro.uni-luebeck.de Wed Nov 19 13:06:18 2014 From: marcus.heldmann at neuro.uni-luebeck.de (Marcus Heldmann) Date: Wed, 19 Nov 2014 13:06:18 +0100 Subject: [FieldTrip] tfa produces zeros Message-ID: Dear all, thanks to kousik saraty my problem is solved. I used the field trip lite version instead of the full version. With the full version, the expected results appear. Thanks for the kind and patient support, Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 From ma447 at leicester.ac.uk Wed Nov 19 13:48:11 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 12:48:11 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam -------------- next part -------------- An HTML attachment was scrubbed... URL: From ma447 at leicester.ac.uk Wed Nov 19 14:00:30 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 13:00:30 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk>, <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BB9BB6@exp-dag1-n2.uol.le.ac.uk> ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Wednesday, November 19, 2014 12:48 PM To: fieldtrip at science.ru.nl Subject: FW: problem with my data Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam -------------- next part -------------- An HTML attachment was scrubbed... URL: From johanna.zumer at gmail.com Wed Nov 19 15:52:33 2014 From: johanna.zumer at gmail.com (Johanna Zumer) Date: Wed, 19 Nov 2014 14:52:33 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk> Message-ID: Dear Maryam, It should be: cfg=ft_databrowser(cfg,avgdata2) not cfg=ft_databrowser(avgdata2,cfg) Best, Johanna 2014-11-19 12:48 GMT+00:00 Ahmadi Shapourabadi, Maryam (Dr.) < ma447 at leicester.ac.uk>: > Dear Sir/Madam, > > I am new to feildtrip and I wanted to start analyzing my data using the > field trip. I have 64 channels of EEG recordings and I tried to convert my > data to fieldtrip cell type to be able to browse the data > using ft_databrowser, but there is a problem and I am not sure if it > because of my data format or some other problems. I have reported the error > and the structure of my data in the following. > Please do me a favor and check my data and help me with this issue. > > Regards, > Maryam > ------------------------------ > *From:* Ahmadi Shapourabadi, Maryam (Dr.) > *Sent:* Tuesday, November 18, 2014 6:20 PM > *To:* fieldtrip at science.ru.nl > *Subject:* problem with my data > > Dear Sir/Madam, > > I have tried to browse my data in fieldtrip but have got the following > error: > > cfg=ft_databrowser(avgdata2,cfg) > ??? Warning: Struct field assignment overwrites a value with class > "single". > See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As > Structures Displays Warning for details. > > In utilities\private\ft_preamble_provenance at 54 > In ft_preamble at 54 > In ft_databrowser at 138 > ??? Error using ==> ft_checkdata at 462 > This function requires raw+comp or raw data as input. > > Error in ==> ft_databrowser at 261 > data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, > 'feedback', 'yes', 'hassampleinfo', 'yes'); > > This is my data: > ftdata2 = > > trial: {1x251 cell} > time: {1x251 cell} > fsample: 512 > label: {1x64 cell} > > trial is single. I changed to double by the command 'double', but I got > similar error: > > cfg=ft_databrowser(avgdata2,cfg) > ??? Warning: Struct field assignment overwrites a value with class > "single". > See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As > Structures Displays Warning for details. > > In utilities\private\ft_preamble_provenance at 54 > In ft_preamble at 54 > In ft_databrowser at 138 > ??? Error using ==> ft_checkdata at 462 > This function requires raw+comp or raw data as input. > > Error in ==> ft_databrowser at 261 > data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, > 'feedback', 'yes', 'hassampleinfo', 'yes'); > > > detail of my data: > > ftdata2.trial > > ans = > > Columns 1 through 3 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 4 through 6 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 7 through 9 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 10 through 12 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 13 through 15 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 16 through 18 > ... > > ftdata2.trial > > ans = > > Columns 1 through 3 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 4 through 6 > > [64x1024 single] [64x1024 single] [64x1024 single] > > Columns 7 through 9 > .... > > ftdata2.fsample > > ans = > > 512 > > > Could you please help me with this problem? > > Regards, > Maryam > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > -------------- next part -------------- An HTML attachment was scrubbed... URL: From emmanuelle.kristensen at gipsa-lab.grenoble-inp.fr Wed Nov 19 16:04:23 2014 From: emmanuelle.kristensen at gipsa-lab.grenoble-inp.fr (Emmanuelle Kristensen) Date: Wed, 19 Nov 2014 16:04:23 +0100 Subject: [FieldTrip] offset between eeglab and fieldtrip Message-ID: <2395D5EC-A4C2-43E9-B78C-1206E73C8B8E@gipsa-lab.grenoble-inp.fr> Hi, I am a new user of fieldtrip. I made ICA with Eeglab, then I saved the signal in BrainAmp format (.dat,.vrmk .vhdr). I opened it in fieldtrip with ft_preprocessing. And when I compare the signal opened in Eeglab with the signal opened in fieldtrip, I have an offset for amplitude, for each channel, between the two signals. Does anyone know why? Regards, Emmanuelle -------------- next part -------------- An HTML attachment was scrubbed... URL: From ma447 at leicester.ac.uk Wed Nov 19 16:23:42 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 15:23:42 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk>, Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BB9C1A@exp-dag1-n2.uol.le.ac.uk> Dear Johanna, Thanks for your reply. I tried it but got the same error: cfg=ft_databrowser(cfg,avgdata2) ??? Error using ==> ft_checkdata at 442 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 257 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Bests, Maryam ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Johanna Zumer [johanna.zumer at gmail.com] Sent: Wednesday, November 19, 2014 2:52 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] FW: problem with my data Dear Maryam, It should be: cfg=ft_databrowser(cfg,avgdata2) not cfg=ft_databrowser(avgdata2,cfg) Best, Johanna 2014-11-19 12:48 GMT+00:00 Ahmadi Shapourabadi, Maryam (Dr.) >: Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From poil.simonshlomo at gmail.com Wed Nov 19 16:51:47 2014 From: poil.simonshlomo at gmail.com (Simon-Shlomo Poil) Date: Wed, 19 Nov 2014 15:51:47 +0000 Subject: [FieldTrip] offset between eeglab and fieldtrip References: <2395D5EC-A4C2-43E9-B78C-1206E73C8B8E@gipsa-lab.grenoble-inp.fr> Message-ID: Dear Emmanuelle, Did you maybe apply a filter somewhere in the process. Otherwise it sounds as a bug. Simon On Wed, Nov 19, 2014, 16:05 Emmanuelle Kristensen < emmanuelle.kristensen at gipsa-lab.grenoble-inp.fr> wrote: > Hi, > I am a new user of fieldtrip. I made ICA with Eeglab, then I saved the > signal in BrainAmp format (.dat,.vrmk .vhdr). > I opened it in fieldtrip with ft_preprocessing. And when I compare the > signal opened in Eeglab with the signal opened in fieldtrip, I have an > offset for amplitude, for each channel, between the two signals. > Does anyone know why? > > Regards, > Emmanuelle > > > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From ma447 at leicester.ac.uk Wed Nov 19 17:00:26 2014 From: ma447 at leicester.ac.uk (Ahmadi Shapourabadi, Maryam (Dr.)) Date: Wed, 19 Nov 2014 16:00:26 +0000 Subject: [FieldTrip] FW: problem with my data In-Reply-To: <05F556AD0303584F8A24EE56D63FEE2714BB9C1A@exp-dag1-n2.uol.le.ac.uk> References: <05F556AD0303584F8A24EE56D63FEE2714BB9ACE@exp-dag1-n2.uol.le.ac.uk> <05F556AD0303584F8A24EE56D63FEE2714BB9BA5@exp-dag1-n2.uol.le.ac.uk>, , <05F556AD0303584F8A24EE56D63FEE2714BB9C1A@exp-dag1-n2.uol.le.ac.uk> Message-ID: <05F556AD0303584F8A24EE56D63FEE2714BBAC42@exp-dag1-n2.uol.le.ac.uk> Johanna, I had a problem in my data that I fixed and tried what you mentioned one more time and it worked. Thanks, Maryam ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Ahmadi Shapourabadi, Maryam (Dr.) [ma447 at leicester.ac.uk] Sent: Wednesday, November 19, 2014 3:23 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] FW: problem with my data Dear Johanna, Thanks for your reply. I tried it but got the same error: cfg=ft_databrowser(cfg,avgdata2) ??? Error using ==> ft_checkdata at 442 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 257 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Bests, Maryam ________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Johanna Zumer [johanna.zumer at gmail.com] Sent: Wednesday, November 19, 2014 2:52 PM To: FieldTrip discussion list Subject: Re: [FieldTrip] FW: problem with my data Dear Maryam, It should be: cfg=ft_databrowser(cfg,avgdata2) not cfg=ft_databrowser(avgdata2,cfg) Best, Johanna 2014-11-19 12:48 GMT+00:00 Ahmadi Shapourabadi, Maryam (Dr.) >: Dear Sir/Madam, I am new to feildtrip and I wanted to start analyzing my data using the field trip. I have 64 channels of EEG recordings and I tried to convert my data to fieldtrip cell type to be able to browse the data using ft_databrowser, but there is a problem and I am not sure if it because of my data format or some other problems. I have reported the error and the structure of my data in the following. Please do me a favor and check my data and help me with this issue. Regards, Maryam ________________________________ From: Ahmadi Shapourabadi, Maryam (Dr.) Sent: Tuesday, November 18, 2014 6:20 PM To: fieldtrip at science.ru.nl Subject: problem with my data Dear Sir/Madam, I have tried to browse my data in fieldtrip but have got the following error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); This is my data: ftdata2 = trial: {1x251 cell} time: {1x251 cell} fsample: 512 label: {1x64 cell} trial is single. I changed to double by the command 'double', but I got similar error: cfg=ft_databrowser(avgdata2,cfg) ??? Warning: Struct field assignment overwrites a value with class "single". See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details. > In utilities\private\ft_preamble_provenance at 54 In ft_preamble at 54 In ft_databrowser at 138 ??? Error using ==> ft_checkdata at 462 This function requires raw+comp or raw data as input. Error in ==> ft_databrowser at 261 data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); detail of my data: ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 [64x1024 single] [64x1024 single] [64x1024 single] Columns 10 through 12 [64x1024 single] [64x1024 single] [64x1024 single] Columns 13 through 15 [64x1024 single] [64x1024 single] [64x1024 single] Columns 16 through 18 ... ftdata2.trial ans = Columns 1 through 3 [64x1024 single] [64x1024 single] [64x1024 single] Columns 4 through 6 [64x1024 single] [64x1024 single] [64x1024 single] Columns 7 through 9 .... ftdata2.fsample ans = 512 Could you please help me with this problem? Regards, Maryam _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.dinov13 at imperial.ac.uk Wed Nov 19 17:24:43 2014 From: m.dinov13 at imperial.ac.uk (Martin Dinov) Date: Wed, 19 Nov 2014 16:24:43 +0000 Subject: [FieldTrip] About huge delay for ft_read_data to return Message-ID: <546CC44B.1040800@imperial.ac.uk> Dear all, I'm trying to do something with realtime EEG data and I'm using the ft_read_data function get data from BrainVision Recorder via rda2ft. In MATLAB, calling ft_read_data seems to always take >=500ms (even for a single sample point from data with srate of 1000Hz) which is unacceptably slow for what I want to do. Perhaps specifying channel indices to read only some of the data would speed it up, but I haven't managed to get this to work. As I am trying to phase lock to the alpha band, I need to be able to read in single sample points (after an initial larger block that can take longer) much quicker than 500ms (<50ms). I highly appreciate any help with this! Thanks in advance -- Martin Dinov, MSc PhD postgraduate Imperial College London Computational, Cognitive and Clinical Neuroimaging Laboratory 3rd Floor, Burlington Danes Building, Hammersmith Hospital Du Cane Road London W12 0NN From a.maye at uke.de Thu Nov 20 10:13:59 2014 From: a.maye at uke.de (Alexander Maye) Date: Thu, 20 Nov 2014 10:13:59 +0100 Subject: [FieldTrip] About huge delay for ft_read_data to return In-Reply-To: <546CC44B.1040800@imperial.ac.uk> References: <546CC44B.1040800@imperial.ac.uk> Message-ID: <1828503.8MUoyVSXsK@mars.neurophys.uke.uni-hamburg.de> Hi Martin, if I remember correctly, it helps to read the header once (ft_read_header) and then pass it to the ft_read_data calls. For continuous reading you need to update the sample information inside the header struct with the data from ft_poll_buffer. Best, ALEX. Am Mittwoch, 19. November 2014, 16:24:43 schrieb Martin Dinov: > Dear all, > > I'm trying to do something with realtime EEG data and I'm using the > ft_read_data function get data from BrainVision Recorder via rda2ft. In > MATLAB, calling ft_read_data seems to always take >=500ms (even for a > single sample point from data with srate of 1000Hz) which is > unacceptably slow for what I want to do. Perhaps specifying channel > indices to read only some of the data would speed it up, but I haven't > managed to get this to work. As I am trying to phase lock to the alpha > band, I need to be able to read in single sample points (after an > initial larger block that can take longer) much quicker than 500ms > (<50ms). I highly appreciate any help with this! > > Thanks in advance -------------- next part -------------- -- DANKE FÜR 125 JAHRE ENGAGEMENT UND VERTRAUEN. www.uke.de/125 _____________________________________________________________________ Besuchen Sie uns auf: www.uke.de _____________________________________________________________________ Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik _____________________________________________________________________ SAVE PAPER - THINK BEFORE PRINTING From j.herring at fcdonders.ru.nl Thu Nov 20 16:38:23 2014 From: j.herring at fcdonders.ru.nl (Herring, J.D. (Jim)) Date: Thu, 20 Nov 2014 15:38:23 +0000 Subject: [FieldTrip] tfa produces zeros In-Reply-To: References: Message-ID: <3D00B7615FB58D46A0B49B9AD67A33EB0D5D7C@exprd01.hosting.ru.nl> Dear Marcus (and all), The problem occurred due to a recently introduced (and now fixed) bug causing problems with single-channel data. The issue should be fixed in the most recent versions of FieldTrip (also Lite). Best, Jim -----Original Message----- From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Marcus Heldmann Sent: woensdag 19 november 2014 13:06 To: FieldTrip discussion list Subject: [FieldTrip] tfa produces zeros Dear all, thanks to kousik saraty my problem is solved. I used the field trip lite version instead of the full version. With the full version, the expected results appear. Thanks for the kind and patient support, Greetings, Marcus --------------------------------------------- Dr. Marcus Heldmann Klinik für Neurologie UKSH, Campus Lübeck Paul-Ehrlich-Strasse 1-3, MGZ 23562 Lübeck 0451 317 9313 14 _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Fri Nov 21 10:09:27 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Fri, 21 Nov 2014 09:09:27 +0000 Subject: [FieldTrip] Averaging on a random sample Message-ID: Dear Fieldtrippers, I have a sample of 350 trials for one condition, but for statistical analysis reasons I would like to split randomly this sample in two and average these two parts. so, I used the "randsample" matlab function which seems to work very well and then I averaged this selected sample: randomhalf = randsample(cleandata.trial, 175); avgFCMiddleRing = ft_timelockanalysis(cfg, randomhalf); However, I have the following error message : Error using ft_checkdata (line 366) This function requires raw or comp data as input. Error in ft_timelockanalysis (line 105) data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Does anyone have a solution to fix the problem? Thank you very much! Emilie -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Nov 21 10:29:10 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 21 Nov 2014 10:29:10 +0100 Subject: [FieldTrip] Averaging on a random sample In-Reply-To: <8d9e856a862b4df1a4d98b40c1e18b48@EXPRD01.hosting.ru.nl> References: <8d9e856a862b4df1a4d98b40c1e18b48@EXPRD01.hosting.ru.nl> Message-ID: Dear Emilie, You are not providing a FT data structure to ft_timelockanalysis (which you should), instead you are providing the raw cell array of trials (which you shouldn't). Hence, FT complains that the data is not in a structure that it can work with. There is a cfg-option cfg.trials, which you might like to use instead. Best, Eelke On 21 November 2014 10:09, Caspar, Emilie wrote: > Dear Fieldtrippers, > > I have a sample of 350 trials for one condition, but for statistical > analysis reasons I would like to split randomly this sample in two and > average these two parts. > > so, I used the "randsample" matlab function which seems to work very well > and then I averaged this selected sample: > > randomhalf = randsample(cleandata.trial, 175); > avgFCMiddleRing = ft_timelockanalysis(cfg, randomhalf); > > > However, I have the following error message : > > Error using ft_checkdata (line 366) > This function requires raw or comp data as input. > > Error in ft_timelockanalysis (line 105) > data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', > 'hassampleinfo', 'yes'); > > Does anyone have a solution to fix the problem? > > Thank you very much! > > Emilie > > From tyler.grummett at flinders.edu.au Mon Nov 24 12:56:49 2014 From: tyler.grummett at flinders.edu.au (Tyler Grummett) Date: Mon, 24 Nov 2014 11:56:49 +0000 Subject: [FieldTrip] Thank you for your suggestions In-Reply-To: References: Message-ID: <7EE9068F-7277-44D9-B782-2E307BCB06D8@flinders.edu.au> What specifically did you want to know about the process? Plus I think the go is to include the mailing list so that others can help/benefit from our discussion. Tyler Sent from my iPhone > On 24 Nov 2014, at 6:07 pm, Jing Wang wrote: > > Dear Tyler, > > I am one of Fieldtrip users, just like you are. > > I have been trying to do source analysis of EEG with MRI template recently. I met a problem as you met, which posted in the fieldtrip mailist in July. In the mailist, I did not know whether your problem has been solve or not. Do you mind telling me how do you sovled or giving me your code of source analysis if you have solved it? > Your help are really apprecited. > > Best wishes > > Jing Wang From m.dinov13 at imperial.ac.uk Mon Nov 24 13:03:57 2014 From: m.dinov13 at imperial.ac.uk (Martin Dinov) Date: Mon, 24 Nov 2014 12:03:57 +0000 Subject: [FieldTrip] About huge delay for ft_read_data to return In-Reply-To: <1828503.8MUoyVSXsK@mars.neurophys.uke.uni-hamburg.de> References: <546CC44B.1040800@imperial.ac.uk> <1828503.8MUoyVSXsK@mars.neurophys.uke.uni-hamburg.de> Message-ID: <54731EAD.4040106@imperial.ac.uk> Hi Alex, Apology for late reply. This fixed the issue. Thanks a lot! Kind regards, Martin On 11/20/14, 9:13 AM, Alexander Maye wrote: > Hi Martin, > > if I remember correctly, it helps to read the header once (ft_read_header) and > then pass it to the ft_read_data calls. For continuous reading you need to > update the sample information inside the header struct with the data from > ft_poll_buffer. > > Best, > > ALEX. > > Am Mittwoch, 19. November 2014, 16:24:43 schrieb Martin Dinov: >> Dear all, >> >> I'm trying to do something with realtime EEG data and I'm using the >> ft_read_data function get data from BrainVision Recorder via rda2ft. In >> MATLAB, calling ft_read_data seems to always take >=500ms (even for a >> single sample point from data with srate of 1000Hz) which is >> unacceptably slow for what I want to do. Perhaps specifying channel >> indices to read only some of the data would speed it up, but I haven't >> managed to get this to work. As I am trying to phase lock to the alpha >> band, I need to be able to read in single sample points (after an >> initial larger block that can take longer) much quicker than 500ms >> (<50ms). I highly appreciate any help with this! >> >> Thanks in advance >> >> >> -- >> >> DANKE FÜR 125 JAHRE ENGAGEMENT UND VERTRAUEN. >> www.uke.de/125 >> _____________________________________________________________________ >> >> Besuchen Sie uns auf: www.uke.de >> _____________________________________________________________________ >> >> Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg >> Vorstandsmitglieder: Prof. Dr. Christian Gerloff (Vertreter des Vorsitzenden), Prof. Dr. Dr. Uwe Koch-Gromus, Joachim Prölß, Rainer Schoppik >> _____________________________________________________________________ >> >> SAVE PAPER - THINK BEFORE PRINTING >> >> >> _______________________________________________ >> fieldtrip mailing list >> fieldtrip at donders.ru.nl >> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.debener at uni-oldenburg.de Tue Nov 25 13:05:28 2014 From: stefan.debener at uni-oldenburg.de (Stefan Debener) Date: Tue, 25 Nov 2014 13:05:28 +0100 Subject: [FieldTrip] Postdoctoral Research Associate in brain-computer interfaces Message-ID: <54747088.4030308@uni-oldenburg.de> The Neuropsychology Lab at the University of Oldenburg (Germany) is seeking to fill the position of a *Postdoctoral Research Associate / Research Associate **(wissenschaftliche Mitarbeiterin / wissenschaftlicher Mitarbeiter, E13 TV-L, 100%).* We are seeking a postdoctoral research associate with a strong background in brain-computer interfaces (BCI). The project involves the development of a fully mobile auditory BCI. A key focus will be in the development and evaluation of unobtrusive EEG acquisition technology that is motion-tolerant and can be used in daily-life situations for the monitoring of auditory attention and cognitive states. The Neuropsychology Lab conducts research into the underpinnings of higher visual, auditory and motor functions. We apply non-invasive neurophysiological recording techniques, with the majority of studies using the electroencephalogram (EEG) as method of choice. Our lab features several state-of-the-art stationary high-density EEG systems, eye-tracking, a near infrared spectroscopy (NIRS) system and access to MRI and MEG. Several fully mobile, smartphone-operated wireless EEG systems are available as well. Candidates must have an academic university degree in Biomedical Engineering, Electrical Engineering, Computer Science, or a closely related field. Analytical skills, programming skills in Matlab, experience with Machine Learning and expertise in single-trial EEG analysis is required. Hands-on experience in BCI paradigm development or EEG sensor development is beneficial, as well as knowledge of BCI2000, BCILAB or OpenVibe software. An interest in auditory psychophysiology and a background in neuroscience is a plus but not strictly required. The position is suitable for part-time work, can be filled immediately and is available for initially two years with the aim of extending. The successful candidate will be affiliated to the Cluster of Excellence Hearing4All and the Department of Psychology within the School of Medicine and Health Sciences. Oldenburg has an international reputation in hearing research and hosts for instance the Fraunhofer Group Hearing, Speech and Audio Technology. Many international and interdisciplinary research groups provide an attractive scientific and social environment. Neuropsychology Lab: http://www.uni-oldenburg.de/en/neuropsychology/ Cluster of Excellence Hearing4all: http://hearing4all.eu/EN/ The University of Oldenburg is dedicated to increasing the percentage of women in science. Therefore, female candidates are particularly encouraged to apply. According to § 21 III NHG (legislation governing Higher Education in Lower Saxony) preference will be given to female candidates in cases of equal qualification. Handicapped applicants will be given preference if equally qualified. Please send your application including a cover letter, CV, list of potential referees, list of publications, and copies of certificates for academic degrees to Prof. Dr. Stefan Debener, Carl von Ossietzky Universität Oldenbur, Department Psychologie, D-26111 Oldenburg, Germany. We prefer an electronic application with a single pdf file to stefan.debener at uni-oldenburg.de . Please apply by 15 December 2014 to ensure consideration. -- Prof. Dr. Stefan Debener Neuropsychology Lab Department of Psychology University of Oldenburg D-26111 Oldenburg Germany Office: A7 0-038 Phone: +49-441-798-4271 Fax: +49-441-798-5522 Email: stefan.debener at uni-oldenburg.de -------------- next part -------------- An HTML attachment was scrubbed... URL: From helene.gudi at uni-hamburg.de Tue Nov 25 13:15:46 2014 From: helene.gudi at uni-hamburg.de (Helene Gudi) Date: Tue, 25 Nov 2014 13:15:46 +0100 Subject: [FieldTrip] spectral resolution & interpretation of power estimates Message-ID: <547472F2.6020107@uni-hamburg.de> Dear FieldTrip List, Since a while I am struggeling with a question regarding the spectral resolution and its consequences for interpreting the power vaules. I would appreciate any comments or hints which help me understand the issue. As described in the tutorial on TFR analysis when using the Morlet wavelets the spectral bandwidth at a given frequency is determined by the formula: F/width*2, meaning that when I define cfg.width=7 and look into the estimated power values of e.g. 8Hz, what I get is the power values not for 8 Hz but for a spectral band of 8Hz+/- (8/7*2)/2. Am I correct? If yes, is this also true when estimating the power values using a Hanning window? As described in the tutorial when using the Hanning taper the frequency resolution is defined by: 1/length of the sliding window. Let's say my sliding window = .5s, resulting in a frequency resolution of 2 Hz. Now, if i look into the power estimate for 10 Hz, do I get the spectral band of 2Hz at a given frequency eg. 9-11Hz, for 10Hz etc.? My next question refers to the 'cfg.pad' parameter, in the help it says: "the padding determines the spectral resolution". I unfortunately could not find any further explanations. What exactly does it mean? How do I compute the exact frequency resolution once cfg.pad has been used? Is it 1/cfg.pad? Does the padding allow to estimate power values for frequencies other than given by '1/length of time window'-resolution? As in the code below power estimates are calculated in 1Hz steps. Do the power estimates at 3Hz,4Hz etc. make sense at all, given the frequency resolution of 2.5Hz (as defined by 1/cfg.t_ftimwin)? What spectral band is actually included in the single 1Hz bins? Is it a problem if the frequency resolution ist not an integer? cfg = []; cfg.output = 'pow'; cfg.channel = 'all'; cfg.keeptapers = 'no'; cfg.pad = 7; cfg.method = 'mtmconvol'; cfg.toi = -1.75:0.05:1.75; cfg.taper = 'hanning'; cfg.keeptrials = 'yes'; cfg.foi = 3:35; cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; ft_freqanalysis(cfg, data); I would be very thankful for any help! Lena From ben.vanlier at bsse.ethz.ch Tue Nov 25 13:43:40 2014 From: ben.vanlier at bsse.ethz.ch (van Lier Ben) Date: Tue, 25 Nov 2014 12:43:40 +0000 Subject: [FieldTrip] baselinetype decibel and plotting error Message-ID: Hi, I would like to plot my data in decibel. It works fine when running singleplotTFR, however I get an error when i use the plot interactivity to select a time/freq range within the singleplotTFR. The resulting topoplot has no color (it does show the contourlines of the data) and the layout outline is stretched (should be square). running topoplotTFR directly works fine and using the other baselinetypes is also no problem. the error is only when interacting with a spectrogram in decibel. Error using surf (line 75) X, Y, Z, and C cannot be complex Error in ft_plot_topo (line 251) h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in topoplot_common (line 704) ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ft_topoplotTFR (line 186) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_singleplotTFR>select_topoplotTFR (line 579) ft_topoplotTFR(cfg, varargin{:}); Error in ft_select_range>evalCallback (line 325) feval(funhandle, funargs{:}, val, cmenulab); Error in ft_select_range (line 159) evalCallback(callback, userData.range); Error while evaluating figure WindowButtonDownFcn its not the end of the world, but its such a nice feature to have... thank you, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From n.lam at fcdonders.ru.nl Tue Nov 25 15:33:33 2014 From: n.lam at fcdonders.ru.nl (Lam, N.H.L. (Nietzsche)) Date: Tue, 25 Nov 2014 14:33:33 +0000 Subject: [FieldTrip] spectral resolution & interpretation of power estimates In-Reply-To: <547472F2.6020107@uni-hamburg.de> References: <547472F2.6020107@uni-hamburg.de> Message-ID: Hi Helene, The idea in general is to design one's experiment in a way that allows one to observe effects at the frequency of interest. Otherwise, what you might end up with is an experiment that doesn't allow you to estimate power at the frequencies of interest. For wavelets, given your specifications, you would get a spectral bandwidth of 8/7*2 = 2.28 Hz. So 8 +/- 2.28 Hz ( 5.72 - 10.28) i.e. the bandwidth calculated refers to the bandwidth on one end, not both. Therefore, you shouldn't divide by two. Similarly with multitapers, if you have a smoothing for 8 Hz, that's -8Hz and +8Hz. For the Hanning taper, 1/0.5s = 2Hz, means you get estimates of power that are multiples of 2 Hz, so 10, 12, 14 Hz ..etc. With regards to what the spectral bandwidth is, the short answer is that it is plus and minus half the frequency resolution. So, for 10 Hz, it is 9 - 11Hz. The reasons behind this answer are to do with the spectral profile of the taper (e.g., a Hanning window) that you apply to your data. I would suggest that you take a look at one of our lecture video's here by Robert: https://www.youtube.com/watch?feature=player_detailpage&v=QLvsa1r1Voc#t=741 where he provides a much more detailed explanation. cfg.pad parameter in ft_freqanalysis: This parameter is helpful if your trials are of different length. If you set cfg.pad = 7, that means any trial shorter than 7s long will be padded to become 7s worth of data. The type of data that you use to pad is specified in cfg.padtype. The frequency resolution of your data is indeed 1/cfg.pad. There is a suggested limit for how much you should pad given your data, but I'm not sure what the limit is, maybe someone else knows. Now with your code, cfg.toi = -1.75:0.05:1.75; cfg.taper = 'hanning'; cfg.foi = 3:35; cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; You have a 0.4 second window. So 1/0.4 = 2.5Hz frequency resolution, as you figured out. This means you can only estimate in steps of 2.5Hz so doing power estimates at 1 Hz steps does *not* make sense. To get any sensible estimate, you would need something like this cfg.foi = 2.5:2.5:35; Finally, no, the frequency resolution does not have to be an integer. We don't know what frequency(ies) the brain oscillates, but integers allow for us to deal with the data more easily. I hope this helps, and I hope that if I've not been entirely accurate with my explanations that someone will jump in to correct me. Best, Nietzsche ________________________________________ From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Helene Gudi [helene.gudi at uni-hamburg.de] Sent: 25 November 2014 13:15 To: fieldtrip at science.ru.nl Subject: [FieldTrip] spectral resolution & interpretation of power estimates Dear FieldTrip List, Since a while I am struggeling with a question regarding the spectral resolution and its consequences for interpreting the power vaules. I would appreciate any comments or hints which help me understand the issue. As described in the tutorial on TFR analysis when using the Morlet wavelets the spectral bandwidth at a given frequency is determined by the formula: F/width*2, meaning that when I define cfg.width=7 and look into the estimated power values of e.g. 8Hz, what I get is the power values not for 8 Hz but for a spectral band of 8Hz+/- (8/7*2)/2. Am I correct? If yes, is this also true when estimating the power values using a Hanning window? As described in the tutorial when using the Hanning taper the frequency resolution is defined by: 1/length of the sliding window. Let's say my sliding window = .5s, resulting in a frequency resolution of 2 Hz. Now, if i look into the power estimate for 10 Hz, do I get the spectral band of 2Hz at a given frequency eg. 9-11Hz, for 10Hz etc.? My next question refers to the 'cfg.pad' parameter, in the help it says: "the padding determines the spectral resolution". I unfortunately could not find any further explanations. What exactly does it mean? How do I compute the exact frequency resolution once cfg.pad has been used? Is it 1/cfg.pad? Does the padding allow to estimate power values for frequencies other than given by '1/length of time window'-resolution? As in the code below power estimates are calculated in 1Hz steps. Do the power estimates at 3Hz,4Hz etc. make sense at all, given the frequency resolution of 2.5Hz (as defined by 1/cfg.t_ftimwin)? What spectral band is actually included in the single 1Hz bins? Is it a problem if the frequency resolution ist not an integer? cfg = []; cfg.output = 'pow'; cfg.channel = 'all'; cfg.keeptapers = 'no'; cfg.pad = 7; cfg.method = 'mtmconvol'; cfg.toi = -1.75:0.05:1.75; cfg.taper = 'hanning'; cfg.keeptrials = 'yes'; cfg.foi = 3:35; cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; ft_freqanalysis(cfg, data); I would be very thankful for any help! Lena _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jorn at artinis.com Wed Nov 26 08:43:47 2014 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Wed, 26 Nov 2014 08:43:47 +0100 Subject: [FieldTrip] spectral resolution & interpretation of power estimates In-Reply-To: References: <547472F2.6020107@uni-hamburg.de> Message-ID: <000001d0094c$b734ce00$259e6a00$@artinis.com> Hey, as an addition, maybe keep in mind that using filters you in fact widen your main lobe (i.e. decrease the effective frequency resolution, e.g. for a Hanning taper the main lobe drops to zero at twice the Raleigh frequency), and you do this to decrease magnitude of the side lobes. Most people tend to forget such things when interpreting their data (incl. me). Best, Jörn -- Jörn M. Horschig, Software Engineer Artinis Medical Systems  |  +31 481 350 980 > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Lam, N.H.L. (Nietzsche) > Sent: Tuesday, November 25, 2014 3:34 PM > To: FieldTrip discussion list > Subject: Re: [FieldTrip] spectral resolution & interpretation of power > estimates > > Hi Helene, > > The idea in general is to design one's experiment in a way that allows one to > observe effects at the frequency of interest. Otherwise, what you might > end up with is an experiment that doesn't allow you to estimate power at > the frequencies of interest. > > For wavelets, given your specifications, you would get a spectral bandwidth > of 8/7*2 = 2.28 Hz. > So 8 +/- 2.28 Hz ( 5.72 - 10.28) i.e. the bandwidth calculated refers to the > bandwidth on one end, not both. Therefore, you shouldn't divide by two. > Similarly with multitapers, if you have a smoothing for 8 Hz, that's -8Hz and > +8Hz. > > For the Hanning taper, 1/0.5s = 2Hz, means you get estimates of power that > are multiples of 2 Hz, so 10, 12, 14 Hz ..etc. With regards to what the spectral > bandwidth is, the short answer is that it is plus and minus half the frequency > resolution. So, for 10 Hz, it is 9 - 11Hz. The reasons behind this answer are to > do with the spectral profile of the taper (e.g., a Hanning window) that you > apply to your data. I would suggest that you take a look at one of our lecture > video's here by Robert: > https://www.youtube.com/watch?feature=player_detailpage&v=QLvsa1r1V > oc#t=741 where he provides a much more detailed explanation. > > cfg.pad parameter in ft_freqanalysis: This parameter is helpful if your trials > are of different length. If you set cfg.pad = 7, that means any trial shorter > than 7s long will be padded to become 7s worth of data. The type of data > that you use to pad is specified in cfg.padtype. The frequency resolution of > your data is indeed 1/cfg.pad. There is a suggested limit for how much you > should pad given your data, but I'm not sure what the limit is, maybe > someone else knows. > > Now with your code, > cfg.toi = -1.75:0.05:1.75; > cfg.taper = 'hanning'; > cfg.foi = 3:35; > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > > You have a 0.4 second window. So 1/0.4 = 2.5Hz frequency resolution, as you > figured out. > This means you can only estimate in steps of 2.5Hz so doing power estimates > at 1 Hz steps does *not* make sense. To get any sensible estimate, you > would need something like this cfg.foi = 2.5:2.5:35; > > Finally, no, the frequency resolution does not have to be an integer. We > don't know what frequency(ies) the brain oscillates, but integers allow for us > to deal with the data more easily. > > I hope this helps, and I hope that if I've not been entirely accurate with my > explanations that someone will jump in to correct me. > > Best, > Nietzsche > > ________________________________________ > From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on > behalf of Helene Gudi [helene.gudi at uni-hamburg.de] > Sent: 25 November 2014 13:15 > To: fieldtrip at science.ru.nl > Subject: [FieldTrip] spectral resolution & interpretation of power estimates > > Dear FieldTrip List, > > Since a while I am struggeling with a question regarding the spectral > resolution and its consequences for interpreting the power vaules. I would > appreciate any comments or hints which help me understand the issue. > > As described in the tutorial on TFR analysis when using the Morlet wavelets > the spectral bandwidth at a given frequency is determined by the formula: > F/width*2, meaning that when I define cfg.width=7 and look into the > estimated power values of e.g. 8Hz, what I get is the power values not for 8 > Hz but for a spectral band of 8Hz+/- (8/7*2)/2. > Am I correct? > If yes, is this also true when estimating the power values using a Hanning > window? As described in the tutorial when using the Hanning taper the > frequency resolution is defined by: 1/length of the sliding window. Let's say > my sliding window = .5s, resulting in a frequency resolution of 2 Hz. Now, if i > look into the power estimate for 10 Hz, do I get the spectral band of 2Hz at a > given frequency eg. 9-11Hz, for 10Hz etc.? > > My next question refers to the 'cfg.pad' parameter, in the help it says: > "the padding determines the spectral resolution". I unfortunately could not > find any further explanations. What exactly does it mean? How do I compute > the exact frequency resolution once cfg.pad has been used? Is it 1/cfg.pad? > Does the padding allow to estimate power values for frequencies other than > given by '1/length of time window'-resolution? As in the code below power > estimates are calculated in 1Hz steps. Do the power estimates at 3Hz,4Hz etc. > make sense at all, given the frequency resolution of 2.5Hz (as defined by > 1/cfg.t_ftimwin)? What spectral band is actually included in the single 1Hz > bins? Is it a problem if the frequency resolution ist not an integer? > > cfg = []; > cfg.output = 'pow'; > cfg.channel = 'all'; > cfg.keeptapers = 'no'; > cfg.pad = 7; > cfg.method = 'mtmconvol'; > cfg.toi = -1.75:0.05:1.75; > cfg.taper = 'hanning'; > cfg.keeptrials = 'yes'; > cfg.foi = 3:35; > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > ft_freqanalysis(cfg, data); > > I would be very thankful for any help! > Lena > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From jorn at artinis.com Wed Nov 26 08:44:33 2014 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Wed, 26 Nov 2014 08:44:33 +0100 Subject: [FieldTrip] baselinetype decibel and plotting error In-Reply-To: References: Message-ID: <000101d0094c$d26d3040$774790c0$@artinis.com> Hi Ben, nice to see here, and that you are actively using FieldTrip ;) My guess is that the error occurs because you have negative values that you want to transform, e.g. because you are taking a contrats between conditions. Converting to decibels involves taking the logarithm, and the logarithm of negative numbers is not good (i.e. you get complex numbers out). A simple solution is to first take the logarithm of e.g. individual conditions and then subtract or, which is equivalent, dividing the two conditions from one another and then taking the logarithm. Best, Jörn -- Jörn M. Horschig, Software Engineer Artinis Medical Systems | +31 481 350 980 From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of van Lier Ben Sent: Tuesday, November 25, 2014 1:44 PM To: fieldtrip at science.ru.nl Subject: [FieldTrip] baselinetype decibel and plotting error Hi, I would like to plot my data in decibel. It works fine when running singleplotTFR, however I get an error when i use the plot interactivity to select a time/freq range within the singleplotTFR. The resulting topoplot has no color (it does show the contourlines of the data) and the layout outline is stretched (should be square). running topoplotTFR directly works fine and using the other baselinetypes is also no problem. the error is only when interacting with a spectrogram in decibel. Error using surf (line 75) X, Y, Z, and C cannot be complex Error in ft_plot_topo (line 251) h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading); Error in topoplot_common (line 704) ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,... Error in ft_topoplotTFR (line 186) [cfg] = topoplot_common(cfg, varargin{:}); Error in ft_singleplotTFR>select_topoplotTFR (line 579) ft_topoplotTFR(cfg, varargin{:}); Error in ft_select_range>evalCallback (line 325) feval(funhandle, funargs{:}, val, cmenulab); Error in ft_select_range (line 159) evalCallback(callback, userData.range); Error while evaluating figure WindowButtonDownFcn its not the end of the world, but its such a nice feature to have... thank you, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorn at artinis.com Wed Nov 26 08:47:39 2014 From: jorn at artinis.com (=?iso-8859-1?Q?J=F6rn_M._Horschig?=) Date: Wed, 26 Nov 2014 08:47:39 +0100 Subject: [FieldTrip] spectral resolution & interpretation of power estimates In-Reply-To: <000001d0094c$b734ce00$259e6a00$@artinis.com> References: <547472F2.6020107@uni-hamburg.de> <000001d0094c$b734ce00$259e6a00$@artinis.com> Message-ID: <000b01d0094d$415844e0$c408cea0$@artinis.com> please allow me to correct my first sentence: > as an addition, maybe keep in mind that using *tapers* you in fact widen your -- Jörn M. Horschig, Software Engineer Artinis Medical Systems  |  +31 481 350 980 > -----Original Message----- > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > bounces at science.ru.nl] On Behalf Of Jörn M. Horschig > Sent: Wednesday, November 26, 2014 8:44 AM > To: 'FieldTrip discussion list' > Subject: Re: [FieldTrip] spectral resolution & interpretation of power > estimates > > Hey, > > as an addition, maybe keep in mind that using filters you in fact widen your > main lobe (i.e. decrease the effective frequency resolution, e.g. for a > Hanning taper the main lobe drops to zero at twice the Raleigh frequency), > and you do this to decrease magnitude of the side lobes. Most people tend > to forget such things when interpreting their data (incl. me). > > Best, > Jörn > > -- > > Jörn M. Horschig, Software Engineer > Artinis Medical Systems  |  +31 481 350 980 > > > -----Original Message----- > > From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip- > > bounces at science.ru.nl] On Behalf Of Lam, N.H.L. (Nietzsche) > > Sent: Tuesday, November 25, 2014 3:34 PM > > To: FieldTrip discussion list > > Subject: Re: [FieldTrip] spectral resolution & interpretation of power > > estimates > > > > Hi Helene, > > > > The idea in general is to design one's experiment in a way that allows > > one > to > > observe effects at the frequency of interest. Otherwise, what you > > might end up with is an experiment that doesn't allow you to estimate > > power at the frequencies of interest. > > > > For wavelets, given your specifications, you would get a spectral > bandwidth > > of 8/7*2 = 2.28 Hz. > > So 8 +/- 2.28 Hz ( 5.72 - 10.28) i.e. the bandwidth calculated > > refers > to the > > bandwidth on one end, not both. Therefore, you shouldn't divide by two. > > Similarly with multitapers, if you have a smoothing for 8 Hz, that's > > -8Hz > and > > +8Hz. > > > > For the Hanning taper, 1/0.5s = 2Hz, means you get estimates of > > power > that > > are multiples of 2 Hz, so 10, 12, 14 Hz ..etc. With regards to what the > spectral > > bandwidth is, the short answer is that it is plus and minus half the > frequency > > resolution. So, for 10 Hz, it is 9 - 11Hz. The reasons behind this > answer are to > > do with the spectral profile of the taper (e.g., a Hanning window) > > that > you > > apply to your data. I would suggest that you take a look at one of > > our > lecture > > video's here by Robert: > > > https://www.youtube.com/watch?feature=player_detailpage&v=QLvsa1r1V > > oc#t=741 where he provides a much more detailed explanation. > > > > cfg.pad parameter in ft_freqanalysis: This parameter is helpful if > > your > trials > > are of different length. If you set cfg.pad = 7, that means any trial > shorter > > than 7s long will be padded to become 7s worth of data. The type of data > > that you use to pad is specified in cfg.padtype. The frequency > resolution of > > your data is indeed 1/cfg.pad. There is a suggested limit for how much > you > > should pad given your data, but I'm not sure what the limit is, maybe > > someone else knows. > > > > Now with your code, > > cfg.toi = -1.75:0.05:1.75; > > cfg.taper = 'hanning'; > > cfg.foi = 3:35; > > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > > > > You have a 0.4 second window. So 1/0.4 = 2.5Hz frequency resolution, > > as > you > > figured out. > > This means you can only estimate in steps of 2.5Hz so doing power > estimates > > at 1 Hz steps does *not* make sense. To get any sensible estimate, > > you would need something like this cfg.foi = 2.5:2.5:35; > > > > Finally, no, the frequency resolution does not have to be an integer. > > We don't know what frequency(ies) the brain oscillates, but integers > > allow > for us > > to deal with the data more easily. > > > > I hope this helps, and I hope that if I've not been entirely accurate > > with > my > > explanations that someone will jump in to correct me. > > > > Best, > > Nietzsche > > > > ________________________________________ > > From: fieldtrip-bounces at science.ru.nl > > [fieldtrip-bounces at science.ru.nl] on behalf of Helene Gudi > > [helene.gudi at uni-hamburg.de] > > Sent: 25 November 2014 13:15 > > To: fieldtrip at science.ru.nl > > Subject: [FieldTrip] spectral resolution & interpretation of power > estimates > > > > Dear FieldTrip List, > > > > Since a while I am struggeling with a question regarding the spectral > > resolution and its consequences for interpreting the power vaules. I > > would appreciate any comments or hints which help me understand the > issue. > > > > As described in the tutorial on TFR analysis when using the Morlet > wavelets > > the spectral bandwidth at a given frequency is determined by the formula: > > F/width*2, meaning that when I define cfg.width=7 and look into the > > estimated power values of e.g. 8Hz, what I get is the power values not > > for > 8 > > Hz but for a spectral band of 8Hz+/- (8/7*2)/2. > > Am I correct? > > If yes, is this also true when estimating the power values using a > > Hanning window? As described in the tutorial when using the Hanning > > taper the frequency resolution is defined by: 1/length of the sliding > > window. Let's > say > > my sliding window = .5s, resulting in a frequency resolution of 2 Hz. > > Now, > if i > > look into the power estimate for 10 Hz, do I get the spectral band of > > 2Hz > at a > > given frequency eg. 9-11Hz, for 10Hz etc.? > > > > My next question refers to the 'cfg.pad' parameter, in the help it says: > > "the padding determines the spectral resolution". I unfortunately > > could > not > > find any further explanations. What exactly does it mean? How do I > > compute the exact frequency resolution once cfg.pad has been used? Is > > it > 1/cfg.pad? > > Does the padding allow to estimate power values for frequencies other > > than given by '1/length of time window'-resolution? As in the code > > below power estimates are calculated in 1Hz steps. Do the power > > estimates at 3Hz,4Hz > etc. > > make sense at all, given the frequency resolution of 2.5Hz (as defined > > by 1/cfg.t_ftimwin)? What spectral band is actually included in the > > single > 1Hz > > bins? Is it a problem if the frequency resolution ist not an integer? > > > > cfg = []; > > cfg.output = 'pow'; > > cfg.channel = 'all'; > > cfg.keeptapers = 'no'; > > cfg.pad = 7; > > cfg.method = 'mtmconvol'; > > cfg.toi = -1.75:0.05:1.75; > > cfg.taper = 'hanning'; > > cfg.keeptrials = 'yes'; > > cfg.foi = 3:35; > > cfg.t_ftimwin = ones(length(cfg.foi),1) .* 0.4; > > ft_freqanalysis(cfg, data); > > > > I would be very thankful for any help! > > Lena > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > > _______________________________________________ > > fieldtrip mailing list > > fieldtrip at donders.ru.nl > > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip > > > _______________________________________________ > fieldtrip mailing list > fieldtrip at donders.ru.nl > http://mailman.science.ru.nl/mailman/listinfo/fieldtrip From e.caspar at ucl.ac.uk Wed Nov 26 14:26:27 2014 From: e.caspar at ucl.ac.uk (Caspar, Emilie) Date: Wed, 26 Nov 2014 13:26:27 +0000 Subject: [FieldTrip] Averaging on a random sample In-Reply-To: References: <8d9e856a862b4df1a4d98b40c1e18b48@EXPRD01.hosting.ru.nl> Message-ID: Thanks Eelke If this can help someone else, here is the correct code: arrondi=roundn(size(cleandata.trial,2)/2, 0); a = randperm(size(cleandata.trial,2)); r1=a(1:arrondi); r2=a(arrondi+1:end); cfg = []; cfg.trials = r1; avgFCIndexHALF1 = ft_timelockanalysis(cfg, cleandata); cfg = []; cfg.trials = r2; avgFCIndexHALF2 = ft_timelockanalysis(cfg, cleandata); Best, Emilie --------------------------------------------- Emilie Caspar Aspirante FNRS - Ph.D. Student Consciousness, Cognition & Computation Group (CO3) Centre de Recherche Cognition et Neurosciences (CRCN) ULB Neurosciences Institute (UNI) Université Libre de Bruxelles Av. F.-D. Roosevelt, 50 1050 Bruxelles BELGIUM Voice : +32 2 650 32 95 mail : ecaspar at ulb.ac.be office: DB10-138 Le 21 nov. 2014 à 10:29, Eelke Spaak > a écrit : Dear Emilie, You are not providing a FT data structure to ft_timelockanalysis (which you should), instead you are providing the raw cell array of trials (which you shouldn't). Hence, FT complains that the data is not in a structure that it can work with. There is a cfg-option cfg.trials, which you might like to use instead. Best, Eelke On 21 November 2014 10:09, Caspar, Emilie > wrote: Dear Fieldtrippers, I have a sample of 350 trials for one condition, but for statistical analysis reasons I would like to split randomly this sample in two and average these two parts. so, I used the "randsample" matlab function which seems to work very well and then I averaged this selected sample: randomhalf = randsample(cleandata.trial, 175); avgFCMiddleRing = ft_timelockanalysis(cfg, randomhalf); However, I have the following error message : Error using ft_checkdata (line 366) This function requires raw or comp data as input. Error in ft_timelockanalysis (line 105) data = ft_checkdata(data, 'datatype', {'raw', 'comp'}, 'feedback', 'yes', 'hassampleinfo', 'yes'); Does anyone have a solution to fix the problem? Thank you very much! Emilie _______________________________________________ fieldtrip mailing list fieldtrip at donders.ru.nl http://mailman.science.ru.nl/mailman/listinfo/fieldtrip -------------- next part -------------- An HTML attachment was scrubbed... URL: From giuseppespinelli88 at gmail.com Fri Nov 28 13:06:33 2014 From: giuseppespinelli88 at gmail.com (Giuseppe Spinelli) Date: Fri, 28 Nov 2014 13:06:33 +0100 Subject: [FieldTrip] HELP time_frequency Message-ID: *n *Dear FieldTrippers I am new to FieldTrip so I hope you could forgive my inexperience! I am trying to segment a triggered EEGLAB dataset (.set) which has been already preprocessed (resempled, filtered and cleaned by ICA). What I did was basically to define ethe eventvalue field with respect to each experimental condition (32,64,128) in the continuous eeglab dataset then defining trial and then I run the preprocess function. Finally I run the ft_databrowser for visual inspecting one condition only (data_SE). The process results in these errors: Error using ft_fetch_data (line 62) data does not contain a consistent trial definition, fetching data is not possible Error in ft_databrowser>redraw_cb (line 1485) art = ft_fetch_data(opt.artdata, 'begsample', begsample, 'endsample', endsample); Error in ft_databrowser (line 696) redraw_cb(h); Error in eeglab2fieldtrip (line 30) cfg = ft_databrowser(cfg); here the script % loading .set dataset (from EEGLAB) cfg = []; cfg.dataset = 'C:\Users\GiuS\Documents\MATLAB\CAVE_ERROR_2_FIELDTRIP\EEG\S01.set'; cfg.continuous = 'yes'; % defining trials cfg.trialfun = 'ft_trialfun_general'; cfg.trialdef.eventtype = 'trigger'; % cfg.trialdef.eventvalue = 32; cfg.trialdef.eventvalue = 64; % cfg.trialdef.eventvalue = 128; cfg.trialdef.prestim = 1; cfg.trialdef.poststim = 2; cfg = ft_definetrial(cfg); % data_CO = ft_preprocessing(cfg); % n = 140 data_SE = ft_preprocessing(cfg); % n = 30 % data_LE = ft_preprocessing(cfg); % n = 30 % % plotting cfg.viewmode = 'vertical'; cfg.plotlabels = 'yes'; cfg.blocksize = 10; % cfg = ft_databrowser(cfg, data_CO); cfg = ft_databrowser(cfg, data_SE); % cfg = ft_databrowser(cfg, data_LE); I would be glad to receive some help. Many thanks in advance - *Giuseppe Spinelli*, Ph.D. student *Social and Cognitive Neuroscience Laboratory* *http://agliotilab.org/lab-staff/phd-students/1st-year/giuseppe-spinelli#anchor * Department of Psychology, Sapienza University of Rome *via dei Marsi 78, 00185 - Rome* Phone/Fax: (+39) 06-49917635 IRCCS Fondazione Santa Lucia *via Ardeatina 306, 00142 - Rome* *Tel. (+39) 06 5150 1107 <%28%2B39%29%2006%205150%201107>* @: giuseppe.spinelli at uniroma1.it -------------- next part -------------- An HTML attachment was scrubbed... URL: From eelke.spaak at donders.ru.nl Fri Nov 28 13:57:02 2014 From: eelke.spaak at donders.ru.nl (Eelke Spaak) Date: Fri, 28 Nov 2014 13:57:02 +0100 Subject: [FieldTrip] HELP time_frequency In-Reply-To: <211016fc25f346999e5b700acd099c3a@EXPRD02.hosting.ru.nl> References: <211016fc25f346999e5b700acd099c3a@EXPRD02.hosting.ru.nl> Message-ID: Dear Giuseppe, Try initializing your cfg to empty (cfg = [];) at the beginning of your %% plotting block. In general, every FT function call should use its own cfg-structure. (The one exception being the pattern cfg = ft_definetrial(cfg); data = ft_preprocessing(cfg);, which remains for historical reasons).) Best, Eelke On 28 November 2014 at 13:06, Giuseppe Spinelli wrote: > n Dear FieldTrippers > > I am new to FieldTrip so I hope you could forgive my inexperience! > > I am trying to segment a triggered EEGLAB dataset (.set) which has been > already preprocessed (resempled, filtered and cleaned by ICA). > > What I did was basically to define ethe eventvalue field with respect to > each experimental condition (32,64,128) in the continuous eeglab dataset > then defining trial and then I run the preprocess function. Finally I run > the ft_databrowser for visual inspecting one condition only (data_SE). > > The process results in these errors: > > Error using ft_fetch_data (line 62) > data does not contain a consistent trial definition, fetching data is not > possible > > Error in ft_databrowser>redraw_cb (line 1485) > art = ft_fetch_data(opt.artdata, 'begsample', begsample, 'endsample', > endsample); > > Error in ft_databrowser (line 696) > redraw_cb(h); > > Error in eeglab2fieldtrip (line 30) > cfg = ft_databrowser(cfg); > > > here the script > > % loading .set dataset (from EEGLAB) > cfg = []; > cfg.dataset = > 'C:\Users\GiuS\Documents\MATLAB\CAVE_ERROR_2_FIELDTRIP\EEG\S01.set'; > cfg.continuous = 'yes'; > > % defining trials > cfg.trialfun = 'ft_trialfun_general'; > cfg.trialdef.eventtype = 'trigger'; > > % cfg.trialdef.eventvalue = 32; > cfg.trialdef.eventvalue = 64; > % cfg.trialdef.eventvalue = 128; > > cfg.trialdef.prestim = 1; > cfg.trialdef.poststim = 2; > > cfg = ft_definetrial(cfg); > > % data_CO = ft_preprocessing(cfg); % n = 140 > data_SE = ft_preprocessing(cfg); % n = 30 > % data_LE = ft_preprocessing(cfg); % n = 30 > > % % plotting > cfg.viewmode = 'vertical'; > cfg.plotlabels = 'yes'; > cfg.blocksize = 10; > % cfg = ft_databrowser(cfg, data_CO); > cfg = ft_databrowser(cfg, data_SE); > % cfg = ft_databrowser(cfg, data_LE); > > I would be glad to receive some help. > > Many thanks in advance > > - > Giuseppe Spinelli, Ph.D. student > Social and Cognitive Neuroscience Laboratory > http://agliotilab.org/lab-staff/phd-students/1st-year/giuseppe-spinelli#anchor > > Department of Psychology, Sapienza University of Rome > via dei Marsi 78, 00185 - Rome > Phone/Fax: (+39) 06-49917635 > > IRCCS Fondazione Santa Lucia > via Ardeatina 306, 00142 - Rome > Tel. (+39) 06 5150 1107 > > @: giuseppe.spinelli at uniroma1.it